From 62b676502a0a77be79def51cd72024be24b29d0b Mon Sep 17 00:00:00 2001
From: Zachary Goldberg <44350920+zackigoldberg@users.noreply.github.com>
Date: Fri, 23 May 2025 15:18:28 -0700
Subject: [PATCH] commit updates from generating new version
---
.github/workflows/python.yml | 31 +
.gitlab-ci.yml | 42 +-
.openapi-generator/FILES | 171 +
.openapi-generator/VERSION | 2 +-
.travis.yml | 16 +-
README.md | 94 +-
docs/AddFileLabelRequest.md | 19 +
docs/CreateApi.md | 799 +--
docs/CreateConverterConfigParameters.md | 19 +
docs/CreateWebhookOptions.md | 31 +
docs/DeleteLiltCreateContent200Response.md | 29 +
docs/DeleteSegmentFromMemoryResponse.md | 19 +
docs/DocumentWithSegments.md | 21 +-
docs/DocumentWithoutSegments.md | 19 +
docs/DocumentWithoutSegmentsStatus.md | 19 +
docs/DocumentsApi.md | 210 +-
docs/Domain.md | 33 +
docs/DomainList.md | 30 +
docs/DomainMetadata.md | 31 +
docs/DomainReference.md | 30 +
docs/DomainsApi.md | 102 +
docs/Error.md | 19 +
docs/FileDeleteResponse.md | 19 +
docs/FilesApi.md | 565 +--
docs/FilterConfig.md | 42 +
docs/GetLiltCreateContentResponse.md | 21 +-
docs/Job.md | 19 +
docs/JobCreateParameters.md | 26 +-
docs/JobDeleteResponse.md | 19 +
docs/JobLeverageStats.md | 21 +-
docs/JobProject.md | 19 +
docs/JobStats.md | 21 +-
docs/JobUpdateParameters.md | 19 +
docs/JobsApi.md | 1089 ++--
docs/LanguagePair.md | 21 +-
docs/LanguagesApi.md | 82 +-
docs/LanguagesResponse.md | 23 +-
docs/LiltCreateContent.md | 19 +
docs/LiltCreateContentPreferences.md | 19 +
docs/LiltCreateContentRequest.md | 19 +
docs/LiltCreateContentTemplateParams.md | 21 +-
docs/MemoriesApi.md | 817 +--
docs/Memory.md | 21 +-
docs/MemoryCreateParameters.md | 19 +
docs/MemoryDeleteResponse.md | 19 +
docs/MemoryImportResponse.md | 19 +
docs/MemoryUpdateParameters.md | 19 +
docs/Model.md | 36 +
docs/Project.md | 23 +-
docs/ProjectCreateParameters.md | 31 +-
docs/ProjectDeleteResponse.md | 19 +
docs/ProjectStats.md | 19 +
docs/ProjectsApi.md | 276 +-
docs/SDLXLIFFFilter.md | 19 +
docs/Segment.md | 19 +
docs/SignLiltCreateTermsResponse.md | 19 +
docs/SourceFile.md | 21 +-
docs/TermbaseExportResponse.md | 19 +
docs/TranslateApi.md | 378 +-
docs/TranslateSegmentBody.md | 19 +
docs/Translation.md | 23 +-
docs/TranslationInfo.md | 19 +
docs/TranslationList.md | 23 +-
docs/TranslationMemoryEntry.md | 21 +-
docs/WebhookConfigurationApi.md | 450 ++
docs/WebhookResponse.md | 32 +
docs/WebhooksUpdateRequest.md | 31 +
docs/WebhooksUpdateRequestAnyOf.md | 29 +
docs/WebhooksUpdateRequestAnyOf1.md | 29 +
docs/WebhooksUpdateRequestAnyOf2.md | 29 +
docs/WorkflowStageAssignment.md | 19 +
docs/WorkflowStageTemplate.md | 19 +
docs/WorkflowTemplate.md | 21 +-
docs/WorkflowsApi.md | 87 +-
git_push.sh | 7 +-
lilt/__init__.py | 32 +-
lilt/api/__init__.py | 5 +-
lilt/api/create_api.py | 3260 ++++++++----
lilt/api/documents_api.py | 945 +++-
lilt/api/domains_api.py | 305 ++
lilt/api/files_api.py | 2447 ++++++---
lilt/api/jobs_api.py | 4442 ++++++++++++-----
lilt/api/languages_api.py | 358 +-
lilt/api/memories_api.py | 3497 +++++++++----
lilt/api/projects_api.py | 1266 +++--
lilt/api/translate_api.py | 1611 ++++--
lilt/api/webhook_configuration_api.py | 1374 +++++
lilt/api/workflows_api.py | 359 +-
lilt/api_client.py | 759 +--
lilt/api_response.py | 21 +
lilt/configuration.py | 358 +-
lilt/exceptions.py | 138 +-
lilt/models/__init__.py | 24 +-
lilt/models/add_file_label_request.py | 157 +-
.../create_converter_config_parameters.py | 158 +-
lilt/models/create_webhook_options.py | 99 +
.../delete_lilt_create_content200_response.py | 87 +
.../delete_segment_from_memory_response.py | 155 +-
lilt/models/document_with_segments.py | 729 +--
lilt/models/document_without_segments.py | 721 +--
.../document_without_segments_status.py | 185 +-
lilt/models/domain.py | 119 +
lilt/models/domain_list.py | 97 +
lilt/models/domain_metadata.py | 91 +
lilt/models/domain_reference.py | 89 +
lilt/models/error.py | 157 +-
lilt/models/file_delete_response.py | 199 +-
lilt/models/filter_config.py | 132 +
.../get_lilt_create_content_response.py | 169 +-
lilt/models/job.py | 390 +-
lilt/models/job_create_parameters.py | 404 +-
lilt/models/job_delete_response.py | 157 +-
lilt/models/job_leverage_stats.py | 303 +-
lilt/models/job_project.py | 675 +--
lilt/models/job_stats.py | 561 +--
lilt/models/job_update_parameters.py | 283 +-
lilt/models/language_pair.py | 547 +-
lilt/models/languages_response.py | 199 +-
lilt/models/lilt_create_content.py | 334 +-
.../models/lilt_create_content_preferences.py | 199 +-
lilt/models/lilt_create_content_request.py | 304 +-
.../lilt_create_content_template_params.py | 298 +-
lilt/models/memory.py | 479 +-
lilt/models/memory_create_parameters.py | 300 +-
lilt/models/memory_delete_response.py | 199 +-
lilt/models/memory_import_response.py | 199 +-
lilt/models/memory_update_parameters.py | 201 +-
lilt/models/model.py | 101 +
lilt/models/project.py | 683 +--
lilt/models/project_create_parameters.py | 359 +-
lilt/models/project_delete_response.py | 199 +-
lilt/models/project_stats.py | 292 +-
lilt/models/sdlxliff_filter.py | 243 +-
lilt/models/segment.py | 479 +-
.../models/sign_lilt_create_terms_response.py | 157 +-
lilt/models/source_file.py | 420 +-
lilt/models/termbase_export_response.py | 199 +-
lilt/models/translate_segment_body.py | 420 +-
lilt/models/translation.py | 389 +-
lilt/models/translation_info.py | 297 +-
lilt/models/translation_list.py | 275 +-
lilt/models/translation_memory_entry.py | 267 +-
lilt/models/webhook_response.py | 101 +
lilt/models/webhooks_update_request.py | 149 +
lilt/models/webhooks_update_request_any_of.py | 87 +
.../models/webhooks_update_request_any_of1.py | 87 +
.../models/webhooks_update_request_any_of2.py | 95 +
lilt/models/workflow_stage_assignment.py | 224 +-
lilt/models/workflow_stage_template.py | 215 +-
lilt/models/workflow_template.py | 273 +-
lilt/py.typed | 0
lilt/rest.py | 309 +-
pyproject.toml | 89 +
requirements.txt | 10 +-
setup.cfg | 3 -
setup.py | 35 +-
test/test_create_webhook_options.py | 60 +
..._delete_lilt_create_content200_response.py | 51 +
test/test_domain.py | 60 +
test/test_domain_list.py | 54 +
test/test_domain_metadata.py | 53 +
test/test_domain_reference.py | 52 +
test/test_domains_api.py | 38 +
test/test_filter_config.py | 64 +
test/test_model.py | 58 +
test/test_webhook_configuration_api.py | 66 +
test/test_webhook_response.py | 62 +
test/test_webhooks_update_request.py | 60 +
test/test_webhooks_update_request_any_of.py | 52 +
test/test_webhooks_update_request_any_of1.py | 52 +
test/test_webhooks_update_request_any_of2.py | 56 +
tox.ini | 2 +-
172 files changed, 25066 insertions(+), 19329 deletions(-)
create mode 100644 .github/workflows/python.yml
create mode 100644 .openapi-generator/FILES
create mode 100644 docs/CreateWebhookOptions.md
create mode 100644 docs/DeleteLiltCreateContent200Response.md
create mode 100644 docs/Domain.md
create mode 100644 docs/DomainList.md
create mode 100644 docs/DomainMetadata.md
create mode 100644 docs/DomainReference.md
create mode 100644 docs/DomainsApi.md
create mode 100644 docs/FilterConfig.md
create mode 100644 docs/Model.md
create mode 100644 docs/WebhookConfigurationApi.md
create mode 100644 docs/WebhookResponse.md
create mode 100644 docs/WebhooksUpdateRequest.md
create mode 100644 docs/WebhooksUpdateRequestAnyOf.md
create mode 100644 docs/WebhooksUpdateRequestAnyOf1.md
create mode 100644 docs/WebhooksUpdateRequestAnyOf2.md
create mode 100644 lilt/api/domains_api.py
create mode 100644 lilt/api/webhook_configuration_api.py
create mode 100644 lilt/api_response.py
create mode 100644 lilt/models/create_webhook_options.py
create mode 100644 lilt/models/delete_lilt_create_content200_response.py
create mode 100644 lilt/models/domain.py
create mode 100644 lilt/models/domain_list.py
create mode 100644 lilt/models/domain_metadata.py
create mode 100644 lilt/models/domain_reference.py
create mode 100644 lilt/models/filter_config.py
create mode 100644 lilt/models/model.py
create mode 100644 lilt/models/webhook_response.py
create mode 100644 lilt/models/webhooks_update_request.py
create mode 100644 lilt/models/webhooks_update_request_any_of.py
create mode 100644 lilt/models/webhooks_update_request_any_of1.py
create mode 100644 lilt/models/webhooks_update_request_any_of2.py
create mode 100644 lilt/py.typed
create mode 100644 pyproject.toml
create mode 100644 test/test_create_webhook_options.py
create mode 100644 test/test_delete_lilt_create_content200_response.py
create mode 100644 test/test_domain.py
create mode 100644 test/test_domain_list.py
create mode 100644 test/test_domain_metadata.py
create mode 100644 test/test_domain_reference.py
create mode 100644 test/test_domains_api.py
create mode 100644 test/test_filter_config.py
create mode 100644 test/test_model.py
create mode 100644 test/test_webhook_configuration_api.py
create mode 100644 test/test_webhook_response.py
create mode 100644 test/test_webhooks_update_request.py
create mode 100644 test/test_webhooks_update_request_any_of.py
create mode 100644 test/test_webhooks_update_request_any_of1.py
create mode 100644 test/test_webhooks_update_request_any_of2.py
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
new file mode 100644
index 0000000..5e5eda9
--- /dev/null
+++ b/.github/workflows/python.yml
@@ -0,0 +1,31 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
+
+name: lilt Python package
+
+on: [push, pull_request]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+ pip install -r test-requirements.txt
+ - name: Test with pytest
+ run: |
+ pytest --cov=lilt
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0e58798..dfe9f45 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,33 +1,31 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
# ref: https://docs.gitlab.com/ee/ci/README.html
+# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
stages:
- test
-.nosetest:
+.pytest:
stage: test
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pytest --cov=lilt
-nosetest-2.7:
- extends: .nosetest
- image: python:2.7-alpine
-nosetest-3.3:
- extends: .nosetest
- image: python:3.3-alpine
-nosetest-3.4:
- extends: .nosetest
- image: python:3.4-alpine
-nosetest-3.5:
- extends: .nosetest
- image: python:3.5-alpine
-nosetest-3.6:
- extends: .nosetest
- image: python:3.6-alpine
-nosetest-3.7:
- extends: .nosetest
- image: python:3.7-alpine
-nosetest-3.8:
- extends: .nosetest
- image: python:3.8-alpine
+pytest-3.9:
+ extends: .pytest
+ image: python:3.9-alpine
+pytest-3.10:
+ extends: .pytest
+ image: python:3.10-alpine
+pytest-3.11:
+ extends: .pytest
+ image: python:3.11-alpine
+pytest-3.12:
+ extends: .pytest
+ image: python:3.12-alpine
+pytest-3.13:
+ extends: .pytest
+ image: python:3.13-alpine
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
new file mode 100644
index 0000000..0696a59
--- /dev/null
+++ b/.openapi-generator/FILES
@@ -0,0 +1,171 @@
+.github/workflows/python.yml
+.gitlab-ci.yml
+.travis.yml
+README.md
+docs/AddFileLabelRequest.md
+docs/CreateApi.md
+docs/CreateConverterConfigParameters.md
+docs/CreateWebhookOptions.md
+docs/DeleteLiltCreateContent200Response.md
+docs/DeleteSegmentFromMemoryResponse.md
+docs/DocumentWithSegments.md
+docs/DocumentWithoutSegments.md
+docs/DocumentWithoutSegmentsStatus.md
+docs/DocumentsApi.md
+docs/Domain.md
+docs/DomainList.md
+docs/DomainMetadata.md
+docs/DomainReference.md
+docs/DomainsApi.md
+docs/Error.md
+docs/FileDeleteResponse.md
+docs/FilesApi.md
+docs/FilterConfig.md
+docs/GetLiltCreateContentResponse.md
+docs/Job.md
+docs/JobCreateParameters.md
+docs/JobDeleteResponse.md
+docs/JobLeverageStats.md
+docs/JobProject.md
+docs/JobStats.md
+docs/JobUpdateParameters.md
+docs/JobsApi.md
+docs/LanguagePair.md
+docs/LanguagesApi.md
+docs/LanguagesResponse.md
+docs/LiltCreateContent.md
+docs/LiltCreateContentPreferences.md
+docs/LiltCreateContentRequest.md
+docs/LiltCreateContentTemplateParams.md
+docs/MemoriesApi.md
+docs/Memory.md
+docs/MemoryCreateParameters.md
+docs/MemoryDeleteResponse.md
+docs/MemoryImportResponse.md
+docs/MemoryUpdateParameters.md
+docs/Model.md
+docs/Project.md
+docs/ProjectCreateParameters.md
+docs/ProjectDeleteResponse.md
+docs/ProjectStats.md
+docs/ProjectsApi.md
+docs/SDLXLIFFFilter.md
+docs/Segment.md
+docs/SignLiltCreateTermsResponse.md
+docs/SourceFile.md
+docs/TermbaseExportResponse.md
+docs/TranslateApi.md
+docs/TranslateSegmentBody.md
+docs/Translation.md
+docs/TranslationInfo.md
+docs/TranslationList.md
+docs/TranslationMemoryEntry.md
+docs/WebhookConfigurationApi.md
+docs/WebhookResponse.md
+docs/WebhooksUpdateRequest.md
+docs/WebhooksUpdateRequestAnyOf.md
+docs/WebhooksUpdateRequestAnyOf1.md
+docs/WebhooksUpdateRequestAnyOf2.md
+docs/WorkflowStageAssignment.md
+docs/WorkflowStageTemplate.md
+docs/WorkflowTemplate.md
+docs/WorkflowsApi.md
+git_push.sh
+lilt/__init__.py
+lilt/api/__init__.py
+lilt/api/create_api.py
+lilt/api/documents_api.py
+lilt/api/domains_api.py
+lilt/api/files_api.py
+lilt/api/jobs_api.py
+lilt/api/languages_api.py
+lilt/api/memories_api.py
+lilt/api/projects_api.py
+lilt/api/translate_api.py
+lilt/api/webhook_configuration_api.py
+lilt/api/workflows_api.py
+lilt/api_client.py
+lilt/api_response.py
+lilt/configuration.py
+lilt/exceptions.py
+lilt/models/__init__.py
+lilt/models/add_file_label_request.py
+lilt/models/create_converter_config_parameters.py
+lilt/models/create_webhook_options.py
+lilt/models/delete_lilt_create_content200_response.py
+lilt/models/delete_segment_from_memory_response.py
+lilt/models/document_with_segments.py
+lilt/models/document_without_segments.py
+lilt/models/document_without_segments_status.py
+lilt/models/domain.py
+lilt/models/domain_list.py
+lilt/models/domain_metadata.py
+lilt/models/domain_reference.py
+lilt/models/error.py
+lilt/models/file_delete_response.py
+lilt/models/filter_config.py
+lilt/models/get_lilt_create_content_response.py
+lilt/models/job.py
+lilt/models/job_create_parameters.py
+lilt/models/job_delete_response.py
+lilt/models/job_leverage_stats.py
+lilt/models/job_project.py
+lilt/models/job_stats.py
+lilt/models/job_update_parameters.py
+lilt/models/language_pair.py
+lilt/models/languages_response.py
+lilt/models/lilt_create_content.py
+lilt/models/lilt_create_content_preferences.py
+lilt/models/lilt_create_content_request.py
+lilt/models/lilt_create_content_template_params.py
+lilt/models/memory.py
+lilt/models/memory_create_parameters.py
+lilt/models/memory_delete_response.py
+lilt/models/memory_import_response.py
+lilt/models/memory_update_parameters.py
+lilt/models/model.py
+lilt/models/project.py
+lilt/models/project_create_parameters.py
+lilt/models/project_delete_response.py
+lilt/models/project_stats.py
+lilt/models/sdlxliff_filter.py
+lilt/models/segment.py
+lilt/models/sign_lilt_create_terms_response.py
+lilt/models/source_file.py
+lilt/models/termbase_export_response.py
+lilt/models/translate_segment_body.py
+lilt/models/translation.py
+lilt/models/translation_info.py
+lilt/models/translation_list.py
+lilt/models/translation_memory_entry.py
+lilt/models/webhook_response.py
+lilt/models/webhooks_update_request.py
+lilt/models/webhooks_update_request_any_of.py
+lilt/models/webhooks_update_request_any_of1.py
+lilt/models/webhooks_update_request_any_of2.py
+lilt/models/workflow_stage_assignment.py
+lilt/models/workflow_stage_template.py
+lilt/models/workflow_template.py
+lilt/py.typed
+lilt/rest.py
+pyproject.toml
+requirements.txt
+setup.cfg
+setup.py
+test/__init__.py
+test/test_create_webhook_options.py
+test/test_delete_lilt_create_content200_response.py
+test/test_domain.py
+test/test_domain_list.py
+test/test_domain_metadata.py
+test/test_domain_reference.py
+test/test_domains_api.py
+test/test_filter_config.py
+test/test_model.py
+test/test_webhook_configuration_api.py
+test/test_webhook_response.py
+test/test_webhooks_update_request.py
+test/test_webhooks_update_request_any_of.py
+test/test_webhooks_update_request_any_of1.py
+test/test_webhooks_update_request_any_of2.py
+tox.ini
diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION
index ecedc98..eb1dc6a 100644
--- a/.openapi-generator/VERSION
+++ b/.openapi-generator/VERSION
@@ -1 +1 @@
-4.3.1
\ No newline at end of file
+7.13.0
diff --git a/.travis.yml b/.travis.yml
index 16fade9..6b1f6e5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,14 +1,14 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- - "2.7"
- - "3.2"
- - "3.3"
- - "3.4"
- - "3.5"
- - "3.6"
- - "3.7"
- - "3.8"
+ - "3.9"
+ - "3.10"
+ - "3.11"
+ - "3.12"
+ - "3.13"
+ # uncomment the following if needed
+ #- "3.13-dev" # 3.13 development branch
+ #- "nightly" # nightly build
# command to install dependencies
install:
- "pip install -r requirements.txt"
diff --git a/README.md b/README.md
index 9c5fe2d..189eeb3 100644
--- a/README.md
+++ b/README.md
@@ -25,13 +25,14 @@ Our services have a general quota of 4000 requests per minute. Should you hit th
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
-- API version: v3.0
-- Package version: 3.0.0
+- API version: v3.0.2
+- Package version: v3.0.2
+- Generator version: 7.13.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
-Python 2.7 and 3.4+
+Python 3.9+
## Installation & Usage
### pip install
@@ -62,14 +63,16 @@ Then import the package:
import lilt
```
+### Tests
+
+Execute `pytest` to run the tests.
+
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
@@ -85,22 +88,18 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -111,37 +110,13 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Delete Lilt Create content
api_response = api_instance.delete_lilt_create_content(content_id)
+ print("The response of CreateApi->delete_lilt_create_content:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling CreateApi->delete_lilt_create_content: %s\n" % e)
-
-```
-
-## Checking Credentials
-If you would like to test your credentials using our functionality tests you can do the following. Run:
-
-```sh
-pip show lilt-python
```
-Navigate to the Location field and create a .env file inside the package using .env_example as a template. Fill out the API_HOST and API_KEY lines using the credentials you were given.
-
-Then while inside the package folder, run:
-
-```sh
-pip install -r test-requirements.txt
-```
-
-Followed by:
-
-```sh
-local_test
-```
-
-You should be able to see the tests run.
-
-
## Documentation for API Endpoints
All URIs are relative to *https://api.lilt.com*
@@ -159,6 +134,7 @@ Class | Method | HTTP request | Description
*CreateApi* | [**update_lilt_create_preferences**](docs/CreateApi.md#update_lilt_create_preferences) | **PUT** /v2/create/preferences | Update Lilt Create preferences
*DocumentsApi* | [**download_document**](docs/DocumentsApi.md#download_document) | **GET** /v2/documents/files | Download a Document
*DocumentsApi* | [**upload_document**](docs/DocumentsApi.md#upload_document) | **POST** /v2/documents/files | Upload a File
+*DomainsApi* | [**get_domains**](docs/DomainsApi.md#get_domains) | **GET** /v3/domains | Retrieve Domains
*FilesApi* | [**add_label**](docs/FilesApi.md#add_label) | **POST** /v2/files/labels | Add Label to File
*FilesApi* | [**delete_file**](docs/FilesApi.md#delete_file) | **DELETE** /v2/files | Delete a File
*FilesApi* | [**download**](docs/FilesApi.md#download) | **GET** /v2/files/download | Download file
@@ -194,6 +170,11 @@ Class | Method | HTTP request | Description
*TranslateApi* | [**download_file**](docs/TranslateApi.md#download_file) | **GET** /v2/translate/files | Download translated file
*TranslateApi* | [**monitor_file_translation**](docs/TranslateApi.md#monitor_file_translation) | **GET** /v2/translate/file | Monitor file translation
*TranslateApi* | [**translate_segment_post**](docs/TranslateApi.md#translate_segment_post) | **POST** /v2/translate | Translate a segment
+*WebhookConfigurationApi* | [**services_configuration_api_webhooks_delete**](docs/WebhookConfigurationApi.md#services_configuration_api_webhooks_delete) | **DELETE** /v3/connectors/configuration/webhooks/{id} | Delete a specific Webhook Configuration by ID.
+*WebhookConfigurationApi* | [**webhooks_create**](docs/WebhookConfigurationApi.md#webhooks_create) | **POST** /v3/connectors/configuration/webhooks | Creates a new Webhook Configuration
+*WebhookConfigurationApi* | [**webhooks_get**](docs/WebhookConfigurationApi.md#webhooks_get) | **GET** /v3/connectors/configuration/webhooks/{id} | Retrieve a specific Webhook Configuration by ID.
+*WebhookConfigurationApi* | [**webhooks_get_many**](docs/WebhookConfigurationApi.md#webhooks_get_many) | **GET** /v3/connectors/configuration/webhooks | Retrieve a list of Webhook Configurations.
+*WebhookConfigurationApi* | [**webhooks_update**](docs/WebhookConfigurationApi.md#webhooks_update) | **PUT** /v3/connectors/configuration/webhooks/{id} | Update a specific Webhook Configuration by ID.
*WorkflowsApi* | [**get_workflow_templates**](docs/WorkflowsApi.md#get_workflow_templates) | **GET** /v2/workflows/templates | Retrieve workflow templates
@@ -201,14 +182,20 @@ Class | Method | HTTP request | Description
- [AddFileLabelRequest](docs/AddFileLabelRequest.md)
- [CreateConverterConfigParameters](docs/CreateConverterConfigParameters.md)
+ - [CreateWebhookOptions](docs/CreateWebhookOptions.md)
+ - [DeleteLiltCreateContent200Response](docs/DeleteLiltCreateContent200Response.md)
- [DeleteSegmentFromMemoryResponse](docs/DeleteSegmentFromMemoryResponse.md)
- [DocumentWithSegments](docs/DocumentWithSegments.md)
- [DocumentWithoutSegments](docs/DocumentWithoutSegments.md)
- [DocumentWithoutSegmentsStatus](docs/DocumentWithoutSegmentsStatus.md)
+ - [Domain](docs/Domain.md)
+ - [DomainList](docs/DomainList.md)
+ - [DomainMetadata](docs/DomainMetadata.md)
+ - [DomainReference](docs/DomainReference.md)
- [Error](docs/Error.md)
- [FileDeleteResponse](docs/FileDeleteResponse.md)
+ - [FilterConfig](docs/FilterConfig.md)
- [GetLiltCreateContentResponse](docs/GetLiltCreateContentResponse.md)
- - [InlineResponse200](docs/InlineResponse200.md)
- [Job](docs/Job.md)
- [JobCreateParameters](docs/JobCreateParameters.md)
- [JobDeleteResponse](docs/JobDeleteResponse.md)
@@ -227,6 +214,7 @@ Class | Method | HTTP request | Description
- [MemoryDeleteResponse](docs/MemoryDeleteResponse.md)
- [MemoryImportResponse](docs/MemoryImportResponse.md)
- [MemoryUpdateParameters](docs/MemoryUpdateParameters.md)
+ - [Model](docs/Model.md)
- [Project](docs/Project.md)
- [ProjectCreateParameters](docs/ProjectCreateParameters.md)
- [ProjectDeleteResponse](docs/ProjectDeleteResponse.md)
@@ -241,26 +229,34 @@ Class | Method | HTTP request | Description
- [TranslationInfo](docs/TranslationInfo.md)
- [TranslationList](docs/TranslationList.md)
- [TranslationMemoryEntry](docs/TranslationMemoryEntry.md)
+ - [WebhookResponse](docs/WebhookResponse.md)
+ - [WebhooksUpdateRequest](docs/WebhooksUpdateRequest.md)
+ - [WebhooksUpdateRequestAnyOf](docs/WebhooksUpdateRequestAnyOf.md)
+ - [WebhooksUpdateRequestAnyOf1](docs/WebhooksUpdateRequestAnyOf1.md)
+ - [WebhooksUpdateRequestAnyOf2](docs/WebhooksUpdateRequestAnyOf2.md)
- [WorkflowStageAssignment](docs/WorkflowStageAssignment.md)
- [WorkflowStageTemplate](docs/WorkflowStageTemplate.md)
- [WorkflowTemplate](docs/WorkflowTemplate.md)
+
## Documentation For Authorization
-## ApiKeyAuth
+Authentication schemes defined for the API:
+
+### BasicAuth
+
+- **Type**: HTTP basic authentication
+
+
+### ApiKeyAuth
- **Type**: API key
- **API key parameter name**: key
- **Location**: URL query string
-## BasicAuth
-
-- **Type**: HTTP basic authentication
-
-
## Author
diff --git a/docs/AddFileLabelRequest.md b/docs/AddFileLabelRequest.md
index 4b1f67e..ba7bd46 100644
--- a/docs/AddFileLabelRequest.md
+++ b/docs/AddFileLabelRequest.md
@@ -1,10 +1,29 @@
# AddFileLabelRequest
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | The Label name. | [optional]
+## Example
+
+```python
+from lilt.models.add_file_label_request import AddFileLabelRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AddFileLabelRequest from a JSON string
+add_file_label_request_instance = AddFileLabelRequest.from_json(json)
+# print the JSON string representation of the object
+print(AddFileLabelRequest.to_json())
+
+# convert the object into a dict
+add_file_label_request_dict = add_file_label_request_instance.to_dict()
+# create an instance of AddFileLabelRequest from a dict
+add_file_label_request_from_dict = AddFileLabelRequest.from_dict(add_file_label_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/CreateApi.md b/docs/CreateApi.md
index a77e1b0..c6b3eb6 100644
--- a/docs/CreateApi.md
+++ b/docs/CreateApi.md
@@ -16,21 +16,30 @@ Method | HTTP request | Description
# **delete_lilt_create_content**
-> InlineResponse200 delete_lilt_create_content(content_id)
+> DeleteLiltCreateContent200Response delete_lilt_create_content(content_id)
Delete Lilt Create content
-Delete a piece of Lilt Create content. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/create/1234?key=API_KEY' ```
+Delete a piece of Lilt Create content.
+
+Example CURL:
+```bash
+curl -X DELETE 'https://api.lilt.com/v2/create/1234?key=API_KEY'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.delete_lilt_create_content200_response import DeleteLiltCreateContent200Response
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -42,69 +51,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
- content_id = 56 # int | The content ID.
-
- try:
- # Delete Lilt Create content
- api_response = api_instance.delete_lilt_create_content(content_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling CreateApi->delete_lilt_create_content: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -115,24 +72,28 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Delete Lilt Create content
api_response = api_instance.delete_lilt_create_content(content_id)
+ print("The response of CreateApi->delete_lilt_create_content:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->delete_lilt_create_content: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**content_id** | **int**| The content ID. |
### Return type
-[**InlineResponse200**](InlineResponse200.md)
+[**DeleteLiltCreateContent200Response**](DeleteLiltCreateContent200Response.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -140,6 +101,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | The Delete Lilt Create Content Response. | - |
@@ -153,17 +115,38 @@ Name | Type | Description | Notes
Generate new Lilt Create content
-Generate new Lilt Create content with the given parameters. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"language\":\"en-US\", \"template\":\"blog-post\", \"templateParams\":{ \"contentLength\":\"100\", \"language\":\"en-US\", \"sections\":[], \"summary\":\"a blog post about hiking\" }, \"preferences\":{\"tone\":\"formal\",\"styleguide\":\"\"} }' ```
+Generate new Lilt Create content with the given parameters.
+
+Example CURL:
+```bash
+curl -X POST 'https://api.lilt.com/v2/create?key=API_KEY' \
+--header 'Content-Type: application/json' \
+--data-raw '{
+ "language":"en-US",
+ "template":"blog-post",
+ "templateParams":{
+ "contentLength":"100",
+ "language":"en-US",
+ "sections":[],
+ "summary":"a blog post about hiking"
+ },
+ "preferences":{"tone":"formal","styleguide":""}
+}'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.lilt_create_content_request import LiltCreateContentRequest
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -175,68 +158,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
- template_params = lilt.LiltCreateContentRequest() # LiltCreateContentRequest | Input parameters that determine what content will be generated.
-
- try:
- # Generate new Lilt Create content
- api_instance.generate_lilt_create_content(template_params)
- except ApiException as e:
- print("Exception when calling CreateApi->generate_lilt_create_content: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -247,12 +179,15 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Generate new Lilt Create content
api_instance.generate_lilt_create_content(template_params)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->generate_lilt_create_content: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**template_params** | [**LiltCreateContentRequest**](LiltCreateContentRequest.md)| Input parameters that determine what content will be generated. |
@@ -263,7 +198,7 @@ void (empty response body)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -271,6 +206,7 @@ void (empty response body)
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An event stream produced by Server Side Events. The following events are supported. - message: an object with the newly generated text (e.g. {\"text\": \"hello\"}) - message: upon completion of events the string \"[DONE]\" will be emitted - fullcontent: an object containing the full response | - |
@@ -284,17 +220,26 @@ void (empty response body)
Get Lilt Create content by ID.
-Get Lilt Create content by ID. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234?key=API_KEY' ```
+Get Lilt Create content by ID.
+
+Example CURL:
+```bash
+curl -X GET 'https://api.lilt.com/v2/create/1234?key=API_KEY'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.lilt_create_content import LiltCreateContent
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -306,69 +251,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
- content_id = 56 # int | The content ID.
-
- try:
- # Get Lilt Create content by ID.
- api_response = api_instance.get_lilt_create_by_id(content_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling CreateApi->get_lilt_create_by_id: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -379,13 +272,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Get Lilt Create content by ID.
api_response = api_instance.get_lilt_create_by_id(content_id)
+ print("The response of CreateApi->get_lilt_create_by_id:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->get_lilt_create_by_id: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**content_id** | **int**| The content ID. |
@@ -396,7 +293,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -404,6 +301,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | The Lilt Create content. | - |
@@ -417,17 +315,26 @@ Name | Type | Description | Notes
Get Lilt Create content
-Get a list of all content that has been generated by Lilt Create. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create?key=API_KEY' ```
+Get a list of all content that has been generated by Lilt Create.
+
+Example CURL:
+```bash
+curl -X GET 'https://api.lilt.com/v2/create?key=API_KEY'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.get_lilt_create_content_response import GetLiltCreateContentResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -439,83 +346,36 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
-
- try:
- # Get Lilt Create content
- api_response = api_instance.get_lilt_create_content()
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling CreateApi->get_lilt_create_content: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.CreateApi(api_client)
-
+
try:
# Get Lilt Create content
api_response = api_instance.get_lilt_create_content()
+ print("The response of CreateApi->get_lilt_create_content:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->get_lilt_create_content: %s\n" % e)
```
+
+
### Parameters
+
This endpoint does not need any parameter.
### Return type
@@ -524,7 +384,7 @@ This endpoint does not need any parameter.
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -532,6 +392,7 @@ This endpoint does not need any parameter.
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An object with a documents next task Workflow metadata. | - |
@@ -545,17 +406,25 @@ This endpoint does not need any parameter.
Get Lilt Create preferences
-Get the stored preferences for Lilt Create. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/preferences?key=API_KEY' ```
+Get the stored preferences for Lilt Create.
+
+Example CURL:
+```bash
+curl -X POST 'https://api.lilt.com/v2/create/preferences?key=API_KEY'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -567,81 +436,34 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
-
- try:
- # Get Lilt Create preferences
- api_instance.get_lilt_create_preferences()
- except ApiException as e:
- print("Exception when calling CreateApi->get_lilt_create_preferences: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.CreateApi(api_client)
-
+
try:
# Get Lilt Create preferences
api_instance.get_lilt_create_preferences()
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->get_lilt_create_preferences: %s\n" % e)
```
+
+
### Parameters
+
This endpoint does not need any parameter.
### Return type
@@ -650,7 +472,7 @@ void (empty response body)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -658,6 +480,7 @@ void (empty response body)
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An object describing the stored preferences. | - |
@@ -671,17 +494,25 @@ void (empty response body)
Regenerate Lilt Create content
-Regenerate the given piece of content with the current parameters. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234/create?key=API_KEY' ```
+Regenerate the given piece of content with the current parameters.
+
+Example CURL:
+```bash
+curl -X GET 'https://api.lilt.com/v2/create/1234/create?key=API_KEY'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -693,68 +524,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
- content_id = 56 # int | The content ID.
-
- try:
- # Regenerate Lilt Create content
- api_instance.regenerate_lilt_create_content(content_id)
- except ApiException as e:
- print("Exception when calling CreateApi->regenerate_lilt_create_content: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -765,12 +545,15 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Regenerate Lilt Create content
api_instance.regenerate_lilt_create_content(content_id)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->regenerate_lilt_create_content: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**content_id** | **int**| The content ID. |
@@ -781,7 +564,7 @@ void (empty response body)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -789,6 +572,7 @@ void (empty response body)
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An event stream produced by Server Side Events. The following events are supported. - message: an object with the newly generated text (e.g. {\"text\": \"hello\"}) - message: upon completion of events the string \"[DONE]\" will be emitted - fullcontent: an object containing the full response | - |
@@ -802,17 +586,31 @@ void (empty response body)
Sign the Lilt Create terms and conditions
-Lilt Create requires that the terms and conditions are signed first before using it. The terms and conditions can be signed by using this endpoint. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/terms-and-conditions?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"signedAgreement\": true}' ```
+Lilt Create requires that the terms and conditions are signed first
+before using it. The terms and conditions can be signed by using this
+endpoint.
+
+Example CURL:
+```bash
+curl -X POST 'https://api.lilt.com/v2/create/terms-and-conditions?key=API_KEY' \
+--header 'Content-Type: application/json' \
+--data-raw '{"signedAgreement": true}'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.create_converter_config_parameters import CreateConverterConfigParameters
+from lilt.models.sign_lilt_create_terms_response import SignLiltCreateTermsResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -824,89 +622,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
- signed_agreement = lilt.CreateConverterConfigParameters() # CreateConverterConfigParameters |
-
- try:
- # Sign the Lilt Create terms and conditions
- api_response = api_instance.sign_lilt_create_terms(signed_agreement)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling CreateApi->sign_lilt_create_terms: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.CreateApi(api_client)
- signed_agreement = lilt.CreateConverterConfigParameters() # CreateConverterConfigParameters |
+ signed_agreement = lilt.CreateConverterConfigParameters() # CreateConverterConfigParameters | Whether or not to sign the agreement.
try:
# Sign the Lilt Create terms and conditions
api_response = api_instance.sign_lilt_create_terms(signed_agreement)
+ print("The response of CreateApi->sign_lilt_create_terms:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->sign_lilt_create_terms: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **signed_agreement** | [**CreateConverterConfigParameters**](CreateConverterConfigParameters.md)| |
+ **signed_agreement** | [**CreateConverterConfigParameters**](CreateConverterConfigParameters.md)| Whether or not to sign the agreement. |
### Return type
@@ -914,7 +664,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -922,6 +672,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An object indicating whether the agreement has been signed or not. | - |
@@ -935,17 +686,28 @@ Name | Type | Description | Notes
Update Lilt Create content
-Update a piece of Lilt Create content. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/1234?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"language\":\"de-DE\"}' ```
+Update a piece of Lilt Create content.
+
+Example CURL:
+```bash
+curl -X PUT 'https://api.lilt.com/v2/create/1234?key=API_KEY' \
+--header 'Content-Type: application/json' \
+--data-raw '{"language":"de-DE"}'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.lilt_create_content import LiltCreateContent
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -957,88 +719,39 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
- content_id = 56 # int | The content ID.
-body = lilt.LiltCreateContent() # LiltCreateContent | (optional)
-
- try:
- # Update Lilt Create content
- api_response = api_instance.update_lilt_create_content(content_id, body=body)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling CreateApi->update_lilt_create_content: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.CreateApi(api_client)
content_id = 56 # int | The content ID.
-body = lilt.LiltCreateContent() # LiltCreateContent | (optional)
+ body = lilt.LiltCreateContent() # LiltCreateContent | (optional)
try:
# Update Lilt Create content
api_response = api_instance.update_lilt_create_content(content_id, body=body)
+ print("The response of CreateApi->update_lilt_create_content:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->update_lilt_create_content: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**content_id** | **int**| The content ID. |
@@ -1050,7 +763,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1058,6 +771,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | The updated Lilt Create content. | - |
@@ -1071,17 +785,29 @@ Name | Type | Description | Notes
Update Lilt Create preferences
-Update the stored preferences for Lilt Create. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/preferences?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"tone\": \"formal\", \"styleguide\": \"\"}' ```
+Update the stored preferences for Lilt Create.
+
+Example CURL:
+```bash
+curl -X PUT
+'https://api.lilt.com/v2/create/preferences?key=API_KEY' \
+--header 'Content-Type: application/json' \
+--data-raw '{"tone": "formal", "styleguide": ""}'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.lilt_create_content import LiltCreateContent
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -1093,68 +819,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.CreateApi(api_client)
- styleguide = lilt.LiltCreateContent() # LiltCreateContent | Which styleguide to use. (optional)
-
- try:
- # Update Lilt Create preferences
- api_instance.update_lilt_create_preferences(styleguide=styleguide)
- except ApiException as e:
- print("Exception when calling CreateApi->update_lilt_create_preferences: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -1165,12 +840,15 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Update Lilt Create preferences
api_instance.update_lilt_create_preferences(styleguide=styleguide)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling CreateApi->update_lilt_create_preferences: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**styleguide** | [**LiltCreateContent**](LiltCreateContent.md)| Which styleguide to use. | [optional]
@@ -1181,7 +859,7 @@ void (empty response body)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1189,6 +867,7 @@ void (empty response body)
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | The updated Lilt Create preferences. | - |
diff --git a/docs/CreateConverterConfigParameters.md b/docs/CreateConverterConfigParameters.md
index a4bbb8f..2f0aee0 100644
--- a/docs/CreateConverterConfigParameters.md
+++ b/docs/CreateConverterConfigParameters.md
@@ -1,10 +1,29 @@
# CreateConverterConfigParameters
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**signed_agreement** | **bool** | Signifies that the Organization has signed the agreement or not. |
+## Example
+
+```python
+from lilt.models.create_converter_config_parameters import CreateConverterConfigParameters
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreateConverterConfigParameters from a JSON string
+create_converter_config_parameters_instance = CreateConverterConfigParameters.from_json(json)
+# print the JSON string representation of the object
+print(CreateConverterConfigParameters.to_json())
+
+# convert the object into a dict
+create_converter_config_parameters_dict = create_converter_config_parameters_instance.to_dict()
+# create an instance of CreateConverterConfigParameters from a dict
+create_converter_config_parameters_from_dict = CreateConverterConfigParameters.from_dict(create_converter_config_parameters_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/CreateWebhookOptions.md b/docs/CreateWebhookOptions.md
new file mode 100644
index 0000000..4895c53
--- /dev/null
+++ b/docs/CreateWebhookOptions.md
@@ -0,0 +1,31 @@
+# CreateWebhookOptions
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**webhook_name** | **str** | The name of the webhook configuration. |
+**webhook_url** | **str** | The URL to which the webhook notifications will be sent. |
+**event_type** | **List[str]** | The list of event types that will trigger the webhook notification. |
+
+## Example
+
+```python
+from lilt.models.create_webhook_options import CreateWebhookOptions
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreateWebhookOptions from a JSON string
+create_webhook_options_instance = CreateWebhookOptions.from_json(json)
+# print the JSON string representation of the object
+print(CreateWebhookOptions.to_json())
+
+# convert the object into a dict
+create_webhook_options_dict = create_webhook_options_instance.to_dict()
+# create an instance of CreateWebhookOptions from a dict
+create_webhook_options_from_dict = CreateWebhookOptions.from_dict(create_webhook_options_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DeleteLiltCreateContent200Response.md b/docs/DeleteLiltCreateContent200Response.md
new file mode 100644
index 0000000..baf0ec4
--- /dev/null
+++ b/docs/DeleteLiltCreateContent200Response.md
@@ -0,0 +1,29 @@
+# DeleteLiltCreateContent200Response
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | The ID of the deleted Lilt Create content. | [optional]
+
+## Example
+
+```python
+from lilt.models.delete_lilt_create_content200_response import DeleteLiltCreateContent200Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DeleteLiltCreateContent200Response from a JSON string
+delete_lilt_create_content200_response_instance = DeleteLiltCreateContent200Response.from_json(json)
+# print the JSON string representation of the object
+print(DeleteLiltCreateContent200Response.to_json())
+
+# convert the object into a dict
+delete_lilt_create_content200_response_dict = delete_lilt_create_content200_response_instance.to_dict()
+# create an instance of DeleteLiltCreateContent200Response from a dict
+delete_lilt_create_content200_response_from_dict = DeleteLiltCreateContent200Response.from_dict(delete_lilt_create_content200_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DeleteSegmentFromMemoryResponse.md b/docs/DeleteSegmentFromMemoryResponse.md
index 4bf749e..06782a5 100644
--- a/docs/DeleteSegmentFromMemoryResponse.md
+++ b/docs/DeleteSegmentFromMemoryResponse.md
@@ -1,10 +1,29 @@
# DeleteSegmentFromMemoryResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**success** | **bool** | | [optional]
+## Example
+
+```python
+from lilt.models.delete_segment_from_memory_response import DeleteSegmentFromMemoryResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DeleteSegmentFromMemoryResponse from a JSON string
+delete_segment_from_memory_response_instance = DeleteSegmentFromMemoryResponse.from_json(json)
+# print the JSON string representation of the object
+print(DeleteSegmentFromMemoryResponse.to_json())
+
+# convert the object into a dict
+delete_segment_from_memory_response_dict = delete_segment_from_memory_response_instance.to_dict()
+# create an instance of DeleteSegmentFromMemoryResponse from a dict
+delete_segment_from_memory_response_from_dict = DeleteSegmentFromMemoryResponse.from_dict(delete_segment_from_memory_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/DocumentWithSegments.md b/docs/DocumentWithSegments.md
index 807bb2a..57a581f 100644
--- a/docs/DocumentWithSegments.md
+++ b/docs/DocumentWithSegments.md
@@ -1,7 +1,9 @@
# DocumentWithSegments
A Document is a collection of zero or more Segments.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique number identifying the Document. | [optional]
@@ -22,8 +24,25 @@ Name | Type | Description | Notes
**created_at** | **int** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional]
**updated_at** | **int** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional]
**is_review_complete** | **bool** | Document review status. | [optional]
-**segments** | [**list[Segment]**](Segment.md) | A list of Segments. | [optional]
+**segments** | [**List[Segment]**](Segment.md) | A list of Segments. | [optional]
+
+## Example
+
+```python
+from lilt.models.document_with_segments import DocumentWithSegments
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DocumentWithSegments from a JSON string
+document_with_segments_instance = DocumentWithSegments.from_json(json)
+# print the JSON string representation of the object
+print(DocumentWithSegments.to_json())
+# convert the object into a dict
+document_with_segments_dict = document_with_segments_instance.to_dict()
+# create an instance of DocumentWithSegments from a dict
+document_with_segments_from_dict = DocumentWithSegments.from_dict(document_with_segments_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/DocumentWithoutSegments.md b/docs/DocumentWithoutSegments.md
index aa95333..97c791b 100644
--- a/docs/DocumentWithoutSegments.md
+++ b/docs/DocumentWithoutSegments.md
@@ -1,7 +1,9 @@
# DocumentWithoutSegments
A Document is a collection of zero or more Segments.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique number identifying the Document. | [optional]
@@ -24,6 +26,23 @@ Name | Type | Description | Notes
**updated_at** | **int** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional]
**is_review_complete** | **bool** | Document review status. | [optional]
+## Example
+
+```python
+from lilt.models.document_without_segments import DocumentWithoutSegments
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DocumentWithoutSegments from a JSON string
+document_without_segments_instance = DocumentWithoutSegments.from_json(json)
+# print the JSON string representation of the object
+print(DocumentWithoutSegments.to_json())
+
+# convert the object into a dict
+document_without_segments_dict = document_without_segments_instance.to_dict()
+# create an instance of DocumentWithoutSegments from a dict
+document_without_segments_from_dict = DocumentWithoutSegments.from_dict(document_without_segments_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/DocumentWithoutSegmentsStatus.md b/docs/DocumentWithoutSegmentsStatus.md
index 435a846..463e358 100644
--- a/docs/DocumentWithoutSegmentsStatus.md
+++ b/docs/DocumentWithoutSegmentsStatus.md
@@ -1,11 +1,30 @@
# DocumentWithoutSegmentsStatus
A list of translations for the query term.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pretranslation** | **str** | | [optional]
+## Example
+
+```python
+from lilt.models.document_without_segments_status import DocumentWithoutSegmentsStatus
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DocumentWithoutSegmentsStatus from a JSON string
+document_without_segments_status_instance = DocumentWithoutSegmentsStatus.from_json(json)
+# print the JSON string representation of the object
+print(DocumentWithoutSegmentsStatus.to_json())
+
+# convert the object into a dict
+document_without_segments_status_dict = document_without_segments_status_instance.to_dict()
+# create an instance of DocumentWithoutSegmentsStatus from a dict
+document_without_segments_status_from_dict = DocumentWithoutSegmentsStatus.from_dict(document_without_segments_status_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/DocumentsApi.md b/docs/DocumentsApi.md
index e1b43bc..6af58aa 100644
--- a/docs/DocumentsApi.md
+++ b/docs/DocumentsApi.md
@@ -9,21 +9,30 @@ Method | HTTP request | Description
# **download_document**
-> str download_document(id, is_xliff=is_xliff)
+> bytearray download_document(id, is_xliff=is_xliff)
Download a Document
-Export a Document that has been translated in the Lilt web application. Any Document can be downloaded in XLIFF 1.2 format, or can be retrieved in its original uploaded format by setting `is_xliff=false`. This endpoint will fail if either (a) export or (b) pre-translation operations are in-progress. The status of those operations can be determined by retrieving the Document resource. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff ```
+Export a Document that has been translated in the Lilt web application.
+Any Document can be downloaded in XLIFF 1.2 format, or can be retrieved in its original uploaded format by setting `is_xliff=false`.
+This endpoint will fail if either (a) export or (b) pre-translation operations are in-progress. The status of those operations can be determined by retrieving the Document resource.
+Example CURL command:
+```bash
+ curl -X GET https://api.lilt.com/v2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -35,88 +44,39 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.DocumentsApi(api_client)
- id = 56 # int | An unique Document identifier.
-is_xliff = True # bool | Download the document in XLIFF 1.2 format. (optional) (default to True)
-
- try:
- # Download a Document
- api_response = api_instance.download_document(id, is_xliff=is_xliff)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling DocumentsApi->download_document: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.DocumentsApi(api_client)
id = 56 # int | An unique Document identifier.
-is_xliff = True # bool | Download the document in XLIFF 1.2 format. (optional) (default to True)
+ is_xliff = True # bool | Download the document in XLIFF 1.2 format. (optional) (default to True)
try:
# Download a Document
api_response = api_instance.download_document(id, is_xliff=is_xliff)
+ print("The response of DocumentsApi->download_document:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling DocumentsApi->download_document: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| An unique Document identifier. |
@@ -124,18 +84,19 @@ Name | Type | Description | Notes
### Return type
-**str**
+**bytearray**
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/octet-stream, text/plain,
+ - **Accept**: application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A file. | - |
@@ -150,72 +111,32 @@ Name | Type | Description | Notes
Upload a File
-Create a Document from a file in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed as JSON object with the header field `LILT-API`. File names in the header can only contain [US-ASCII characters](https://en.wikipedia.org/wiki/ASCII). File names with characters outside of US-ASCII should be [URI encoded](https://en.wikipedia.org/wiki/Percent-encoding) or transliterated to US-ASCII strings. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/documents/files?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"introduction.xliff\\\",\\\"pretranslate\\\": \\\"tm+mt\\\",\\\"project_id\\\": 9}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @Introduction.xliff ```
-
-### Example
+Create a Document from a file in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats).
+Request parameters should be passed as JSON object with the header field `LILT-API`.
-* Api Key Authentication (ApiKeyAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
+File names in the header can only contain [US-ASCII characters](https://en.wikipedia.org/wiki/ASCII). File names with characters outside of US-ASCII should be [URI encoded](https://en.wikipedia.org/wiki/Percent-encoding) or transliterated to US-ASCII strings.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+Example CURL command:
+```bash
+ curl -X POST https://api.lilt.com/v2/documents/files?key=API_KEY \
+ --header "LILT-API: {\"name\": \"introduction.xliff\",\"pretranslate\": \"tm+mt\",\"project_id\": 9}" \
+ --header "Content-Type: application/octet-stream" \
+ --data-binary @Introduction.xliff
+```
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.DocumentsApi(api_client)
- name = 'name_example' # str | A file name.
-project_id = 56 # int | A unique Project identifier.
-body = '/path/to/file' # file | The file contents to be uploaded. The entire POST body will be treated as the file.
-pretranslate = 'pretranslate_example' # str | An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT` (optional)
-auto_accept = True # bool | An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted. (optional)
-case_sensitive = True # bool | An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting (optional)
-match_attribution = True # bool | An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting (optional)
-config_id = 56 # int | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. (optional)
- try:
- # Upload a File
- api_response = api_instance.upload_document(name, project_id, body, pretranslate=pretranslate, auto_accept=auto_accept, case_sensitive=case_sensitive, match_attribution=match_attribution, config_id=config_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling DocumentsApi->upload_document: %s\n" % e)
-```
+### Example
* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.document_with_segments import DocumentWithSegments
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -227,50 +148,50 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.DocumentsApi(api_client)
name = 'name_example' # str | A file name.
-project_id = 56 # int | A unique Project identifier.
-body = '/path/to/file' # file | The file contents to be uploaded. The entire POST body will be treated as the file.
-pretranslate = 'pretranslate_example' # str | An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT` (optional)
-auto_accept = True # bool | An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted. (optional)
-case_sensitive = True # bool | An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting (optional)
-match_attribution = True # bool | An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting (optional)
-config_id = 56 # int | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. (optional)
+ project_id = 56 # int | A unique Project identifier.
+ body = None # bytearray | The file contents to be uploaded. The entire POST body will be treated as the file.
+ pretranslate = 'pretranslate_example' # str | An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT` (optional)
+ auto_accept = True # bool | An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted. (optional)
+ case_sensitive = True # bool | An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting (optional)
+ match_attribution = True # bool | An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting (optional)
+ config_id = 56 # int | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. (optional)
try:
# Upload a File
api_response = api_instance.upload_document(name, project_id, body, pretranslate=pretranslate, auto_accept=auto_accept, case_sensitive=case_sensitive, match_attribution=match_attribution, config_id=config_id)
+ print("The response of DocumentsApi->upload_document:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling DocumentsApi->upload_document: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| A file name. |
**project_id** | **int**| A unique Project identifier. |
- **body** | **file**| The file contents to be uploaded. The entire POST body will be treated as the file. |
+ **body** | **bytearray**| The file contents to be uploaded. The entire POST body will be treated as the file. |
**pretranslate** | **str**| An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT` | [optional]
**auto_accept** | **bool**| An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted. | [optional]
**case_sensitive** | **bool**| An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting | [optional]
@@ -283,7 +204,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -291,6 +212,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A Document object. | - |
diff --git a/docs/Domain.md b/docs/Domain.md
new file mode 100644
index 0000000..657b1a2
--- /dev/null
+++ b/docs/Domain.md
@@ -0,0 +1,33 @@
+# Domain
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**domain_id** | **int** | The unique identifier for the domain. |
+**domain_name** | **str** | The name of the domain. |
+**models** | [**List[Model]**](Model.md) | The models associated with the domain. |
+**filter_configs** | [**List[FilterConfig]**](FilterConfig.md) | The filter configurations associated with the domain. |
+**domain_metadata** | [**List[DomainMetadata]**](DomainMetadata.md) | Metadata associated with the domain. |
+
+## Example
+
+```python
+from lilt.models.domain import Domain
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Domain from a JSON string
+domain_instance = Domain.from_json(json)
+# print the JSON string representation of the object
+print(Domain.to_json())
+
+# convert the object into a dict
+domain_dict = domain_instance.to_dict()
+# create an instance of Domain from a dict
+domain_from_dict = Domain.from_dict(domain_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DomainList.md b/docs/DomainList.md
new file mode 100644
index 0000000..71e2928
--- /dev/null
+++ b/docs/DomainList.md
@@ -0,0 +1,30 @@
+# DomainList
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**items** | [**List[Domain]**](Domain.md) | The list of domains in the response. |
+**size** | **int** | The total number of domains in the list. |
+
+## Example
+
+```python
+from lilt.models.domain_list import DomainList
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DomainList from a JSON string
+domain_list_instance = DomainList.from_json(json)
+# print the JSON string representation of the object
+print(DomainList.to_json())
+
+# convert the object into a dict
+domain_list_dict = domain_list_instance.to_dict()
+# create an instance of DomainList from a dict
+domain_list_from_dict = DomainList.from_dict(domain_list_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DomainMetadata.md b/docs/DomainMetadata.md
new file mode 100644
index 0000000..0c5e6b2
--- /dev/null
+++ b/docs/DomainMetadata.md
@@ -0,0 +1,31 @@
+# DomainMetadata
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | The unique identifier for the metadata. | [optional]
+**key** | **str** | The key of the metadata. | [optional]
+**value** | **str** | The value of the metadata. | [optional]
+
+## Example
+
+```python
+from lilt.models.domain_metadata import DomainMetadata
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DomainMetadata from a JSON string
+domain_metadata_instance = DomainMetadata.from_json(json)
+# print the JSON string representation of the object
+print(DomainMetadata.to_json())
+
+# convert the object into a dict
+domain_metadata_dict = domain_metadata_instance.to_dict()
+# create an instance of DomainMetadata from a dict
+domain_metadata_from_dict = DomainMetadata.from_dict(domain_metadata_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DomainReference.md b/docs/DomainReference.md
new file mode 100644
index 0000000..9152be4
--- /dev/null
+++ b/docs/DomainReference.md
@@ -0,0 +1,30 @@
+# DomainReference
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | The unique identifier for the domain. | [optional]
+**name** | **str** | The name of the domain. | [optional]
+
+## Example
+
+```python
+from lilt.models.domain_reference import DomainReference
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DomainReference from a JSON string
+domain_reference_instance = DomainReference.from_json(json)
+# print the JSON string representation of the object
+print(DomainReference.to_json())
+
+# convert the object into a dict
+domain_reference_dict = domain_reference_instance.to_dict()
+# create an instance of DomainReference from a dict
+domain_reference_from_dict = DomainReference.from_dict(domain_reference_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DomainsApi.md b/docs/DomainsApi.md
new file mode 100644
index 0000000..990b830
--- /dev/null
+++ b/docs/DomainsApi.md
@@ -0,0 +1,102 @@
+# lilt.DomainsApi
+
+All URIs are relative to *https://api.lilt.com*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**get_domains**](DomainsApi.md#get_domains) | **GET** /v3/domains | Retrieve Domains
+
+
+# **get_domains**
+> DomainList get_domains(key)
+
+Retrieve Domains
+
+Retrieve a list of Domains associated with the Organization's API key.
+
+Each Domain contains potentially 4 Arrays related to the Domain these are as follows:
+- models - the list of models associated with the Domain
+- filterConfigs - the list of filterConfigs associated with the Domain
+- domainMetadata - the list of Domain specific options that have been configured for this domain.
+
+
+### Example
+
+* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
+```python
+import lilt
+from lilt.models.domain_list import DomainList
+from lilt.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to https://api.lilt.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = lilt.Configuration(
+ host = "https://api.lilt.com"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: BasicAuth
+configuration = lilt.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with lilt.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = lilt.DomainsApi(api_client)
+ key = 'key_example' # str | the ApiKey used to authenticate with LILT, used to look up the Organization's domain information.
+
+ try:
+ # Retrieve Domains
+ api_response = api_instance.get_domains(key)
+ print("The response of DomainsApi->get_domains:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling DomainsApi->get_domains: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **key** | **str**| the ApiKey used to authenticate with LILT, used to look up the Organization's domain information. |
+
+### Return type
+
+[**DomainList**](DomainList.md)
+
+### Authorization
+
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**404** | Not Found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/Error.md b/docs/Error.md
index b2942b8..3e170cc 100644
--- a/docs/Error.md
+++ b/docs/Error.md
@@ -1,11 +1,30 @@
# Error
Response in the event of an unexpected error.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **str** | A human-readable message describing the error. | [optional]
+## Example
+
+```python
+from lilt.models.error import Error
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Error from a JSON string
+error_instance = Error.from_json(json)
+# print the JSON string representation of the object
+print(Error.to_json())
+
+# convert the object into a dict
+error_dict = error_instance.to_dict()
+# create an instance of Error from a dict
+error_from_dict = Error.from_dict(error_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/FileDeleteResponse.md b/docs/FileDeleteResponse.md
index 0d73c58..0cf6ef6 100644
--- a/docs/FileDeleteResponse.md
+++ b/docs/FileDeleteResponse.md
@@ -1,11 +1,30 @@
# FileDeleteResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique File identifier. | [optional]
**deleted** | **bool** | If the operation succeeded, then `true`. Otherwise, `false`. | [optional]
+## Example
+
+```python
+from lilt.models.file_delete_response import FileDeleteResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FileDeleteResponse from a JSON string
+file_delete_response_instance = FileDeleteResponse.from_json(json)
+# print the JSON string representation of the object
+print(FileDeleteResponse.to_json())
+
+# convert the object into a dict
+file_delete_response_dict = file_delete_response_instance.to_dict()
+# create an instance of FileDeleteResponse from a dict
+file_delete_response_from_dict = FileDeleteResponse.from_dict(file_delete_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/FilesApi.md b/docs/FilesApi.md
index 9aff159..da5787d 100644
--- a/docs/FilesApi.md
+++ b/docs/FilesApi.md
@@ -17,17 +17,29 @@ Method | HTTP request | Description
Add Label to File
-Add a label to a File. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1' --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"label_name\" }' ```
+Add a label to a File.
+
+Example CURL:
+```bash
+curl -X POST 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1'
+--header 'Content-Type: application/json' \
+--data-raw '{
+ "name": "label_name"
+}'
+```
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.add_file_label_request import AddFileLabelRequest
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -39,90 +51,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.FilesApi(api_client)
- id = 'id_example' # str | A File id.
-name = lilt.AddFileLabelRequest() # AddFileLabelRequest |
-
- try:
- # Add Label to File
- api_instance.add_label(id, name)
- except ApiException as e:
- print("Exception when calling FilesApi->add_label: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.FilesApi(api_client)
id = 'id_example' # str | A File id.
-name = lilt.AddFileLabelRequest() # AddFileLabelRequest |
+ name = lilt.AddFileLabelRequest() # AddFileLabelRequest | A label name.
try:
# Add Label to File
api_instance.add_label(id, name)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling FilesApi->add_label: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| A File id. |
- **name** | [**AddFileLabelRequest**](AddFileLabelRequest.md)| |
+ **name** | [**AddFileLabelRequest**](AddFileLabelRequest.md)| A label name. |
### Return type
@@ -130,7 +93,7 @@ void (empty response body)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -138,6 +101,7 @@ void (empty response body)
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | A success response. | - |
@@ -151,17 +115,26 @@ void (empty response body)
Delete a File
-Delete a File. Example CURL command: ```bash curl -X DELETE https://api.lilt.com/v2/files?key=API_KEY&id=123 ```
+Delete a File.
+
+Example CURL command:
+```bash
+ curl -X DELETE https://api.lilt.com/v2/files?key=API_KEY&id=123
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.file_delete_response import FileDeleteResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -173,69 +146,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.FilesApi(api_client)
- id = 56 # int | A unique File identifier.
-
- try:
- # Delete a File
- api_response = api_instance.delete_file(id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling FilesApi->delete_file: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -246,13 +167,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Delete a File
api_response = api_instance.delete_file(id)
+ print("The response of FilesApi->delete_file:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling FilesApi->delete_file: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique File identifier. |
@@ -263,7 +188,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -271,6 +196,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | A status object. | - |
@@ -280,21 +206,28 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **download**
-> str download(id)
+> bytearray download(id)
Download file
-Download a File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/files/download?key=API_KEY&id=1' ```
+Download a File.
+
+Example CURL:
+```bash
+curl -X GET 'https://api.lilt.com/v2/files/download?key=API_KEY&id=1'
+```
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -306,69 +239,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.FilesApi(api_client)
- id = 'id_example' # str | A File id.
-
- try:
- # Download file
- api_response = api_instance.download(id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling FilesApi->download: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -379,24 +260,28 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Download file
api_response = api_instance.download(id)
+ print("The response of FilesApi->download:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling FilesApi->download: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| A File id. |
### Return type
-**str**
+**bytearray**
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -404,6 +289,7 @@ Name | Type | Description | Notes
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A file. | - |
@@ -413,21 +299,30 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_files**
-> list[SourceFile] get_files(id=id, labels=labels)
+> List[SourceFile] get_files(id=id, labels=labels)
Retrieve a File
-Retrieves one or more files available to your user. Files are not associated with a project or a memory. They are unprocessed and can be used later in the project/document creation workflow step. To retrieve a specific file, specify the id request parameter. To retrieve all files, omit the id request parameter. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/files?key=API_KEY&id=274 ```
+Retrieves one or more files available to your user. Files are not associated with a project or a memory. They are unprocessed and can be used later in the project/document creation workflow step.
+
+To retrieve a specific file, specify the id request parameter. To retrieve all files, omit the id request parameter.
+
+Example CURL command:
+```bash
+ curl -X GET https://api.lilt.com/v2/files?key=API_KEY&id=274
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.source_file import SourceFile
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -439,100 +334,51 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.FilesApi(api_client)
- id = 56 # int | A unique File identifier. (optional)
-labels = ['labels_example'] # list[str] | One or more labels. This will return the files which contain all of the given labels. (optional)
-
- try:
- # Retrieve a File
- api_response = api_instance.get_files(id=id, labels=labels)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling FilesApi->get_files: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.FilesApi(api_client)
id = 56 # int | A unique File identifier. (optional)
-labels = ['labels_example'] # list[str] | One or more labels. This will return the files which contain all of the given labels. (optional)
+ labels = ['labels_example'] # List[str] | One or more labels. This will return the files which contain all of the given labels. (optional)
try:
# Retrieve a File
api_response = api_instance.get_files(id=id, labels=labels)
+ print("The response of FilesApi->get_files:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling FilesApi->get_files: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique File identifier. | [optional]
- **labels** | [**list[str]**](str.md)| One or more labels. This will return the files which contain all of the given labels. | [optional]
+ **labels** | [**List[str]**](str.md)| One or more labels. This will return the files which contain all of the given labels. | [optional]
### Return type
-[**list[SourceFile]**](SourceFile.md)
+[**List[SourceFile]**](SourceFile.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -540,6 +386,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A list of files. | - |
@@ -555,17 +402,24 @@ Name | Type | Description | Notes
Remove Label from File
-Remove a label from a File. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1&name=label_name' ```
+Remove a label from a File.
+
+Example CURL:
+```bash
+curl -X DELETE 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1&name=label_name'
+```
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -577,86 +431,37 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.FilesApi(api_client)
- id = 'id_example' # str | A File id.
-name = 'name_example' # str | A label name.
-
- try:
- # Remove Label from File
- api_instance.remove_label(id, name)
- except ApiException as e:
- print("Exception when calling FilesApi->remove_label: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.FilesApi(api_client)
id = 'id_example' # str | A File id.
-name = 'name_example' # str | A label name.
+ name = 'name_example' # str | A label name.
try:
# Remove Label from File
api_instance.remove_label(id, name)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling FilesApi->remove_label: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| A File id. |
@@ -668,7 +473,7 @@ void (empty response body)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -676,6 +481,7 @@ void (empty response body)
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | A success response. | - |
@@ -685,75 +491,39 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file**
-> SourceFile upload_file(name, body, file_hash=file_hash, lang_id=lang_id, project_id=project_id, category=category, labels=labels)
+> SourceFile upload_file(name, body, file_hash=file_hash, lang_id=lang_id, project_id=project_id, category=category, labels=labels, job_type=job_type)
Upload a File
-Upload a File in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed in as query string parameters. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @en_US.json ``` Calls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score. The language detection will complete asynchronously. Prior to completion, the `detected_lang` value will be `zxx`, the reserved ISO 639-2 code for \"No linguistic content/not applicable\". If the language can not be determined, or the detection process fails, the `detected_lang` field will return `und`, the reserved ISO 639-2 code for undetermined language, and the `detected_lang_confidence` score will be `0`.
-
-### Example
+Upload a File in any of the formats [documented in our knowledge
+base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats).
+Request parameters should be passed in as query string parameters.
-* Api Key Authentication (ApiKeyAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
+Example CURL command:
+```bash
+ curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \
+ --header "Content-Type: application/octet-stream" \
+ --data-binary @en_US.json
+```
+Calls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score.
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
+The language detection will complete asynchronously. Prior to completion, the `detected_lang` value will be `zxx`, the reserved ISO 639-2 code for "No linguistic content/not applicable".
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+If the language can not be determined, or the detection process fails, the `detected_lang` field will return `und`, the reserved ISO 639-2 code for undetermined language, and the `detected_lang_confidence` score will be `0`.
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.FilesApi(api_client)
- name = 'name_example' # str | A file name.
-body = '/path/to/file' # file | The file contents to be uploaded. The entire POST body will be treated as the file.
-file_hash = 'file_hash_example' # str | A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided. (optional)
-lang_id = True # bool | Flag indicating whether to perform language detection on the uploaded file. Default is false. (optional)
-project_id = 56 # int | The project to associate the uploaded file with. (optional)
-category = 'category_example' # str | The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material. (optional)
-labels = 'labels_example' # str | Comma-separated list of labels to add to the uploaded document. (optional)
- try:
- # Upload a File
- api_response = api_instance.upload_file(name, body, file_hash=file_hash, lang_id=lang_id, project_id=project_id, category=category, labels=labels)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling FilesApi->upload_file: %s\n" % e)
-```
+### Example
* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.source_file import SourceFile
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -765,53 +535,55 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.FilesApi(api_client)
name = 'name_example' # str | A file name.
-body = '/path/to/file' # file | The file contents to be uploaded. The entire POST body will be treated as the file.
-file_hash = 'file_hash_example' # str | A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided. (optional)
-lang_id = True # bool | Flag indicating whether to perform language detection on the uploaded file. Default is false. (optional)
-project_id = 56 # int | The project to associate the uploaded file with. (optional)
-category = 'category_example' # str | The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material. (optional)
-labels = 'labels_example' # str | Comma-separated list of labels to add to the uploaded document. (optional)
+ body = None # bytearray | The file contents to be uploaded. The entire POST body will be treated as the file.
+ file_hash = 'file_hash_example' # str | A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided. (optional)
+ lang_id = True # bool | Flag indicating whether to perform language detection on the uploaded file. Default is false. (optional)
+ project_id = 56 # int | The project to associate the uploaded file with. (optional)
+ category = 'category_example' # str | The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material. (optional)
+ labels = 'labels_example' # str | Comma-separated list of labels to add to the uploaded document. (optional)
+ job_type = 'job_type_example' # str | Specifies the job type when adding this file to a job. (optional)
try:
# Upload a File
- api_response = api_instance.upload_file(name, body, file_hash=file_hash, lang_id=lang_id, project_id=project_id, category=category, labels=labels)
+ api_response = api_instance.upload_file(name, body, file_hash=file_hash, lang_id=lang_id, project_id=project_id, category=category, labels=labels, job_type=job_type)
+ print("The response of FilesApi->upload_file:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling FilesApi->upload_file: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| A file name. |
- **body** | **file**| The file contents to be uploaded. The entire POST body will be treated as the file. |
+ **body** | **bytearray**| The file contents to be uploaded. The entire POST body will be treated as the file. |
**file_hash** | **str**| A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided. | [optional]
**lang_id** | **bool**| Flag indicating whether to perform language detection on the uploaded file. Default is false. | [optional]
**project_id** | **int**| The project to associate the uploaded file with. | [optional]
**category** | **str**| The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material. | [optional]
**labels** | **str**| Comma-separated list of labels to add to the uploaded document. | [optional]
+ **job_type** | **str**| Specifies the job type when adding this file to a job. | [optional]
### Return type
@@ -819,7 +591,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -827,6 +599,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | A SourceFile object. | - |
diff --git a/docs/FilterConfig.md b/docs/FilterConfig.md
new file mode 100644
index 0000000..b266324
--- /dev/null
+++ b/docs/FilterConfig.md
@@ -0,0 +1,42 @@
+# FilterConfig
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | The unique identifier for the filter configuration. | [optional]
+**is_default** | **bool** | Indicates if the filter configuration is the default. | [optional]
+**filter_config** | **str** | The filter configuration. | [optional]
+**filter_name** | **str** | The name of the filter. | [optional]
+**config_name** | **str** | The name of the configuration. | [optional]
+**config_description** | **str** | The description of the configuration. | [optional]
+**subfilters** | **str** | The subfilters. | [optional]
+**segmentation_config_setting** | **str** | The segmentation configuration setting. | [optional]
+**srx** | **str** | The SRX (Segmentation Rules eXchange) data. | [optional]
+**segmentation_config_name** | **str** | The name of the segmentation configuration. | [optional]
+**domains** | [**List[DomainReference]**](DomainReference.md) | The domains associated with the filter configuration. | [optional]
+**created_at** | **datetime** | The creation timestamp. | [optional]
+**updated_at** | **datetime** | The last update timestamp. | [optional]
+**default** | **bool** | Indicates if the filter configuration is the default. | [optional]
+
+## Example
+
+```python
+from lilt.models.filter_config import FilterConfig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FilterConfig from a JSON string
+filter_config_instance = FilterConfig.from_json(json)
+# print the JSON string representation of the object
+print(FilterConfig.to_json())
+
+# convert the object into a dict
+filter_config_dict = filter_config_instance.to_dict()
+# create an instance of FilterConfig from a dict
+filter_config_from_dict = FilterConfig.from_dict(filter_config_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/GetLiltCreateContentResponse.md b/docs/GetLiltCreateContentResponse.md
index 2a1b391..fc2f781 100644
--- a/docs/GetLiltCreateContentResponse.md
+++ b/docs/GetLiltCreateContentResponse.md
@@ -1,10 +1,29 @@
# GetLiltCreateContentResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**contents** | [**list[LiltCreateContent]**](LiltCreateContent.md) | List of LiltCreateContent objects | [optional]
+**contents** | [**List[LiltCreateContent]**](LiltCreateContent.md) | List of LiltCreateContent objects | [optional]
+
+## Example
+
+```python
+from lilt.models.get_lilt_create_content_response import GetLiltCreateContentResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of GetLiltCreateContentResponse from a JSON string
+get_lilt_create_content_response_instance = GetLiltCreateContentResponse.from_json(json)
+# print the JSON string representation of the object
+print(GetLiltCreateContentResponse.to_json())
+# convert the object into a dict
+get_lilt_create_content_response_dict = get_lilt_create_content_response_instance.to_dict()
+# create an instance of GetLiltCreateContentResponse from a dict
+get_lilt_create_content_response_from_dict = GetLiltCreateContentResponse.from_dict(get_lilt_create_content_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/Job.md b/docs/Job.md
index 644e657..de185d6 100644
--- a/docs/Job.md
+++ b/docs/Job.md
@@ -1,7 +1,9 @@
# Job
A Job is a collection of multiple Projects. Each project is specific to a language pair, and is associated with exactly one Memory for that language pair. The Memory association cannot be changed after the Project is created.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | A name for the job. | [optional]
@@ -13,6 +15,23 @@ Name | Type | Description | Notes
**is_processing** | **int** | Values include `1` while in progress, `0` when idle and `-2` when processing failed. | [optional]
**stats** | [**JobStats**](JobStats.md) | | [optional]
+## Example
+
+```python
+from lilt.models.job import Job
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Job from a JSON string
+job_instance = Job.from_json(json)
+# print the JSON string representation of the object
+print(Job.to_json())
+
+# convert the object into a dict
+job_dict = job_instance.to_dict()
+# create an instance of Job from a dict
+job_from_dict = Job.from_dict(job_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/JobCreateParameters.md b/docs/JobCreateParameters.md
index d82a7db..9c57337 100644
--- a/docs/JobCreateParameters.md
+++ b/docs/JobCreateParameters.md
@@ -1,17 +1,37 @@
# JobCreateParameters
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | A name for the Job. |
-**language_pairs** | [**list[LanguagePair]**](LanguagePair.md) | Language pairs is a set of one or more pairs that includes source language, source locale(optional), target language, target locale(optional), and memoryId. |
-**file_ids** | **list[int]** | A list of file ids to upload to job creation. |
+**language_pairs** | [**List[LanguagePair]**](LanguagePair.md) | Language pairs is a set of one or more pairs that includes source language, source locale(optional), target language, target locale(optional), and memoryId. |
+**file_ids** | **List[int]** | A list of file ids to upload to job creation. |
**due** | **str** | An ISO string date representing job due date. | [optional]
**src_lang** | **str** | 2-letter ISO source language code |
-**src_locale** | **str** | 2-letter source language code |
+**src_locale** | **str** | 2-letter source language code | [optional]
**is_plural** | **bool** | A boolean value representing if the files have plurals. | [optional]
**workflow_template_id** | **int** | ID of the workflow template to be used. Use the [workflows templates endpoint](#tag/Workflows/operation/getWorkflowTemplates) to get the list of available workflows. | [optional]
+**domain_id** | **int** | ID of the domain to be used. Use the [domains endpoint](#tag/Domains/operation/getDomains) to get the list of available domains. | [optional]
+
+## Example
+
+```python
+from lilt.models.job_create_parameters import JobCreateParameters
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of JobCreateParameters from a JSON string
+job_create_parameters_instance = JobCreateParameters.from_json(json)
+# print the JSON string representation of the object
+print(JobCreateParameters.to_json())
+# convert the object into a dict
+job_create_parameters_dict = job_create_parameters_instance.to_dict()
+# create an instance of JobCreateParameters from a dict
+job_create_parameters_from_dict = JobCreateParameters.from_dict(job_create_parameters_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/JobDeleteResponse.md b/docs/JobDeleteResponse.md
index 290c7d5..0aefcf8 100644
--- a/docs/JobDeleteResponse.md
+++ b/docs/JobDeleteResponse.md
@@ -1,10 +1,29 @@
# JobDeleteResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique Project identifier. | [optional]
+## Example
+
+```python
+from lilt.models.job_delete_response import JobDeleteResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of JobDeleteResponse from a JSON string
+job_delete_response_instance = JobDeleteResponse.from_json(json)
+# print the JSON string representation of the object
+print(JobDeleteResponse.to_json())
+
+# convert the object into a dict
+job_delete_response_dict = job_delete_response_instance.to_dict()
+# create an instance of JobDeleteResponse from a dict
+job_delete_response_from_dict = JobDeleteResponse.from_dict(job_delete_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/JobLeverageStats.md b/docs/JobLeverageStats.md
index 1672285..60b5d9c 100644
--- a/docs/JobLeverageStats.md
+++ b/docs/JobLeverageStats.md
@@ -1,15 +1,34 @@
# JobLeverageStats
A job leverage stats object shows an overview of job's statistical data including total number of exact words, fuzzy words, and exact words for the job in total and for each project.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**source_words** | **int** | Total number of source words. | [optional]
**exact_words** | **int** | Total number of exact words. | [optional]
**fuzzy_words** | **int** | Total number of fuzzy words. | [optional]
**new_words** | **int** | Total number of new words. | [optional]
-**projects** | [**list[ProjectStats]**](ProjectStats.md) | | [optional]
+**projects** | [**List[ProjectStats]**](ProjectStats.md) | | [optional]
+
+## Example
+
+```python
+from lilt.models.job_leverage_stats import JobLeverageStats
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of JobLeverageStats from a JSON string
+job_leverage_stats_instance = JobLeverageStats.from_json(json)
+# print the JSON string representation of the object
+print(JobLeverageStats.to_json())
+# convert the object into a dict
+job_leverage_stats_dict = job_leverage_stats_instance.to_dict()
+# create an instance of JobLeverageStats from a dict
+job_leverage_stats_from_dict = JobLeverageStats.from_dict(job_leverage_stats_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/JobProject.md b/docs/JobProject.md
index 23ebd34..d67e16c 100644
--- a/docs/JobProject.md
+++ b/docs/JobProject.md
@@ -1,7 +1,9 @@
# JobProject
A job project contains project statistical data that belongs to a specific job.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | An id for the project. | [optional]
@@ -22,6 +24,23 @@ Name | Type | Description | Notes
**workflow_status** | **str** | The status of the Workflow for the current project. | [optional]
**workflow_name** | **str** | Human readable name of the workflow associated with the current project. | [optional]
+## Example
+
+```python
+from lilt.models.job_project import JobProject
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of JobProject from a JSON string
+job_project_instance = JobProject.from_json(json)
+# print the JSON string representation of the object
+print(JobProject.to_json())
+
+# convert the object into a dict
+job_project_dict = job_project_instance.to_dict()
+# create an instance of JobProject from a dict
+job_project_from_dict = JobProject.from_dict(job_project_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/JobStats.md b/docs/JobStats.md
index 0e5c93b..f552abc 100644
--- a/docs/JobStats.md
+++ b/docs/JobStats.md
@@ -1,7 +1,9 @@
# JobStats
A job stats shows an overview of job's statistical data including total number of exact words, fuzzy words, language pairs, projects, etc.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**exact_words** | **int** | Total number of exact words. | [optional]
@@ -12,12 +14,29 @@ Name | Type | Description | Notes
**num_projects** | **int** | Total number of projects. | [optional]
**percent_reviewed** | **int** | Overall percentage of documents reviewed. | [optional]
**percent_translated** | **int** | Overall percentage of documents translated. | [optional]
-**projects** | [**list[JobProject]**](JobProject.md) | | [optional]
+**projects** | [**List[JobProject]**](JobProject.md) | | [optional]
**source_words** | **int** | Total number of source words. | [optional]
**unique_language_pairs** | **int** | Number of unique language pairs. | [optional]
**unique_linguists** | **int** | Number of unique linguists. | [optional]
**workflow_status** | **str** | The status of the Workflow for the current job. | [optional]
+## Example
+
+```python
+from lilt.models.job_stats import JobStats
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of JobStats from a JSON string
+job_stats_instance = JobStats.from_json(json)
+# print the JSON string representation of the object
+print(JobStats.to_json())
+
+# convert the object into a dict
+job_stats_dict = job_stats_instance.to_dict()
+# create an instance of JobStats from a dict
+job_stats_from_dict = JobStats.from_dict(job_stats_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/JobUpdateParameters.md b/docs/JobUpdateParameters.md
index 8dcdd1d..fbe941c 100644
--- a/docs/JobUpdateParameters.md
+++ b/docs/JobUpdateParameters.md
@@ -1,6 +1,8 @@
# JobUpdateParameters
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | A name for the Job. | [optional]
@@ -8,6 +10,23 @@ Name | Type | Description | Notes
**is_processing** | **str** | The processing status of the job. Provide one of the following integers to indicate the status. Ok = 0 Started = 1 ExportError = -2 | [optional]
**processing_error_msg** | **str** | The processing error message. | [optional]
+## Example
+
+```python
+from lilt.models.job_update_parameters import JobUpdateParameters
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of JobUpdateParameters from a JSON string
+job_update_parameters_instance = JobUpdateParameters.from_json(json)
+# print the JSON string representation of the object
+print(JobUpdateParameters.to_json())
+
+# convert the object into a dict
+job_update_parameters_dict = job_update_parameters_instance.to_dict()
+# create an instance of JobUpdateParameters from a dict
+job_update_parameters_from_dict = JobUpdateParameters.from_dict(job_update_parameters_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/JobsApi.md b/docs/JobsApi.md
index d891d44..0b811ae 100644
--- a/docs/JobsApi.md
+++ b/docs/JobsApi.md
@@ -23,17 +23,27 @@ Method | HTTP request | Description
Archive a Job
-Set job to archived, unassign all linguists and archive all projects and documents inside the job. It will return the archived job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/archive?key=API_KEY' ```
+Set job to archived, unassign all linguists and archive all projects and documents inside the job.
+
+It will return the archived job.
+
+Example CURL command:
+
+```bash
+curl -X POST 'https://api.lilt.com/v2/jobs/{id}/archive?key=API_KEY'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job import Job
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -45,69 +55,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-
- try:
- # Archive a Job
- api_response = api_instance.archive_job(job_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->archive_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -118,13 +76,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Archive a Job
api_response = api_instance.archive_job(job_id)
+ print("The response of JobsApi->archive_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->archive_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
@@ -135,7 +97,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -143,6 +105,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A job object. | - |
@@ -156,17 +119,45 @@ Name | Type | Description | Notes
Create a Job
-Create a Job. A Job is a collection of Projects. A Job will contain multiple projects, based on the language pair. A Project is associated with exactly one Memory. Jobs appear in the Jobs dashboard of the web app. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"fileIds\": [5009, 5010, 5011], \"due\": \"2022-05-05T10:56:44.985Z\", \"srcLang\": \"en\", \"srcLocale\": \"US\", \"languagePairs\": [ { \"memoryId\": 3121, \"trgLang\": \"de\" }, { \"memoryId\": 2508, \"trgLang\": \"fr\" }, { \"memoryId\": 3037, \"trgLang\": \"zh\" } ] }' ```
+Create a Job. A Job is a collection of Projects.
+A Job will contain multiple projects, based on the language pair.
+A Project is associated with exactly one Memory.
+
+Jobs appear in the Jobs dashboard of the web app.
+
+Example CURL command:
+
+```bash
+curl -X POST 'https://api.lilt.com/v2/jobs?key=API_KEY' \
+--header 'Content-Type: application/json' \
+--data-raw '{
+ "name": "test job",
+ "fileIds": [5009, 5010, 5011],
+ "due": "2022-05-05T10:56:44.985Z",
+ "srcLang": "en",
+ "srcLocale": "US",
+ "languagePairs": [
+ { "memoryId": 3121, "trgLang": "de" },
+ { "memoryId": 2508, "trgLang": "fr" },
+ { "memoryId": 3037, "trgLang": "zh" }
+ ]
+}'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job import Job
+from lilt.models.job_create_parameters import JobCreateParameters
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -178,89 +169,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- body = lilt.JobCreateParameters() # JobCreateParameters |
-
- try:
- # Create a Job
- api_response = api_instance.create_job(body)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->create_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.JobsApi(api_client)
- body = lilt.JobCreateParameters() # JobCreateParameters |
+ body = lilt.JobCreateParameters() # JobCreateParameters | The Job resource to create.
try:
# Create a Job
api_response = api_instance.create_job(body)
+ print("The response of JobsApi->create_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->create_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**JobCreateParameters**](JobCreateParameters.md)| |
+ **body** | [**JobCreateParameters**](JobCreateParameters.md)| The Job resource to create. |
### Return type
@@ -268,7 +211,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -276,6 +219,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A Job object. | - |
@@ -289,17 +233,25 @@ Name | Type | Description | Notes
Delete a Job
-Delete a job, deletes all projects and documents in the job, deletes all the segments from all the job's translation memories. Example CURL command: ```bash curl -X DELETE 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ```
+Delete a job, deletes all projects and documents in the job, deletes all the segments from all the job's translation memories.
+
+Example CURL command:
+
+```bash
+curl -X DELETE 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job_delete_response import JobDeleteResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -311,69 +263,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-
- try:
- # Delete a Job
- api_response = api_instance.delete_job(job_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->delete_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -384,13 +284,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Delete a Job
api_response = api_instance.delete_job(job_id)
+ print("The response of JobsApi->delete_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->delete_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
@@ -401,7 +305,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -409,6 +313,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A status object. | - |
@@ -422,17 +327,27 @@ Name | Type | Description | Notes
Deliver a Job
-Set the job state to delivered and set all the projects in the job to done It will return the delivered job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/deliver?key=API_KEY' ```
+Set the job state to delivered and set all the projects in the job to done
+
+It will return the delivered job.
+
+Example CURL command:
+
+```bash
+curl -X POST 'https://api.lilt.com/v2/jobs/{id}/deliver?key=API_KEY'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job import Job
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -444,69 +359,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-
- try:
- # Deliver a Job
- api_response = api_instance.deliver_job(job_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->deliver_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -517,13 +380,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Deliver a Job
api_response = api_instance.deliver_job(job_id)
+ print("The response of JobsApi->deliver_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->deliver_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
@@ -534,7 +401,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -542,6 +409,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A job object. | - |
@@ -551,21 +419,30 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **download_job**
-> str download_job(job_id)
+> bytearray download_job(job_id)
Download a Job
-Make sure you have exported a job with the same id before using this api. Downloading files requires the exported job `id` in the param. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/download?key=API_KEY' ```
+Make sure you have exported a job with the same id before using this api.
+
+Downloading files requires the exported job `id` in the param.
+
+Example CURL command:
+
+```bash
+curl -X GET 'https://api.lilt.com/v2/jobs/{id}/download?key=API_KEY'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -577,69 +454,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-
- try:
- # Download a Job
- api_response = api_instance.download_job(job_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->download_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -650,24 +475,28 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Download a Job
api_response = api_instance.download_job(job_id)
+ print("The response of JobsApi->download_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->download_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
### Return type
-**str**
+**bytearray**
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -675,6 +504,7 @@ Name | Type | Description | Notes
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | zipped file | - |
@@ -688,65 +518,30 @@ Name | Type | Description | Notes
Export a Job
-Prepare job files for download. To export translated documents from the job use the query parameter `type=files`: Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/export?key=API_KEY&type=files' ``` To export job memories use the query parameter `type=memory`. The status of the export can be checked by requesting the job `GET /jobs/:jobId`, `job.isProcessing` will be `1` while in progress, `0` when idle and `-2` when the export failed.
+Prepare job files for download.
+To export translated documents from the job use the query parameter `type=files`:
-### Example
-
-* Api Key Authentication (ApiKeyAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
+Example CURL command:
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
+```bash
+curl -X GET 'https://api.lilt.com/v2/jobs/{id}/export?key=API_KEY&type=files'
+```
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+To export job memories use the query parameter `type=memory`.
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+The status of the export can be checked by requesting the job `GET /jobs/:jobId`, `job.isProcessing` will be `1` while in progress,
+`0` when idle and `-2` when the export failed.
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-type = 'type_example' # str | category for files and memory.
-
- try:
- # Export a Job
- api_instance.export_job(job_id, type)
- except ApiException as e:
- print("Exception when calling JobsApi->export_job: %s\n" % e)
-```
+### Example
* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -758,38 +553,37 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.JobsApi(api_client)
job_id = 56 # int | A job id.
-type = 'type_example' # str | category for files and memory.
+ type = 'type_example' # str | category for files and memory.
try:
# Export a Job
api_instance.export_job(job_id, type)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->export_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
@@ -801,7 +595,7 @@ void (empty response body)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -809,6 +603,7 @@ void (empty response body)
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | 200 status. | - |
@@ -822,17 +617,25 @@ void (empty response body)
Retrieve a Job
-Retrieves a job data along with stats. To retrieve a specific job, you will need the job `id` in the url path. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ```
+Retrieves a job data along with stats. To retrieve a specific job, you will need the job `id` in the url path.
+
+Example CURL command:
+
+```bash
+curl -X GET 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job import Job
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -844,69 +647,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-
- try:
- # Retrieve a Job
- api_response = api_instance.get_job(job_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->get_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -917,13 +668,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Retrieve a Job
api_response = api_instance.get_job(job_id)
+ print("The response of JobsApi->get_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->get_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
@@ -934,7 +689,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -942,6 +697,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A job object. | - |
@@ -953,19 +709,27 @@ Name | Type | Description | Notes
# **get_job_leverage_stats**
> JobLeverageStats get_job_leverage_stats(job_id)
-Retrieve Job Leverage Stats
+Retrieve Job Leverage Stats
+
+Get the TM leverage stats for the job (new/exact/fuzzy matches).
+
+Example CURL command:
-Get the TM leverage stats for the job (new/exact/fuzzy matches). Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/stats?key=API_KEY' ```
+```bash
+curl -X POST 'https://api.lilt.com/v2/jobs/{id}/stats?key=API_KEY'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job_leverage_stats import JobLeverageStats
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -977,69 +741,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-
- try:
- # Retrieve Job Leverage Stats
- api_response = api_instance.get_job_leverage_stats(job_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->get_job_leverage_stats: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -1050,13 +762,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Retrieve Job Leverage Stats
api_response = api_instance.get_job_leverage_stats(job_id)
+ print("The response of JobsApi->get_job_leverage_stats:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->get_job_leverage_stats: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
@@ -1067,7 +783,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1075,6 +791,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A job leverage stats object. | - |
@@ -1088,17 +805,27 @@ Name | Type | Description | Notes
Reactivate a Job
-Set the job state to active. Does not change the state of projects associated with the given job. It will return the reactivated job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/reactivate?key=API_KEY' ```
+Set the job state to active. Does not change the state of projects associated with the given job.
+
+It will return the reactivated job.
+
+Example CURL command:
+
+```bash
+curl -X POST 'https://api.lilt.com/v2/jobs/{id}/reactivate?key=API_KEY'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job import Job
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -1110,69 +837,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-
- try:
- # Reactivate a Job
- api_response = api_instance.reactivate_job(job_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->reactivate_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -1183,13 +858,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Reactivate a Job
api_response = api_instance.reactivate_job(job_id)
+ print("The response of JobsApi->reactivate_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->reactivate_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
@@ -1200,7 +879,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1208,6 +887,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A job object. | - |
@@ -1217,21 +897,29 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **retrieve_all_jobs**
-> list[Job] retrieve_all_jobs(is_archived=is_archived, is_delivered=is_delivered, offset=offset, limit=limit)
+> List[Job] retrieve_all_jobs(is_archived=is_archived, is_delivered=is_delivered, offset=offset, limit=limit)
Retrieve all Jobs
-Get all Jobs within a given offset and limit. You can retrieve jobs from your account using the above API. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs?key=API_KEY&isArchived=false' ```
+Get all Jobs within a given offset and limit. You can retrieve jobs from your account using the above API.
+
+Example CURL command:
+
+```bash
+curl -X GET 'https://api.lilt.com/v2/jobs?key=API_KEY&isArchived=false'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job import Job
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -1243,92 +931,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- is_archived = True # bool | Retrieves all jobs that are archived. (optional)
-is_delivered = True # bool | Retrieves all jobs that are delivered. (optional)
-offset = 56 # int | Return jobs starting at the offset row. If not given the default offset will be 0. (optional)
-limit = 56 # int | The maximum number of jobs to be returned. If not given the default limit will be 25. (optional)
-
- try:
- # Retrieve all Jobs
- api_response = api_instance.retrieve_all_jobs(is_archived=is_archived, is_delivered=is_delivered, offset=offset, limit=limit)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->retrieve_all_jobs: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.JobsApi(api_client)
is_archived = True # bool | Retrieves all jobs that are archived. (optional)
-is_delivered = True # bool | Retrieves all jobs that are delivered. (optional)
-offset = 56 # int | Return jobs starting at the offset row. If not given the default offset will be 0. (optional)
-limit = 56 # int | The maximum number of jobs to be returned. If not given the default limit will be 25. (optional)
+ is_delivered = True # bool | Retrieves all jobs that are delivered. (optional)
+ offset = 56 # int | Return jobs starting at the offset row. If not given the default offset will be 0. (optional)
+ limit = 56 # int | The maximum number of jobs to be returned. If not given the default limit will be 25. (optional)
try:
# Retrieve all Jobs
api_response = api_instance.retrieve_all_jobs(is_archived=is_archived, is_delivered=is_delivered, offset=offset, limit=limit)
+ print("The response of JobsApi->retrieve_all_jobs:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->retrieve_all_jobs: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**is_archived** | **bool**| Retrieves all jobs that are archived. | [optional]
@@ -1338,11 +975,11 @@ Name | Type | Description | Notes
### Return type
-[**list[Job]**](Job.md)
+[**List[Job]**](Job.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1350,6 +987,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A list of Job objects. | - |
@@ -1363,17 +1001,25 @@ Name | Type | Description | Notes
Unarchive a Job
-Set job to unarchived, the job will move to active status. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/unarchive?key=API_KEY' ```
+Set job to unarchived, the job will move to active status.
+
+Example CURL command:
+
+```bash
+curl -X POST 'https://api.lilt.com/v2/jobs/{id}/unarchive?key=API_KEY'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job import Job
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -1385,69 +1031,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-
- try:
- # Unarchive a Job
- api_response = api_instance.unarchive_job(job_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->unarchive_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -1458,13 +1052,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Unarchive a Job
api_response = api_instance.unarchive_job(job_id)
+ print("The response of JobsApi->unarchive_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->unarchive_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
@@ -1475,7 +1073,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1483,6 +1081,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A job object. | - |
@@ -1496,17 +1095,33 @@ Name | Type | Description | Notes
Update a Job
-Updates a job with the new job properties. To update a specific job, you will need the job `id` in the url path. You can update job's name and due date by passing the property and new value in the body. Example CURL command: ```bash curl -X PUT 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"due\": \"2022-05-05T10:56:44.985Z\" }' ```
+Updates a job with the new job properties. To update a specific job, you will need the job `id` in the url path.
+
+You can update job's name and due date by passing the property and new value in the body.
+
+Example CURL command:
+
+```bash
+curl -X PUT 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' \
+--header 'Content-Type: application/json' \
+--data-raw '{
+ "name": "test job",
+ "due": "2022-05-05T10:56:44.985Z"
+}'
+```
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.job import Job
+from lilt.models.job_update_parameters import JobUpdateParameters
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -1518,92 +1133,43 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.JobsApi(api_client)
- job_id = 56 # int | A job id.
-body = lilt.JobUpdateParameters() # JobUpdateParameters | (optional)
-
- try:
- # Update a Job
- api_response = api_instance.update_job(job_id, body=body)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling JobsApi->update_job: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.JobsApi(api_client)
job_id = 56 # int | A job id.
-body = lilt.JobUpdateParameters() # JobUpdateParameters | (optional)
+ body = lilt.JobUpdateParameters() # JobUpdateParameters | The Job resource to update. (optional)
try:
# Update a Job
api_response = api_instance.update_job(job_id, body=body)
+ print("The response of JobsApi->update_job:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling JobsApi->update_job: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job_id** | **int**| A job id. |
- **body** | [**JobUpdateParameters**](JobUpdateParameters.md)| | [optional]
+ **body** | [**JobUpdateParameters**](JobUpdateParameters.md)| The Job resource to update. | [optional]
### Return type
@@ -1611,7 +1177,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1619,6 +1185,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A job object. | - |
diff --git a/docs/LanguagePair.md b/docs/LanguagePair.md
index a91a415..3c439a2 100644
--- a/docs/LanguagePair.md
+++ b/docs/LanguagePair.md
@@ -1,7 +1,9 @@
# LanguagePair
A language pair couples the source and target language along with memory and pre-translations settings associated to a project.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**trg_lang** | **str** | Target language, an ISO 639-1 language identifier. |
@@ -16,8 +18,25 @@ Name | Type | Description | Notes
**config_id** | **int** | Configuration id | [optional]
**workflow_template_id** | **int** | Workflow Template id, to assign a specific Workflow to the project created out of this Language Pair. WorkflowTemplateIds can be retrieved via the /workflows/templates endpoint. If not specified then the Job level workflowTemplateId will be used. | [optional]
**workflow_template_name** | **int** | Workflow Template Name, when passed with TeamId it allows for an on the fly look up of the correct WorkflowTemplate to use. If workflowTemplateId is passed the workflowTemplateId supercedes other lookups. | [optional]
-**workflow_stage_assignments** | [**list[WorkflowStageAssignment]**](WorkflowStageAssignment.md) | | [optional]
+**workflow_stage_assignments** | [**List[WorkflowStageAssignment]**](WorkflowStageAssignment.md) | | [optional]
+
+## Example
+
+```python
+from lilt.models.language_pair import LanguagePair
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LanguagePair from a JSON string
+language_pair_instance = LanguagePair.from_json(json)
+# print the JSON string representation of the object
+print(LanguagePair.to_json())
+# convert the object into a dict
+language_pair_dict = language_pair_instance.to_dict()
+# create an instance of LanguagePair from a dict
+language_pair_from_dict = LanguagePair.from_dict(language_pair_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/LanguagesApi.md b/docs/LanguagesApi.md
index a7616ce..2f3560b 100644
--- a/docs/LanguagesApi.md
+++ b/docs/LanguagesApi.md
@@ -12,17 +12,21 @@ Method | HTTP request | Description
Retrieve supported languages
-Get a list of supported languages.
+Get a list of supported languages.
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.languages_response import LanguagesResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -34,83 +38,36 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.LanguagesApi(api_client)
-
- try:
- # Retrieve supported languages
- api_response = api_instance.get_languages()
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling LanguagesApi->get_languages: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.LanguagesApi(api_client)
-
+
try:
# Retrieve supported languages
api_response = api_instance.get_languages()
+ print("The response of LanguagesApi->get_languages:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling LanguagesApi->get_languages: %s\n" % e)
```
+
+
### Parameters
+
This endpoint does not need any parameter.
### Return type
@@ -119,7 +76,7 @@ This endpoint does not need any parameter.
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -127,6 +84,7 @@ This endpoint does not need any parameter.
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An object listing supported languages and their corresponding locales. | - |
diff --git a/docs/LanguagesResponse.md b/docs/LanguagesResponse.md
index 908d56e..d4856a7 100644
--- a/docs/LanguagesResponse.md
+++ b/docs/LanguagesResponse.md
@@ -1,11 +1,30 @@
# LanguagesResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**source_to_target** | [**object**](.md) | A two-dimensional object in which the first key is an ISO 639-1 language code indicating the source, and the second key is an ISO 639-1 language code indicating the target. | [optional]
-**code_to_name** | [**object**](.md) | An object in which the key is an ISO 639-1 language code, and the value is the language name. | [optional]
+**source_to_target** | **object** | A two-dimensional object in which the first key is an ISO 639-1 language code indicating the source, and the second key is an ISO 639-1 language code indicating the target. | [optional]
+**code_to_name** | **object** | An object in which the key is an ISO 639-1 language code, and the value is the language name. | [optional]
+
+## Example
+
+```python
+from lilt.models.languages_response import LanguagesResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LanguagesResponse from a JSON string
+languages_response_instance = LanguagesResponse.from_json(json)
+# print the JSON string representation of the object
+print(LanguagesResponse.to_json())
+# convert the object into a dict
+languages_response_dict = languages_response_instance.to_dict()
+# create an instance of LanguagesResponse from a dict
+languages_response_from_dict = LanguagesResponse.from_dict(languages_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/LiltCreateContent.md b/docs/LiltCreateContent.md
index db45893..dcf7943 100644
--- a/docs/LiltCreateContent.md
+++ b/docs/LiltCreateContent.md
@@ -1,7 +1,9 @@
# LiltCreateContent
Content Parameters for LiltCreate.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | A name for the request content. | [optional]
@@ -11,6 +13,23 @@ Name | Type | Description | Notes
**template_params** | [**LiltCreateContentTemplateParams**](LiltCreateContentTemplateParams.md) | |
**preferences** | [**LiltCreateContentPreferences**](LiltCreateContentPreferences.md) | | [optional]
+## Example
+
+```python
+from lilt.models.lilt_create_content import LiltCreateContent
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LiltCreateContent from a JSON string
+lilt_create_content_instance = LiltCreateContent.from_json(json)
+# print the JSON string representation of the object
+print(LiltCreateContent.to_json())
+
+# convert the object into a dict
+lilt_create_content_dict = lilt_create_content_instance.to_dict()
+# create an instance of LiltCreateContent from a dict
+lilt_create_content_from_dict = LiltCreateContent.from_dict(lilt_create_content_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/LiltCreateContentPreferences.md b/docs/LiltCreateContentPreferences.md
index de039d3..32c847d 100644
--- a/docs/LiltCreateContentPreferences.md
+++ b/docs/LiltCreateContentPreferences.md
@@ -1,12 +1,31 @@
# LiltCreateContentPreferences
The preferences of the content.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tone** | **str** | The tone of the content. | [optional]
**styleguide** | **str** | The styleguide of the content. | [optional]
+## Example
+
+```python
+from lilt.models.lilt_create_content_preferences import LiltCreateContentPreferences
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LiltCreateContentPreferences from a JSON string
+lilt_create_content_preferences_instance = LiltCreateContentPreferences.from_json(json)
+# print the JSON string representation of the object
+print(LiltCreateContentPreferences.to_json())
+
+# convert the object into a dict
+lilt_create_content_preferences_dict = lilt_create_content_preferences_instance.to_dict()
+# create an instance of LiltCreateContentPreferences from a dict
+lilt_create_content_preferences_from_dict = LiltCreateContentPreferences.from_dict(lilt_create_content_preferences_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/LiltCreateContentRequest.md b/docs/LiltCreateContentRequest.md
index f610e2f..6dcd3d3 100644
--- a/docs/LiltCreateContentRequest.md
+++ b/docs/LiltCreateContentRequest.md
@@ -1,7 +1,9 @@
# LiltCreateContentRequest
Content Parameters for LiltCreate.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | A name for the request content. | [optional]
@@ -10,6 +12,23 @@ Name | Type | Description | Notes
**template_params** | [**LiltCreateContentTemplateParams**](LiltCreateContentTemplateParams.md) | |
**preferences** | [**LiltCreateContentPreferences**](LiltCreateContentPreferences.md) | | [optional]
+## Example
+
+```python
+from lilt.models.lilt_create_content_request import LiltCreateContentRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LiltCreateContentRequest from a JSON string
+lilt_create_content_request_instance = LiltCreateContentRequest.from_json(json)
+# print the JSON string representation of the object
+print(LiltCreateContentRequest.to_json())
+
+# convert the object into a dict
+lilt_create_content_request_dict = lilt_create_content_request_instance.to_dict()
+# create an instance of LiltCreateContentRequest from a dict
+lilt_create_content_request_from_dict = LiltCreateContentRequest.from_dict(lilt_create_content_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/LiltCreateContentTemplateParams.md b/docs/LiltCreateContentTemplateParams.md
index dd34c48..9275613 100644
--- a/docs/LiltCreateContentTemplateParams.md
+++ b/docs/LiltCreateContentTemplateParams.md
@@ -1,15 +1,34 @@
# LiltCreateContentTemplateParams
The template parameters of the content.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**content_length** | **int** | The length of the content. | [optional]
**memory_id** | **int** | The ID referencing a Data Source. | [optional]
**language** | **str** | The language of the content. |
-**sections** | **list[str]** | The sections of the content. | [optional]
+**sections** | **List[str]** | The sections of the content. | [optional]
**summary** | **str** | The summary of the content. | [optional]
+## Example
+
+```python
+from lilt.models.lilt_create_content_template_params import LiltCreateContentTemplateParams
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LiltCreateContentTemplateParams from a JSON string
+lilt_create_content_template_params_instance = LiltCreateContentTemplateParams.from_json(json)
+# print the JSON string representation of the object
+print(LiltCreateContentTemplateParams.to_json())
+
+# convert the object into a dict
+lilt_create_content_template_params_dict = lilt_create_content_template_params_instance.to_dict()
+# create an instance of LiltCreateContentTemplateParams from a dict
+lilt_create_content_template_params_from_dict = LiltCreateContentTemplateParams.from_dict(lilt_create_content_template_params_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/MemoriesApi.md b/docs/MemoriesApi.md
index 407bdf5..2ebb21e 100644
--- a/docs/MemoriesApi.md
+++ b/docs/MemoriesApi.md
@@ -20,17 +20,30 @@ Method | HTTP request | Description
Create a Memory
-Create a new Memory. A Memory is a container that collects source/target sentences for a specific language pair (e.g., English>French). The data in the Memory is used to train the MT system, populate the TM, and update the lexicon. Memories are private to your account - the data is not shared across users - unless you explicitly share a Memory with your team (via web app only). Refer to our KB for a more detailed description.
+Create a new Memory. A Memory is a container that collects source/target
+sentences for a specific language pair (e.g., English>French). The data
+in the Memory is used to train the MT system, populate the TM, and
+update the lexicon. Memories are private to your account - the data is
+not shared across users - unless you explicitly share a Memory with your
+team (via web app only).
+
+Refer
+to our KB for a more detailed description.
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.memory import Memory
+from lilt.models.memory_create_parameters import MemoryCreateParameters
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -42,89 +55,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- body = lilt.MemoryCreateParameters() # MemoryCreateParameters |
-
- try:
- # Create a Memory
- api_response = api_instance.create_memory(body)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->create_memory: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.MemoriesApi(api_client)
- body = lilt.MemoryCreateParameters() # MemoryCreateParameters |
+ body = lilt.MemoryCreateParameters() # MemoryCreateParameters | The Memory resource to create.
try:
# Create a Memory
api_response = api_instance.create_memory(body)
+ print("The response of MemoriesApi->create_memory:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->create_memory: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**MemoryCreateParameters**](MemoryCreateParameters.md)| |
+ **body** | [**MemoryCreateParameters**](MemoryCreateParameters.md)| The Memory resource to create. |
### Return type
@@ -132,7 +97,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -140,6 +105,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A Memory object. | - |
@@ -153,17 +119,20 @@ Name | Type | Description | Notes
Delete a Memory
-Delete a Memory.
+Delete a Memory.
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.memory_delete_response import MemoryDeleteResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -175,69 +144,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- id = 56 # int | A unique Memory identifier.
-
- try:
- # Delete a Memory
- api_response = api_instance.delete_memory(id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->delete_memory: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -248,13 +165,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Delete a Memory
api_response = api_instance.delete_memory(id)
+ print("The response of MemoriesApi->delete_memory:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->delete_memory: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique Memory identifier. |
@@ -265,7 +186,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -273,6 +194,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A status object. | - |
@@ -286,17 +208,24 @@ Name | Type | Description | Notes
Delete a segment from a memory.
-Delete a segment from a memory. ```bash curl -X DELETE https://api.lilt.com/v2/memories/segment?key=API_KEY&id=ID&segment_id=$SEGMENT_ID ```
+Delete a segment from a memory.
+
+```bash
+ curl -X DELETE https://api.lilt.com/v2/memories/segment?key=API_KEY&id=ID&segment_id=$SEGMENT_ID
+```
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.delete_segment_from_memory_response import DeleteSegmentFromMemoryResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -308,88 +237,39 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- id = 56 # int | A unique Memory identifier.
-segment_id = 56 # int | A unique Segment identifier.
-
- try:
- # Delete a segment from a memory.
- api_response = api_instance.delete_segment_from_memory(id, segment_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->delete_segment_from_memory: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.MemoriesApi(api_client)
id = 56 # int | A unique Memory identifier.
-segment_id = 56 # int | A unique Segment identifier.
+ segment_id = 56 # int | A unique Segment identifier.
try:
# Delete a segment from a memory.
api_response = api_instance.delete_segment_from_memory(id, segment_id)
+ print("The response of MemoriesApi->delete_segment_from_memory:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->delete_segment_from_memory: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique Memory identifier. |
@@ -401,7 +281,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -409,6 +289,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A success resposne. | - |
@@ -418,21 +299,30 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **download_termbase**
-> str download_termbase(id)
+> bytearray download_termbase(id)
Termbase download for a Memory
-Downloads the termbase export for the given memory as a CSV file. Ensure you first call the `/2/memories/termbase/export` endpoint to start the export process before you try to download it. ```bash curl -X GET https://api.lilt.com/v2/memories/termbase/download?key=API_KEY&id=ID ```
+Downloads the termbase export for the given memory as a CSV file.
+
+Ensure you first call the `/2/memories/termbase/export` endpoint to
+start the export process before you try to download it.
+
+```bash
+ curl -X GET https://api.lilt.com/v2/memories/termbase/download?key=API_KEY&id=ID
+```
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -444,69 +334,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- id = 56 # int | A unique Memory identifier.
-
- try:
- # Termbase download for a Memory
- api_response = api_instance.download_termbase(id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->download_termbase: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -517,24 +355,28 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Termbase download for a Memory
api_response = api_instance.download_termbase(id)
+ print("The response of MemoriesApi->download_termbase:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->download_termbase: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique Memory identifier. |
### Return type
-**str**
+**bytearray**
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -542,6 +384,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A file. | - |
@@ -555,17 +398,29 @@ Name | Type | Description | Notes
Termbase export for a Memory
-Exports the termbase entries for the given memory into a CSV file. Calling this endpoint will begin the export process in the background. Check that the processing is complete by polling the `GET /2/memories` endpoint. When the `is_processing` value is 0 then call the `POST /2/memories/termbase/download` endpoint. ```bash curl -X POST https://api.lilt.com/v2/memories/termbase/export?key=API_KEY&id=ID ```
+Exports the termbase entries for the given memory into a CSV file.
+
+Calling this endpoint will begin the export process in the background.
+Check that the processing is complete by polling the `GET /2/memories`
+endpoint. When the `is_processing` value is 0 then call the
+`POST /2/memories/termbase/download` endpoint.
+
+```bash
+ curl -X POST https://api.lilt.com/v2/memories/termbase/export?key=API_KEY&id=ID
+```
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.termbase_export_response import TermbaseExportResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -577,69 +432,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- id = 56 # int | A unique Memory identifier.
-
- try:
- # Termbase export for a Memory
- api_response = api_instance.export_termbase(id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->export_termbase: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -650,13 +453,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Termbase export for a Memory
api_response = api_instance.export_termbase(id)
+ print("The response of MemoriesApi->export_termbase:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->export_termbase: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique Memory identifier. |
@@ -667,7 +474,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -675,6 +482,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A status object. | - |
@@ -684,21 +492,25 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_memory**
-> list[Memory] get_memory(id=id)
+> List[Memory] get_memory(id=id)
Retrieve a Memory
-Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory).
+Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory).
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.memory import Memory
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -710,69 +522,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- id = 56 # int | An optional Memory identifier. (optional)
-
- try:
- # Retrieve a Memory
- api_response = api_instance.get_memory(id=id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->get_memory: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -783,24 +543,28 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Retrieve a Memory
api_response = api_instance.get_memory(id=id)
+ print("The response of MemoriesApi->get_memory:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->get_memory: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| An optional Memory identifier. | [optional]
### Return type
-[**list[Memory]**](Memory.md)
+[**List[Memory]**](Memory.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -808,6 +572,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A list of Memory objects. | - |
@@ -822,70 +587,38 @@ Name | Type | Description | Notes
File import for a Memory
-Imports common translation memory or termbase file formats to a specific Lilt memory. Currently supported file formats are `*.tmx`, `*.sdltm`, `*.sdlxliff`(With custom Filters), '*.xliff', and `*.tmq` for TM data; `*.csv` and `*.tbx` for termbase data. Request parameters should be passed as JSON object with the header field `LILT-API`. Example CURL command to upload a translation memory file named `my_memory.sdltm` in the current working directory: ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdltm\\\",\\\"memory_id\\\": 42}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdltm ``` Example CURL command to upload a translation memory file named `my_memory.sdlxliff` in the current working directory, with Custom Filters based on SDLXLIFF fields, conf_name which maps to, percentage, and whether we should ignore unlocked segments. ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdlxliff\\\",\\\"memory_id\\\": 12,\\\"sdlxliff_filters\\\":[{\\\"conf_name\\\": \\\"Translated\\\", \\\"percentage\\\": 100, \\\"allow_unlocked\\\": false}]\"}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdlxliff ```
-
-### Example
+Imports common translation memory or termbase file formats to a specific Lilt memory. Currently supported file formats are `*.tmx`, `*.sdltm`, `*.sdlxliff`(With custom Filters), '*.xliff', and `*.tmq` for TM data; `*.csv` and `*.tbx` for termbase data. Request parameters should be passed as JSON object with the header field `LILT-API`.
-* Api Key Authentication (ApiKeyAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
+Example CURL command to upload a translation memory file named `my_memory.sdltm` in the current working directory:
+```bash
+ curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \
+ --header "LILT-API: {\"name\": \"my_memory.sdltm\",\"memory_id\": 42}" \
+ --header "Content-Type: application/octet-stream" \
+ --data-binary @my_memory.sdltm
+```
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+Example CURL command to upload a translation memory file named `my_memory.sdlxliff` in the current working directory, with Custom Filters based on SDLXLIFF fields, conf_name which maps to, percentage, and whether we should ignore unlocked segments.
+```bash
+ curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \
+ --header "LILT-API: {\"name\": \"my_memory.sdlxliff\",\"memory_id\": 12,\"sdlxliff_filters\":[{\"conf_name\": \"Translated\", \"percentage\": 100, \"allow_unlocked\": false}]"}" \
+ --header "Content-Type: application/octet-stream" \
+ --data-binary @my_memory.sdlxliff
+```
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- memory_id = 56 # int | A unique Memory identifier.
-name = 'name_example' # str | Name of the TM or termbase file.
-body = '/path/to/file' # file | The file contents to be uploaded. The entire POST body will be treated as the file.
-sdlxliff_filters = [lilt.SDLXLIFFFilter()] # list[SDLXLIFFFilter] | Contains Filter information Unique to SDLXLIFF (optional)
-has_header_row = True # bool | A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`). (optional)
-skip_duplicates = True # bool | A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`). (optional)
- try:
- # File import for a Memory
- api_response = api_instance.import_memory_file(memory_id, name, body, sdlxliff_filters=sdlxliff_filters, has_header_row=has_header_row, skip_duplicates=skip_duplicates)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->import_memory_file: %s\n" % e)
-```
+### Example
* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.memory_import_response import MemoryImportResponse
+from lilt.models.sdlxliff_filter import SDLXLIFFFilter
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -897,49 +630,49 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.MemoriesApi(api_client)
memory_id = 56 # int | A unique Memory identifier.
-name = 'name_example' # str | Name of the TM or termbase file.
-body = '/path/to/file' # file | The file contents to be uploaded. The entire POST body will be treated as the file.
-sdlxliff_filters = [lilt.SDLXLIFFFilter()] # list[SDLXLIFFFilter] | Contains Filter information Unique to SDLXLIFF (optional)
-has_header_row = True # bool | A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`). (optional)
-skip_duplicates = True # bool | A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`). (optional)
+ name = 'name_example' # str | Name of the TM or termbase file.
+ body = None # bytearray | The file contents to be uploaded. The entire POST body will be treated as the file.
+ sdlxliff_filters = [lilt.SDLXLIFFFilter()] # List[SDLXLIFFFilter] | Contains Filter information Unique to SDLXLIFF (optional)
+ has_header_row = True # bool | A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`). (optional)
+ skip_duplicates = True # bool | A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`). (optional)
try:
# File import for a Memory
api_response = api_instance.import_memory_file(memory_id, name, body, sdlxliff_filters=sdlxliff_filters, has_header_row=has_header_row, skip_duplicates=skip_duplicates)
+ print("The response of MemoriesApi->import_memory_file:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->import_memory_file: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**memory_id** | **int**| A unique Memory identifier. |
**name** | **str**| Name of the TM or termbase file. |
- **body** | **file**| The file contents to be uploaded. The entire POST body will be treated as the file. |
- **sdlxliff_filters** | [**list[SDLXLIFFFilter]**](SDLXLIFFFilter.md)| Contains Filter information Unique to SDLXLIFF | [optional]
+ **body** | **bytearray**| The file contents to be uploaded. The entire POST body will be treated as the file. |
+ **sdlxliff_filters** | [**List[SDLXLIFFFilter]**](SDLXLIFFFilter.md)| Contains Filter information Unique to SDLXLIFF | [optional]
**has_header_row** | **bool**| A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`). | [optional]
**skip_duplicates** | **bool**| A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`). | [optional]
@@ -949,7 +682,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -957,6 +690,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A status object. | - |
@@ -966,21 +700,24 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **query_memory**
-> list[TranslationMemoryEntry] query_memory(id, query, n=n)
+> List[TranslationMemoryEntry] query_memory(id, query, n=n)
Query a Memory
-Perform a translation memory query.
+Perform a translation memory query.
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.translation_memory_entry import TranslationMemoryEntry
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -992,90 +729,40 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- id = 56 # int | A unique Memory identifier.
-query = 'query_example' # str | A source query.
-n = 10 # int | Maximum number of results to return. (optional) (default to 10)
-
- try:
- # Query a Memory
- api_response = api_instance.query_memory(id, query, n=n)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->query_memory: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.MemoriesApi(api_client)
id = 56 # int | A unique Memory identifier.
-query = 'query_example' # str | A source query.
-n = 10 # int | Maximum number of results to return. (optional) (default to 10)
+ query = 'query_example' # str | A source query.
+ n = 10 # int | Maximum number of results to return. (optional) (default to 10)
try:
# Query a Memory
api_response = api_instance.query_memory(id, query, n=n)
+ print("The response of MemoriesApi->query_memory:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->query_memory: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique Memory identifier. |
@@ -1084,11 +771,11 @@ Name | Type | Description | Notes
### Return type
-[**list[TranslationMemoryEntry]**](TranslationMemoryEntry.md)
+[**List[TranslationMemoryEntry]**](TranslationMemoryEntry.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1096,6 +783,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A list of TranslationMemoryEntry objects. | - |
@@ -1109,17 +797,21 @@ Name | Type | Description | Notes
Update the name of a Memory
-Update a Memory.
+Update a Memory.
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.memory import Memory
+from lilt.models.memory_update_parameters import MemoryUpdateParameters
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -1131,89 +823,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.MemoriesApi(api_client)
- body = lilt.MemoryUpdateParameters() # MemoryUpdateParameters |
-
- try:
- # Update the name of a Memory
- api_response = api_instance.update_memory(body)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MemoriesApi->update_memory: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.MemoriesApi(api_client)
- body = lilt.MemoryUpdateParameters() # MemoryUpdateParameters |
+ body = lilt.MemoryUpdateParameters() # MemoryUpdateParameters | The Memory resource to update.
try:
# Update the name of a Memory
api_response = api_instance.update_memory(body)
+ print("The response of MemoriesApi->update_memory:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling MemoriesApi->update_memory: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**MemoryUpdateParameters**](MemoryUpdateParameters.md)| |
+ **body** | [**MemoryUpdateParameters**](MemoryUpdateParameters.md)| The Memory resource to update. |
### Return type
@@ -1221,7 +865,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -1229,6 +873,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A Memory object. | - |
diff --git a/docs/Memory.md b/docs/Memory.md
index 885fbab..c86aebd 100644
--- a/docs/Memory.md
+++ b/docs/Memory.md
@@ -1,7 +1,9 @@
# Memory
A Memory is a collection of parallel (source/target) segments from which a MT/TM model is trained. When a translator confirms a segment in the Interface, a parallel segment is added to the Memory. Parallel segments from existing translation memories and bitexts can also be added to the Memory via the REST API.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique number identifying the Memory. | [optional]
@@ -14,8 +16,25 @@ Name | Type | Description | Notes
**version** | **int** | The current version of the Memory, which is the number of updates since the memory was created. | [optional]
**created_at** | **int** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional]
**updated_at** | **int** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional]
-**resources** | **list[str]** | The resource files (translation memories and termbases) associated with this Memory. | [optional]
+**resources** | **List[str]** | The resource files (translation memories and termbases) associated with this Memory. | [optional]
+
+## Example
+
+```python
+from lilt.models.memory import Memory
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Memory from a JSON string
+memory_instance = Memory.from_json(json)
+# print the JSON string representation of the object
+print(Memory.to_json())
+# convert the object into a dict
+memory_dict = memory_instance.to_dict()
+# create an instance of Memory from a dict
+memory_from_dict = Memory.from_dict(memory_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/MemoryCreateParameters.md b/docs/MemoryCreateParameters.md
index 7448930..9ef4b54 100644
--- a/docs/MemoryCreateParameters.md
+++ b/docs/MemoryCreateParameters.md
@@ -1,6 +1,8 @@
# MemoryCreateParameters
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | A name for the Memory. |
@@ -9,6 +11,23 @@ Name | Type | Description | Notes
**srclocale** | **str** | An ISO 3166-1 region name for language locales | [optional]
**trglocale** | **str** | An ISO 3166-1 region name for language locales | [optional]
+## Example
+
+```python
+from lilt.models.memory_create_parameters import MemoryCreateParameters
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MemoryCreateParameters from a JSON string
+memory_create_parameters_instance = MemoryCreateParameters.from_json(json)
+# print the JSON string representation of the object
+print(MemoryCreateParameters.to_json())
+
+# convert the object into a dict
+memory_create_parameters_dict = memory_create_parameters_instance.to_dict()
+# create an instance of MemoryCreateParameters from a dict
+memory_create_parameters_from_dict = MemoryCreateParameters.from_dict(memory_create_parameters_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/MemoryDeleteResponse.md b/docs/MemoryDeleteResponse.md
index f97a507..e2e75bc 100644
--- a/docs/MemoryDeleteResponse.md
+++ b/docs/MemoryDeleteResponse.md
@@ -1,11 +1,30 @@
# MemoryDeleteResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique Memory identifier. | [optional]
**deleted** | **bool** | If the operation succeeded, then `true`. Otherwise, `false`. | [optional]
+## Example
+
+```python
+from lilt.models.memory_delete_response import MemoryDeleteResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MemoryDeleteResponse from a JSON string
+memory_delete_response_instance = MemoryDeleteResponse.from_json(json)
+# print the JSON string representation of the object
+print(MemoryDeleteResponse.to_json())
+
+# convert the object into a dict
+memory_delete_response_dict = memory_delete_response_instance.to_dict()
+# create an instance of MemoryDeleteResponse from a dict
+memory_delete_response_from_dict = MemoryDeleteResponse.from_dict(memory_delete_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/MemoryImportResponse.md b/docs/MemoryImportResponse.md
index 2129ce4..1fa9019 100644
--- a/docs/MemoryImportResponse.md
+++ b/docs/MemoryImportResponse.md
@@ -1,11 +1,30 @@
# MemoryImportResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique Memory identifier. | [optional]
**is_processing** | **int** | The current state of the import. | [optional]
+## Example
+
+```python
+from lilt.models.memory_import_response import MemoryImportResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MemoryImportResponse from a JSON string
+memory_import_response_instance = MemoryImportResponse.from_json(json)
+# print the JSON string representation of the object
+print(MemoryImportResponse.to_json())
+
+# convert the object into a dict
+memory_import_response_dict = memory_import_response_instance.to_dict()
+# create an instance of MemoryImportResponse from a dict
+memory_import_response_from_dict = MemoryImportResponse.from_dict(memory_import_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/MemoryUpdateParameters.md b/docs/MemoryUpdateParameters.md
index 16e3996..7b73e5e 100644
--- a/docs/MemoryUpdateParameters.md
+++ b/docs/MemoryUpdateParameters.md
@@ -1,11 +1,30 @@
# MemoryUpdateParameters
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique Memory identifier. |
**name** | **str** | The Memory name. |
+## Example
+
+```python
+from lilt.models.memory_update_parameters import MemoryUpdateParameters
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MemoryUpdateParameters from a JSON string
+memory_update_parameters_instance = MemoryUpdateParameters.from_json(json)
+# print the JSON string representation of the object
+print(MemoryUpdateParameters.to_json())
+
+# convert the object into a dict
+memory_update_parameters_dict = memory_update_parameters_instance.to_dict()
+# create an instance of MemoryUpdateParameters from a dict
+memory_update_parameters_from_dict = MemoryUpdateParameters.from_dict(memory_update_parameters_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/Model.md b/docs/Model.md
new file mode 100644
index 0000000..63990dc
--- /dev/null
+++ b/docs/Model.md
@@ -0,0 +1,36 @@
+# Model
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | The unique identifier for the model. | [optional]
+**name** | **str** | The name of the model. | [optional]
+**provider** | **str** | The provider of the model. | [optional]
+**status** | **str** | The status of the model. | [optional]
+**src_lang** | **str** | The source language of the model. | [optional]
+**trg_lang** | **str** | The target language of the model. | [optional]
+**src_locale** | **str** | The source locale of the model. | [optional]
+**trg_locale** | **str** | The target locale of the model. | [optional]
+
+## Example
+
+```python
+from lilt.models.model import Model
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Model from a JSON string
+model_instance = Model.from_json(json)
+# print the JSON string representation of the object
+print(Model.to_json())
+
+# convert the object into a dict
+model_dict = model_instance.to_dict()
+# create an instance of Model from a dict
+model_from_dict = Model.from_dict(model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/Project.md b/docs/Project.md
index 71e4f03..6feb3cc 100644
--- a/docs/Project.md
+++ b/docs/Project.md
@@ -1,7 +1,9 @@
# Project
A Project is a collection of zero or more Documents. It is specific to a language pair, and is associated with exactly one Memory for that language pair. The Memory association cannot be changed after the Project is created.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique number identifying the Project. | [optional]
@@ -15,13 +17,30 @@ Name | Type | Description | Notes
**state** | **str** | The project's state. The possible states are `backlog`, `inProgress`, `inReview`, `inQA`, and `done`. | [optional]
**due_date** | **int** | The due date. Measured in seconds since the Unix epoch. | [optional]
**archived** | **bool** | The archived state of the Project. | [optional]
-**metadata** | [**object**](.md) | A JSON object of key/value string pairs. Stores custom project information. | [optional]
+**metadata** | **object** | A JSON object of key/value string pairs. Stores custom project information. | [optional]
**sample_review_percentage** | **int** | The project's sample review percentage. | [optional]
**created_at** | **int** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional]
**updated_at** | **int** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional]
**workflow_status** | **str** | The status of the Workflow for the current project. This may not be present for all project endpoints even with workflows enabled. | [optional]
-**document** | [**list[DocumentWithoutSegments]**](DocumentWithoutSegments.md) | A list of Documents. | [optional]
+**document** | [**List[DocumentWithoutSegments]**](DocumentWithoutSegments.md) | A list of Documents. | [optional]
+
+## Example
+
+```python
+from lilt.models.project import Project
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Project from a JSON string
+project_instance = Project.from_json(json)
+# print the JSON string representation of the object
+print(Project.to_json())
+# convert the object into a dict
+project_dict = project_instance.to_dict()
+# create an instance of Project from a dict
+project_from_dict = Project.from_dict(project_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/ProjectCreateParameters.md b/docs/ProjectCreateParameters.md
index 4aacc9c..1189852 100644
--- a/docs/ProjectCreateParameters.md
+++ b/docs/ProjectCreateParameters.md
@@ -1,15 +1,44 @@
# ProjectCreateParameters
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | A name for the Project. |
**memory_id** | **int** | The Memory to associate with this new Project. |
**job_id** | **int** | The Job to associate with this new Project. If a Job ID is not provided then a new Job will be created to contain the Project. | [optional]
**due_date** | **int** | The due date. Measured in seconds since the Unix epoch. | [optional]
-**metadata** | [**object**](.md) | A JSON object of key/value string pairs. Stores custom project information. | [optional]
+**metadata** | **object** | A JSON object of key/value string pairs. Stores custom project information. | [optional]
**workflow_template_id** | **int** | The workflow template used to create this project. WorkflowTemplateIds can be retrieved via the /workflows/templates endpoint. If not specified then the organization default workflowTemplateId will be used. | [optional]
+**workflow_template_name** | **str** | Name of the workflow for the project, if a workflowTemplateId is passed, this field will be ignored. | [optional]
+**llm_provider** | **str** | The LLM provider to use for the project. Defaults to \"neural\". | [optional]
+**external_model_id** | **int** | External model ID, if any. Must match the chosen llm_provider. | [optional]
+**is_plural** | **bool** | Whether the documents in this project contain ICU plural forms. | [optional]
+**require_batch_qa_translator** | **bool** | Whether to require batch QA from the translator side. | [optional]
+**enable_prompt_labeling** | **bool** | Whether to enable prompt labeling for the project. | [optional]
+**job_type** | **str** | (Optional) A specialized job type for advanced features. | [optional]
+**additional_guidelines** | **str** | (Optional) Additional instructions or guidelines. | [optional]
+**is_enhanced_human_ai_optimized** | **bool** | Whether the project is enhanced with AI optimization. | [optional]
+**domain_id** | **int** | A domain ID to categorize this project under. | [optional]
+
+## Example
+
+```python
+from lilt.models.project_create_parameters import ProjectCreateParameters
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ProjectCreateParameters from a JSON string
+project_create_parameters_instance = ProjectCreateParameters.from_json(json)
+# print the JSON string representation of the object
+print(ProjectCreateParameters.to_json())
+# convert the object into a dict
+project_create_parameters_dict = project_create_parameters_instance.to_dict()
+# create an instance of ProjectCreateParameters from a dict
+project_create_parameters_from_dict = ProjectCreateParameters.from_dict(project_create_parameters_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/ProjectDeleteResponse.md b/docs/ProjectDeleteResponse.md
index 46a750f..16d7b19 100644
--- a/docs/ProjectDeleteResponse.md
+++ b/docs/ProjectDeleteResponse.md
@@ -1,11 +1,30 @@
# ProjectDeleteResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique Project identifier. | [optional]
**deleted** | **bool** | If the operation succeeded, then `true`. Otherwise, `false`. | [optional]
+## Example
+
+```python
+from lilt.models.project_delete_response import ProjectDeleteResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ProjectDeleteResponse from a JSON string
+project_delete_response_instance = ProjectDeleteResponse.from_json(json)
+# print the JSON string representation of the object
+print(ProjectDeleteResponse.to_json())
+
+# convert the object into a dict
+project_delete_response_dict = project_delete_response_instance.to_dict()
+# create an instance of ProjectDeleteResponse from a dict
+project_delete_response_from_dict = ProjectDeleteResponse.from_dict(project_delete_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/ProjectStats.md b/docs/ProjectStats.md
index 0e3b4c4..182422c 100644
--- a/docs/ProjectStats.md
+++ b/docs/ProjectStats.md
@@ -1,6 +1,8 @@
# ProjectStats
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | |
@@ -9,6 +11,23 @@ Name | Type | Description | Notes
**fuzzy_words** | **int** | |
**new_words** | **int** | |
+## Example
+
+```python
+from lilt.models.project_stats import ProjectStats
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ProjectStats from a JSON string
+project_stats_instance = ProjectStats.from_json(json)
+# print the JSON string representation of the object
+print(ProjectStats.to_json())
+
+# convert the object into a dict
+project_stats_dict = project_stats_instance.to_dict()
+# create an instance of ProjectStats from a dict
+project_stats_from_dict = ProjectStats.from_dict(project_stats_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/ProjectsApi.md b/docs/ProjectsApi.md
index 2f089ec..50454d3 100644
--- a/docs/ProjectsApi.md
+++ b/docs/ProjectsApi.md
@@ -14,65 +14,26 @@ Method | HTTP request | Description
Create a Project
-Create a Project. A Project is a collection of Documents. A Project is associated with exactly one Memory. Projects appear in the dashboard of the web app.
+Create a Project. A Project is a collection of Documents.
-### Example
+A Project is associated with exactly one Memory.
-* Api Key Authentication (ApiKeyAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+Projects appear in the dashboard of the web app.
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.ProjectsApi(api_client)
- body = lilt.ProjectCreateParameters() # ProjectCreateParameters |
- try:
- # Create a Project
- api_response = api_instance.create_project(body)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling ProjectsApi->create_project: %s\n" % e)
-```
+### Example
* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.project import Project
+from lilt.models.project_create_parameters import ProjectCreateParameters
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -84,41 +45,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.ProjectsApi(api_client)
- body = lilt.ProjectCreateParameters() # ProjectCreateParameters |
+ body = lilt.ProjectCreateParameters() # ProjectCreateParameters | The Project resource to create.
try:
# Create a Project
api_response = api_instance.create_project(body)
+ print("The response of ProjectsApi->create_project:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling ProjectsApi->create_project: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**ProjectCreateParameters**](ProjectCreateParameters.md)| |
+ **body** | [**ProjectCreateParameters**](ProjectCreateParameters.md)| The Project resource to create. |
### Return type
@@ -126,7 +87,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -134,6 +95,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A Project object. | - |
@@ -147,17 +109,20 @@ Name | Type | Description | Notes
Delete a Project
-Delete a Project.
+Delete a Project.
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.project_delete_response import ProjectDeleteResponse
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -169,69 +134,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.ProjectsApi(api_client)
- id = 56 # int | A unique Project identifier. (optional)
-
- try:
- # Delete a Project
- api_response = api_instance.delete_project(id=id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling ProjectsApi->delete_project: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -242,13 +155,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Delete a Project
api_response = api_instance.delete_project(id=id)
+ print("The response of ProjectsApi->delete_project:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling ProjectsApi->delete_project: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique Project identifier. | [optional]
@@ -259,7 +176,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -267,6 +184,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A status object. | - |
@@ -276,21 +194,25 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_projects**
-> list[Project] get_projects(id=id, srclang=srclang, trglang=trglang, from_time=from_time, to_time=to_time, state=state, archived=archived, connector_id=connector_id)
+> List[Project] get_projects(id=id, srclang=srclang, trglang=trglang, from_time=from_time, to_time=to_time, state=state, archived=archived, connector_id=connector_id)
Retrieve a Project
-Retrieves one or more projects, including the documents associated with each project. Retrieving a project is the most efficient way to retrieve a single project, multiple projects or a list of all available projects. To retrieve a specific project, specify the `id` request parameter or you can retrieve multiple projects by adding comma (,) between ids eg. `?id=1234,5678`. To retrieve all projects, omit the `id` request parameter. To limit the retrieved projects to those with a particular source language or target language, specify the corresponding ISO 639-1 language codes in the `srclang` and `trglang` request parameters, respectively.
+Retrieves one or more projects, including the documents associated with each project. Retrieving a project is the most efficient way to retrieve a single project, multiple projects or a list of all available projects.
+
+To retrieve a specific project, specify the `id` request parameter or you can retrieve multiple projects by adding comma (,) between ids eg. `?id=1234,5678`. To retrieve all projects, omit the `id` request parameter. To limit the retrieved projects to those with a particular source language or target language, specify the corresponding ISO 639-1 language codes in the `srclang` and `trglang` request parameters, respectively.
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.project import Project
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -302,100 +224,45 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.ProjectsApi(api_client)
- id = 56 # int | A unique Project identifier. It can be a single id or multiple ids separated by a comma (optional)
-srclang = 'srclang_example' # str | An ISO 639-1 language code. (optional)
-trglang = 'trglang_example' # str | An ISO 639-1 language code. (optional)
-from_time = 56 # int | Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value. (optional)
-to_time = 56 # int | Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value. (optional)
-state = 'state_example' # str | A project state (backlog, inProgress, inReview, inQA, done). (optional)
-archived = True # bool | A flag that toggles whether to include archived projects in the response (the default is `true`). (optional)
-connector_id = 56 # int | A unique Connector identifier. (optional)
-
- try:
- # Retrieve a Project
- api_response = api_instance.get_projects(id=id, srclang=srclang, trglang=trglang, from_time=from_time, to_time=to_time, state=state, archived=archived, connector_id=connector_id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling ProjectsApi->get_projects: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.ProjectsApi(api_client)
id = 56 # int | A unique Project identifier. It can be a single id or multiple ids separated by a comma (optional)
-srclang = 'srclang_example' # str | An ISO 639-1 language code. (optional)
-trglang = 'trglang_example' # str | An ISO 639-1 language code. (optional)
-from_time = 56 # int | Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value. (optional)
-to_time = 56 # int | Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value. (optional)
-state = 'state_example' # str | A project state (backlog, inProgress, inReview, inQA, done). (optional)
-archived = True # bool | A flag that toggles whether to include archived projects in the response (the default is `true`). (optional)
-connector_id = 56 # int | A unique Connector identifier. (optional)
+ srclang = 'srclang_example' # str | An ISO 639-1 language code. (optional)
+ trglang = 'trglang_example' # str | An ISO 639-1 language code. (optional)
+ from_time = 56 # int | Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value. (optional)
+ to_time = 56 # int | Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value. (optional)
+ state = 'state_example' # str | A project state (backlog, inProgress, inReview, inQA, done). (optional)
+ archived = True # bool | A flag that toggles whether to include archived projects in the response (the default is `true`). (optional)
+ connector_id = 56 # int | A unique Connector identifier. (optional)
try:
# Retrieve a Project
api_response = api_instance.get_projects(id=id, srclang=srclang, trglang=trglang, from_time=from_time, to_time=to_time, state=state, archived=archived, connector_id=connector_id)
+ print("The response of ProjectsApi->get_projects:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling ProjectsApi->get_projects: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| A unique Project identifier. It can be a single id or multiple ids separated by a comma | [optional]
@@ -409,11 +276,11 @@ Name | Type | Description | Notes
### Return type
-[**list[Project]**](Project.md)
+[**List[Project]**](Project.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -421,6 +288,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A list of Project objects. | - |
diff --git a/docs/SDLXLIFFFilter.md b/docs/SDLXLIFFFilter.md
index 20bc2d3..720c305 100644
--- a/docs/SDLXLIFFFilter.md
+++ b/docs/SDLXLIFFFilter.md
@@ -1,12 +1,31 @@
# SDLXLIFFFilter
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**conf_name** | **str** | the current state of the SDLXLIFF Trans Unit. |
**allowable_percentage** | **int** | This represents for the current conf_name what percentage the filter applies to. If you pass -1 it will take any value for this field and won't ignore blank values. If you pass 50, Lilt will only import Segments that have a 50 percent match or better. | [optional]
**allow_unlocked_segments** | **bool** | Boolean that tells Lilt whether we should allow unlocked Segments for this conf_name. | [optional]
+## Example
+
+```python
+from lilt.models.sdlxliff_filter import SDLXLIFFFilter
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SDLXLIFFFilter from a JSON string
+sdlxliff_filter_instance = SDLXLIFFFilter.from_json(json)
+# print the JSON string representation of the object
+print(SDLXLIFFFilter.to_json())
+
+# convert the object into a dict
+sdlxliff_filter_dict = sdlxliff_filter_instance.to_dict()
+# create an instance of SDLXLIFFFilter from a dict
+sdlxliff_filter_from_dict = SDLXLIFFFilter.from_dict(sdlxliff_filter_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/Segment.md b/docs/Segment.md
index 9b45f9c..b0f3386 100644
--- a/docs/Segment.md
+++ b/docs/Segment.md
@@ -1,7 +1,9 @@
# Segment
A Segment is a source string and, optionally, its translation. A Segment can be associated with both a Memory and a Document. The Segment object contains additional metadata about the source and target strings.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique number identifying the Segment. | [optional]
@@ -16,6 +18,23 @@ Name | Type | Description | Notes
**is_confirmed** | **bool** | The confirmation status. | [optional]
**is_reviewed** | **bool** | The review status. | [optional]
+## Example
+
+```python
+from lilt.models.segment import Segment
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Segment from a JSON string
+segment_instance = Segment.from_json(json)
+# print the JSON string representation of the object
+print(Segment.to_json())
+
+# convert the object into a dict
+segment_dict = segment_instance.to_dict()
+# create an instance of Segment from a dict
+segment_from_dict = Segment.from_dict(segment_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/SignLiltCreateTermsResponse.md b/docs/SignLiltCreateTermsResponse.md
index bdd1239..06cad0b 100644
--- a/docs/SignLiltCreateTermsResponse.md
+++ b/docs/SignLiltCreateTermsResponse.md
@@ -1,10 +1,29 @@
# SignLiltCreateTermsResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**signed_agreement** | **bool** | Whether or not the agreement has been signed. | [optional]
+## Example
+
+```python
+from lilt.models.sign_lilt_create_terms_response import SignLiltCreateTermsResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SignLiltCreateTermsResponse from a JSON string
+sign_lilt_create_terms_response_instance = SignLiltCreateTermsResponse.from_json(json)
+# print the JSON string representation of the object
+print(SignLiltCreateTermsResponse.to_json())
+
+# convert the object into a dict
+sign_lilt_create_terms_response_dict = sign_lilt_create_terms_response_instance.to_dict()
+# create an instance of SignLiltCreateTermsResponse from a dict
+sign_lilt_create_terms_response_from_dict = SignLiltCreateTermsResponse.from_dict(sign_lilt_create_terms_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/SourceFile.md b/docs/SourceFile.md
index 14c205d..3f3287d 100644
--- a/docs/SourceFile.md
+++ b/docs/SourceFile.md
@@ -1,7 +1,9 @@
# SourceFile
A SourceFile is an unprocessed source file that can later be added to a project.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique number identifying the SourceFile. | [optional]
@@ -10,10 +12,27 @@ Name | Type | Description | Notes
**detected_lang** | **str** | Language associated with the file. | [optional]
**detected_lang_confidence** | **float** | Confidence score for the language associated with the file. | [optional]
**category** | **str** | The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material. | [optional]
-**labels** | **list[str]** | The list of labels associated with the file. | [optional]
+**labels** | **List[str]** | The list of labels associated with the file. | [optional]
**created_at** | **datetime** | Time at which the object was created. | [optional]
**updated_at** | **datetime** | Time at which the object was created. | [optional]
+## Example
+
+```python
+from lilt.models.source_file import SourceFile
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SourceFile from a JSON string
+source_file_instance = SourceFile.from_json(json)
+# print the JSON string representation of the object
+print(SourceFile.to_json())
+
+# convert the object into a dict
+source_file_dict = source_file_instance.to_dict()
+# create an instance of SourceFile from a dict
+source_file_from_dict = SourceFile.from_dict(source_file_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/TermbaseExportResponse.md b/docs/TermbaseExportResponse.md
index 92fe22e..f481228 100644
--- a/docs/TermbaseExportResponse.md
+++ b/docs/TermbaseExportResponse.md
@@ -1,11 +1,30 @@
# TermbaseExportResponse
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | A unique Memory identifier. | [optional]
**is_processing** | **int** | The current state of the import. | [optional]
+## Example
+
+```python
+from lilt.models.termbase_export_response import TermbaseExportResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TermbaseExportResponse from a JSON string
+termbase_export_response_instance = TermbaseExportResponse.from_json(json)
+# print the JSON string representation of the object
+print(TermbaseExportResponse.to_json())
+
+# convert the object into a dict
+termbase_export_response_dict = termbase_export_response_instance.to_dict()
+# create an instance of TermbaseExportResponse from a dict
+termbase_export_response_from_dict = TermbaseExportResponse.from_dict(termbase_export_response_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/TranslateApi.md b/docs/TranslateApi.md
index 46f92d7..0209bf6 100644
--- a/docs/TranslateApi.md
+++ b/docs/TranslateApi.md
@@ -11,21 +11,30 @@ Method | HTTP request | Description
# **batch_translate_file**
-> list[TranslationInfo] batch_translate_file(file_id, memory_id, config_id=config_id, with_tm=with_tm)
+> List[TranslationInfo] batch_translate_file(file_id, memory_id, config_id=config_id, with_tm=with_tm)
Translate a File
-Start machine translation of one or more Files that have previously been uploaded. The response will include an `id` parameter that can be used to monitor and download the translations in subsequent calls. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/translate/file?key=API_KEY&fileId=583&memoryId=2495&configId=123&withTM=true' ```
+Start machine translation of one or more Files that have previously been uploaded. The response will include an `id` parameter that can be used to monitor and download the translations in subsequent calls.
+
+Example CURL:
+```bash
+curl -X POST 'https://api.lilt.com/v2/translate/file?key=API_KEY&fileId=583&memoryId=2495&configId=123&withTM=true'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.translation_info import TranslationInfo
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -37,92 +46,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.TranslateApi(api_client)
- file_id = 'file_id_example' # str | List of File ids to be translated, comma separated.
-memory_id = 'memory_id_example' # str | Id of Memory to use in translation.
-config_id = 3.4 # float | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. (optional)
-with_tm = True # bool | An optional boolean parameter to toggle the use of Translation Memory in the translation of the file. (optional)
-
- try:
- # Translate a File
- api_response = api_instance.batch_translate_file(file_id, memory_id, config_id=config_id, with_tm=with_tm)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling TranslateApi->batch_translate_file: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.TranslateApi(api_client)
file_id = 'file_id_example' # str | List of File ids to be translated, comma separated.
-memory_id = 'memory_id_example' # str | Id of Memory to use in translation.
-config_id = 3.4 # float | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. (optional)
-with_tm = True # bool | An optional boolean parameter to toggle the use of Translation Memory in the translation of the file. (optional)
+ memory_id = 'memory_id_example' # str | Id of Memory to use in translation.
+ config_id = 3.4 # float | An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. (optional)
+ with_tm = True # bool | An optional boolean parameter to toggle the use of Translation Memory in the translation of the file. (optional)
try:
# Translate a File
api_response = api_instance.batch_translate_file(file_id, memory_id, config_id=config_id, with_tm=with_tm)
+ print("The response of TranslateApi->batch_translate_file:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling TranslateApi->batch_translate_file: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**file_id** | **str**| List of File ids to be translated, comma separated. |
@@ -132,11 +90,11 @@ Name | Type | Description | Notes
### Return type
-[**list[TranslationInfo]**](TranslationInfo.md)
+[**List[TranslationInfo]**](TranslationInfo.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -144,6 +102,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Translation Info | - |
@@ -153,21 +112,29 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **download_file**
-> str download_file(id)
+> bytearray download_file(id)
Download translated file
-Download a translated File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/files?key=API_KEY&id=1' ```
+Download a translated File.
+
+Example CURL:
+```bash
+curl -X GET 'https://api.lilt.com/v2/translate/files?key=API_KEY&id=1'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -179,69 +146,17 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.TranslateApi(api_client)
- id = 'id_example' # str | A translation id.
-
- try:
- # Download translated file
- api_response = api_instance.download_file(id)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling TranslateApi->download_file: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
-
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
@@ -252,24 +167,28 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Download translated file
api_response = api_instance.download_file(id)
+ print("The response of TranslateApi->download_file:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling TranslateApi->download_file: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| A translation id. |
### Return type
-**str**
+**bytearray**
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -277,6 +196,7 @@ Name | Type | Description | Notes
- **Accept**: application/octet-stream, text/plain, application/json
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A file. | - |
@@ -286,21 +206,30 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **monitor_file_translation**
-> list[TranslationInfo] monitor_file_translation(translation_ids=translation_ids, status=status, from_time=from_time, to_time=to_time)
+> List[TranslationInfo] monitor_file_translation(translation_ids=translation_ids, status=status, from_time=from_time, to_time=to_time)
Monitor file translation
-Get information about the one or more Files that are being translated with machine translation. Query filters are optional but at least one must be provided. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/file?key=API_KEY&translationIds=1,2&fromTime=1607966744&toTime=1707966744&status=InProgress' ```
+Get information about the one or more Files that are being translated with machine translation. Query filters are optional but at least one must be provided.
+
+Example CURL:
+```bash
+curl -X GET 'https://api.lilt.com/v2/translate/file?key=API_KEY&translationIds=1,2&fromTime=1607966744&toTime=1707966744&status=InProgress'
+```
+
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.translation_info import TranslationInfo
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -312,92 +241,41 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.TranslateApi(api_client)
- translation_ids = 'translation_ids_example' # str | List of translation ids, comma separated (optional)
-status = 'status_example' # str | One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload` (optional)
-from_time = 3.4 # float | Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch. (optional)
-to_time = 3.4 # float | Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch. (optional)
-
- try:
- # Monitor file translation
- api_response = api_instance.monitor_file_translation(translation_ids=translation_ids, status=status, from_time=from_time, to_time=to_time)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling TranslateApi->monitor_file_translation: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.TranslateApi(api_client)
translation_ids = 'translation_ids_example' # str | List of translation ids, comma separated (optional)
-status = 'status_example' # str | One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload` (optional)
-from_time = 3.4 # float | Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch. (optional)
-to_time = 3.4 # float | Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch. (optional)
+ status = 'status_example' # str | One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload` (optional)
+ from_time = 3.4 # float | Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch. (optional)
+ to_time = 3.4 # float | Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch. (optional)
try:
# Monitor file translation
api_response = api_instance.monitor_file_translation(translation_ids=translation_ids, status=status, from_time=from_time, to_time=to_time)
+ print("The response of TranslateApi->monitor_file_translation:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling TranslateApi->monitor_file_translation: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**translation_ids** | **str**| List of translation ids, comma separated | [optional]
@@ -407,11 +285,11 @@ Name | Type | Description | Notes
### Return type
-[**list[TranslationInfo]**](TranslationInfo.md)
+[**List[TranslationInfo]**](TranslationInfo.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -419,6 +297,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Translation Info | - |
@@ -432,65 +311,35 @@ Name | Type | Description | Notes
Translate a segment
-Translate a source string. Setting the `rich` parameter to `true` will change the response format to include additional information about each translation including a model score, word alignments, and formatting information. The rich format can be seen in the example response on this page. By default, this endpoint also returns translation memory (TM) fuzzy matches, along with associated scores. Fuzzy matches always appear ahead of machine translation output in the response. The maximum source length is 5,000 characters. Usage charges apply to this endpoint for production REST API keys.
+Translate a source string.
-### Example
+Setting the `rich` parameter to `true` will change the response format
+to include additional information about each translation including a
+model score, word alignments, and formatting information. The rich
+format can be seen in the example response on this page.
-* Api Key Authentication (ApiKeyAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
-)
+By default, this endpoint also returns translation memory (TM) fuzzy matches, along
+with associated scores. Fuzzy matches always appear ahead of machine translation
+output in the response.
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
+The maximum source length is 5,000 characters.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+Usage charges apply to this endpoint for production REST API keys.
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.TranslateApi(api_client)
- body = lilt.TranslateSegmentBody() # TranslateSegmentBody | (optional)
- try:
- # Translate a segment
- api_response = api_instance.translate_segment_post(body=body)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling TranslateApi->translate_segment_post: %s\n" % e)
-```
+### Example
* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.translate_segment_body import TranslateSegmentBody
+from lilt.models.translation_list import TranslationList
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -502,22 +351,18 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
@@ -527,13 +372,17 @@ with lilt.ApiClient(configuration) as api_client:
try:
# Translate a segment
api_response = api_instance.translate_segment_post(body=body)
+ print("The response of TranslateApi->translate_segment_post:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling TranslateApi->translate_segment_post: %s\n" % e)
```
+
+
### Parameters
+
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**TranslateSegmentBody**](TranslateSegmentBody.md)| | [optional]
@@ -544,7 +393,7 @@ Name | Type | Description | Notes
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -552,6 +401,7 @@ Name | Type | Description | Notes
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A TranslationList object. | - |
diff --git a/docs/TranslateSegmentBody.md b/docs/TranslateSegmentBody.md
index 86e6a6f..d8c0dde 100644
--- a/docs/TranslateSegmentBody.md
+++ b/docs/TranslateSegmentBody.md
@@ -1,6 +1,8 @@
# TranslateSegmentBody
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**source** | **str** | A unique Segment identifier. | [optional]
@@ -13,6 +15,23 @@ Name | Type | Description | Notes
**project_tags** | **bool** | Project tags. Projects tags in source to target if set to true. | [optional] [default to False]
**contains_icu_data** | **bool** | Contains ICU data. If true then tags in the source following the ICU standard will be parsed and retained. | [optional] [default to False]
+## Example
+
+```python
+from lilt.models.translate_segment_body import TranslateSegmentBody
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TranslateSegmentBody from a JSON string
+translate_segment_body_instance = TranslateSegmentBody.from_json(json)
+# print the JSON string representation of the object
+print(TranslateSegmentBody.to_json())
+
+# convert the object into a dict
+translate_segment_body_dict = translate_segment_body_instance.to_dict()
+# create an instance of TranslateSegmentBody from a dict
+translate_segment_body_from_dict = TranslateSegmentBody.from_dict(translate_segment_body_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/Translation.md b/docs/Translation.md
index 2b000d6..ddcb546 100644
--- a/docs/Translation.md
+++ b/docs/Translation.md
@@ -1,7 +1,9 @@
# Translation
A machine translation (MT) or a translation memory (TM) match of a source segment.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**target** | **str** | The target string. | [optional]
@@ -10,9 +12,26 @@ Name | Type | Description | Notes
**provenance** | **str** | Positive values indicate that the word is from the Memory, with contiguous identical entries (e.g., 2 2) indicating phrase matches. Negative contiguous values indicate entries from the Lexicon. 0 indicates a word from the background data. | [optional]
**score** | **float** | The score of the translation. | [optional]
**is_tm_match** | **bool** | TM only: If true, indicates an exact translation memory match. | [optional]
-**target_delimiters** | **list[str]** | A format string that indicates, for each word, if the word should be preceded by a space. | [optional]
-**target_words** | **list[str]** | The target string can be constructed by suffixing each `targetDelimiters` entry with its corresponding word in `targetWords` and concatenating the constructed array. Please note that the `targetDelimiters` array has one more entry than `targetWords` array which is why the last entry in the array will be the last value of `targetDelimiters`. | [optional]
+**target_delimiters** | **List[str]** | A format string that indicates, for each word, if the word should be preceded by a space. | [optional]
+**target_words** | **List[str]** | The target string can be constructed by suffixing each `targetDelimiters` entry with its corresponding word in `targetWords` and concatenating the constructed array. Please note that the `targetDelimiters` array has one more entry than `targetWords` array which is why the last entry in the array will be the last value of `targetDelimiters`. | [optional]
+
+## Example
+
+```python
+from lilt.models.translation import Translation
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Translation from a JSON string
+translation_instance = Translation.from_json(json)
+# print the JSON string representation of the object
+print(Translation.to_json())
+# convert the object into a dict
+translation_dict = translation_instance.to_dict()
+# create an instance of Translation from a dict
+translation_from_dict = Translation.from_dict(translation_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/TranslationInfo.md b/docs/TranslationInfo.md
index 445d42f..733d378 100644
--- a/docs/TranslationInfo.md
+++ b/docs/TranslationInfo.md
@@ -1,7 +1,9 @@
# TranslationInfo
Information describing a batch translation process.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | Unique identifier for this translation. | [optional]
@@ -10,6 +12,23 @@ Name | Type | Description | Notes
**created_at** | **int** | Time when this translation was started, in seconds since the Unix epoch. | [optional]
**error_msg** | **str** | Error message, present when status is `Failed`. | [optional]
+## Example
+
+```python
+from lilt.models.translation_info import TranslationInfo
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TranslationInfo from a JSON string
+translation_info_instance = TranslationInfo.from_json(json)
+# print the JSON string representation of the object
+print(TranslationInfo.to_json())
+
+# convert the object into a dict
+translation_info_dict = translation_info_instance.to_dict()
+# create an instance of TranslationInfo from a dict
+translation_info_from_dict = TranslationInfo.from_dict(translation_info_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/TranslationList.md b/docs/TranslationList.md
index 7e5e9e5..165877e 100644
--- a/docs/TranslationList.md
+++ b/docs/TranslationList.md
@@ -1,14 +1,33 @@
# TranslationList
An ranked list of translations and associated metadata.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**untokenized_source** | **str** | The untokenized source segment. Punctuation has not been separated from words. | [optional]
**tokenized_source** | **str** | The tokenized source segment. Punctuation has been separated from words. | [optional]
-**source_delimiters** | **list[str]** | A format string that indicates, for each word, if the word should be preceded by a space. | [optional]
-**translation** | [**list[Translation]**](Translation.md) | A list of Translation objects. | [optional]
+**source_delimiters** | **List[str]** | A format string that indicates, for each word, if the word should be preceded by a space. | [optional]
+**translation** | [**List[Translation]**](Translation.md) | A list of Translation objects. | [optional]
+
+## Example
+
+```python
+from lilt.models.translation_list import TranslationList
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TranslationList from a JSON string
+translation_list_instance = TranslationList.from_json(json)
+# print the JSON string representation of the object
+print(TranslationList.to_json())
+# convert the object into a dict
+translation_list_dict = translation_list_instance.to_dict()
+# create an instance of TranslationList from a dict
+translation_list_from_dict = TranslationList.from_dict(translation_list_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/TranslationMemoryEntry.md b/docs/TranslationMemoryEntry.md
index 74a860e..b624152 100644
--- a/docs/TranslationMemoryEntry.md
+++ b/docs/TranslationMemoryEntry.md
@@ -1,14 +1,33 @@
# TranslationMemoryEntry
A translation memory entry.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**source** | **str** | The source string. | [optional]
**target** | **str** | The target string. Tags will be automatically placed according to the query string. | [optional]
**score** | **int** | The fuzzy match score. | [optional]
-**metadata** | [**object**](.md) | Attributes describing the translation memory entry. | [optional]
+**metadata** | **object** | Attributes describing the translation memory entry. | [optional]
+
+## Example
+
+```python
+from lilt.models.translation_memory_entry import TranslationMemoryEntry
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TranslationMemoryEntry from a JSON string
+translation_memory_entry_instance = TranslationMemoryEntry.from_json(json)
+# print the JSON string representation of the object
+print(TranslationMemoryEntry.to_json())
+# convert the object into a dict
+translation_memory_entry_dict = translation_memory_entry_instance.to_dict()
+# create an instance of TranslationMemoryEntry from a dict
+translation_memory_entry_from_dict = TranslationMemoryEntry.from_dict(translation_memory_entry_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/WebhookConfigurationApi.md b/docs/WebhookConfigurationApi.md
new file mode 100644
index 0000000..f8e4e75
--- /dev/null
+++ b/docs/WebhookConfigurationApi.md
@@ -0,0 +1,450 @@
+# lilt.WebhookConfigurationApi
+
+All URIs are relative to *https://api.lilt.com*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**services_configuration_api_webhooks_delete**](WebhookConfigurationApi.md#services_configuration_api_webhooks_delete) | **DELETE** /v3/connectors/configuration/webhooks/{id} | Delete a specific Webhook Configuration by ID.
+[**webhooks_create**](WebhookConfigurationApi.md#webhooks_create) | **POST** /v3/connectors/configuration/webhooks | Creates a new Webhook Configuration
+[**webhooks_get**](WebhookConfigurationApi.md#webhooks_get) | **GET** /v3/connectors/configuration/webhooks/{id} | Retrieve a specific Webhook Configuration by ID.
+[**webhooks_get_many**](WebhookConfigurationApi.md#webhooks_get_many) | **GET** /v3/connectors/configuration/webhooks | Retrieve a list of Webhook Configurations.
+[**webhooks_update**](WebhookConfigurationApi.md#webhooks_update) | **PUT** /v3/connectors/configuration/webhooks/{id} | Update a specific Webhook Configuration by ID.
+
+
+# **services_configuration_api_webhooks_delete**
+> services_configuration_api_webhooks_delete(id)
+
+Delete a specific Webhook Configuration by ID.
+
+### Example
+
+* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
+```python
+import lilt
+from lilt.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to https://api.lilt.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = lilt.Configuration(
+ host = "https://api.lilt.com"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: BasicAuth
+configuration = lilt.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with lilt.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = lilt.WebhookConfigurationApi(api_client)
+ id = 12345 # int | The Webhook Configuration ID.
+
+ try:
+ # Delete a specific Webhook Configuration by ID.
+ api_instance.services_configuration_api_webhooks_delete(id)
+ except Exception as e:
+ print("Exception when calling WebhookConfigurationApi->services_configuration_api_webhooks_delete: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **int**| The Webhook Configuration ID. |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Upon success a response with an empty body is returned. | - |
+**0** | Unexpected error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **webhooks_create**
+> WebhookResponse webhooks_create(create_webhook_options)
+
+Creates a new Webhook Configuration
+
+Creates a new webhook configuration for your LILT organization.
+
+
+### Example
+
+* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
+```python
+import lilt
+from lilt.models.create_webhook_options import CreateWebhookOptions
+from lilt.models.webhook_response import WebhookResponse
+from lilt.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to https://api.lilt.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = lilt.Configuration(
+ host = "https://api.lilt.com"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: BasicAuth
+configuration = lilt.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with lilt.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = lilt.WebhookConfigurationApi(api_client)
+ create_webhook_options = lilt.CreateWebhookOptions() # CreateWebhookOptions |
+
+ try:
+ # Creates a new Webhook Configuration
+ api_response = api_instance.webhooks_create(create_webhook_options)
+ print("The response of WebhookConfigurationApi->webhooks_create:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling WebhookConfigurationApi->webhooks_create: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **create_webhook_options** | [**CreateWebhookOptions**](CreateWebhookOptions.md)| |
+
+### Return type
+
+[**WebhookResponse**](WebhookResponse.md)
+
+### Authorization
+
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Returns the newly created webhook configuration. | - |
+**0** | Unexpected error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **webhooks_get**
+> WebhookResponse webhooks_get(id)
+
+Retrieve a specific Webhook Configuration by ID.
+
+Retrieves a specific webhook configuration by its ID.
+Deleted webhook configurations are not returned.
+
+
+### Example
+
+* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
+```python
+import lilt
+from lilt.models.webhook_response import WebhookResponse
+from lilt.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to https://api.lilt.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = lilt.Configuration(
+ host = "https://api.lilt.com"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: BasicAuth
+configuration = lilt.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with lilt.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = lilt.WebhookConfigurationApi(api_client)
+ id = 12345 # int | The Webhook Configuration ID.
+
+ try:
+ # Retrieve a specific Webhook Configuration by ID.
+ api_response = api_instance.webhooks_get(id)
+ print("The response of WebhookConfigurationApi->webhooks_get:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling WebhookConfigurationApi->webhooks_get: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **int**| The Webhook Configuration ID. |
+
+### Return type
+
+[**WebhookResponse**](WebhookResponse.md)
+
+### Authorization
+
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Returns the webhook configuration. | - |
+**0** | Unexpected error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **webhooks_get_many**
+> List[WebhookResponse] webhooks_get_many()
+
+Retrieve a list of Webhook Configurations.
+
+Retrieves a list of webhook configurations available to your LILT organization.
+Use this to manage your webhook configurations.
+
+
+### Example
+
+* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
+```python
+import lilt
+from lilt.models.webhook_response import WebhookResponse
+from lilt.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to https://api.lilt.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = lilt.Configuration(
+ host = "https://api.lilt.com"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: BasicAuth
+configuration = lilt.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with lilt.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = lilt.WebhookConfigurationApi(api_client)
+
+ try:
+ # Retrieve a list of Webhook Configurations.
+ api_response = api_instance.webhooks_get_many()
+ print("The response of WebhookConfigurationApi->webhooks_get_many:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling WebhookConfigurationApi->webhooks_get_many: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List[WebhookResponse]**](WebhookResponse.md)
+
+### Authorization
+
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | The webhook configurations response. | - |
+**0** | Unexpected error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **webhooks_update**
+> WebhookResponse webhooks_update(id, webhooks_update_request)
+
+Update a specific Webhook Configuration by ID.
+
+Updates a specific webhook configuration by its ID.
+Only the fields that are provided in the request body will be updated.
+
+
+### Example
+
+* Basic Authentication (BasicAuth):
+* Api Key Authentication (ApiKeyAuth):
+
+```python
+import lilt
+from lilt.models.webhook_response import WebhookResponse
+from lilt.models.webhooks_update_request import WebhooksUpdateRequest
+from lilt.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to https://api.lilt.com
+# See configuration.py for a list of all supported configuration parameters.
+configuration = lilt.Configuration(
+ host = "https://api.lilt.com"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: BasicAuth
+configuration = lilt.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Configure API key authorization: ApiKeyAuth
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with lilt.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = lilt.WebhookConfigurationApi(api_client)
+ id = 12345 # int | The Webhook Configuration ID.
+ webhooks_update_request = lilt.WebhooksUpdateRequest() # WebhooksUpdateRequest |
+
+ try:
+ # Update a specific Webhook Configuration by ID.
+ api_response = api_instance.webhooks_update(id, webhooks_update_request)
+ print("The response of WebhookConfigurationApi->webhooks_update:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling WebhookConfigurationApi->webhooks_update: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **int**| The Webhook Configuration ID. |
+ **webhooks_update_request** | [**WebhooksUpdateRequest**](WebhooksUpdateRequest.md)| |
+
+### Return type
+
+[**WebhookResponse**](WebhookResponse.md)
+
+### Authorization
+
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Returns the updated webhook configuration. | - |
+**0** | Unexpected error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/WebhookResponse.md b/docs/WebhookResponse.md
new file mode 100644
index 0000000..83bf242
--- /dev/null
+++ b/docs/WebhookResponse.md
@@ -0,0 +1,32 @@
+# WebhookResponse
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | The unique identifier for the webhook configuration. |
+**webhook_name** | **str** | The name of the webhook configuration. |
+**webhook_url** | **str** | The URL to which the webhook notifications will be sent. |
+**event_type** | **List[str]** | The list of event types that will trigger the webhook notification. |
+
+## Example
+
+```python
+from lilt.models.webhook_response import WebhookResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WebhookResponse from a JSON string
+webhook_response_instance = WebhookResponse.from_json(json)
+# print the JSON string representation of the object
+print(WebhookResponse.to_json())
+
+# convert the object into a dict
+webhook_response_dict = webhook_response_instance.to_dict()
+# create an instance of WebhookResponse from a dict
+webhook_response_from_dict = WebhookResponse.from_dict(webhook_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/WebhooksUpdateRequest.md b/docs/WebhooksUpdateRequest.md
new file mode 100644
index 0000000..cab41e6
--- /dev/null
+++ b/docs/WebhooksUpdateRequest.md
@@ -0,0 +1,31 @@
+# WebhooksUpdateRequest
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**webhook_name** | **str** | The name of the webhook configuration. |
+**webhook_url** | **str** | The URL to which the webhook notifications will be sent. |
+**event_type** | **List[str]** | The list of event types that will trigger the webhook notification. |
+
+## Example
+
+```python
+from lilt.models.webhooks_update_request import WebhooksUpdateRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WebhooksUpdateRequest from a JSON string
+webhooks_update_request_instance = WebhooksUpdateRequest.from_json(json)
+# print the JSON string representation of the object
+print(WebhooksUpdateRequest.to_json())
+
+# convert the object into a dict
+webhooks_update_request_dict = webhooks_update_request_instance.to_dict()
+# create an instance of WebhooksUpdateRequest from a dict
+webhooks_update_request_from_dict = WebhooksUpdateRequest.from_dict(webhooks_update_request_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/WebhooksUpdateRequestAnyOf.md b/docs/WebhooksUpdateRequestAnyOf.md
new file mode 100644
index 0000000..1059855
--- /dev/null
+++ b/docs/WebhooksUpdateRequestAnyOf.md
@@ -0,0 +1,29 @@
+# WebhooksUpdateRequestAnyOf
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**webhook_name** | **str** | The name of the webhook configuration. |
+
+## Example
+
+```python
+from lilt.models.webhooks_update_request_any_of import WebhooksUpdateRequestAnyOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WebhooksUpdateRequestAnyOf from a JSON string
+webhooks_update_request_any_of_instance = WebhooksUpdateRequestAnyOf.from_json(json)
+# print the JSON string representation of the object
+print(WebhooksUpdateRequestAnyOf.to_json())
+
+# convert the object into a dict
+webhooks_update_request_any_of_dict = webhooks_update_request_any_of_instance.to_dict()
+# create an instance of WebhooksUpdateRequestAnyOf from a dict
+webhooks_update_request_any_of_from_dict = WebhooksUpdateRequestAnyOf.from_dict(webhooks_update_request_any_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/WebhooksUpdateRequestAnyOf1.md b/docs/WebhooksUpdateRequestAnyOf1.md
new file mode 100644
index 0000000..357aa42
--- /dev/null
+++ b/docs/WebhooksUpdateRequestAnyOf1.md
@@ -0,0 +1,29 @@
+# WebhooksUpdateRequestAnyOf1
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**webhook_url** | **str** | The URL to which the webhook notifications will be sent. |
+
+## Example
+
+```python
+from lilt.models.webhooks_update_request_any_of1 import WebhooksUpdateRequestAnyOf1
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WebhooksUpdateRequestAnyOf1 from a JSON string
+webhooks_update_request_any_of1_instance = WebhooksUpdateRequestAnyOf1.from_json(json)
+# print the JSON string representation of the object
+print(WebhooksUpdateRequestAnyOf1.to_json())
+
+# convert the object into a dict
+webhooks_update_request_any_of1_dict = webhooks_update_request_any_of1_instance.to_dict()
+# create an instance of WebhooksUpdateRequestAnyOf1 from a dict
+webhooks_update_request_any_of1_from_dict = WebhooksUpdateRequestAnyOf1.from_dict(webhooks_update_request_any_of1_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/WebhooksUpdateRequestAnyOf2.md b/docs/WebhooksUpdateRequestAnyOf2.md
new file mode 100644
index 0000000..06e48bf
--- /dev/null
+++ b/docs/WebhooksUpdateRequestAnyOf2.md
@@ -0,0 +1,29 @@
+# WebhooksUpdateRequestAnyOf2
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **List[str]** | The list of event types that will trigger the webhook notification. |
+
+## Example
+
+```python
+from lilt.models.webhooks_update_request_any_of2 import WebhooksUpdateRequestAnyOf2
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WebhooksUpdateRequestAnyOf2 from a JSON string
+webhooks_update_request_any_of2_instance = WebhooksUpdateRequestAnyOf2.from_json(json)
+# print the JSON string representation of the object
+print(WebhooksUpdateRequestAnyOf2.to_json())
+
+# convert the object into a dict
+webhooks_update_request_any_of2_dict = webhooks_update_request_any_of2_instance.to_dict()
+# create an instance of WebhooksUpdateRequestAnyOf2 from a dict
+webhooks_update_request_any_of2_from_dict = WebhooksUpdateRequestAnyOf2.from_dict(webhooks_update_request_any_of2_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/WorkflowStageAssignment.md b/docs/WorkflowStageAssignment.md
index 1f60740..12d82bf 100644
--- a/docs/WorkflowStageAssignment.md
+++ b/docs/WorkflowStageAssignment.md
@@ -1,13 +1,32 @@
# WorkflowStageAssignment
An assignment object that associates a user to a workflow stage template.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**workflow_stage_template_id** | **int** | |
**user_id** | **int** | | [optional]
**email** | **str** | | [optional]
+## Example
+
+```python
+from lilt.models.workflow_stage_assignment import WorkflowStageAssignment
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WorkflowStageAssignment from a JSON string
+workflow_stage_assignment_instance = WorkflowStageAssignment.from_json(json)
+# print the JSON string representation of the object
+print(WorkflowStageAssignment.to_json())
+
+# convert the object into a dict
+workflow_stage_assignment_dict = workflow_stage_assignment_instance.to_dict()
+# create an instance of WorkflowStageAssignment from a dict
+workflow_stage_assignment_from_dict = WorkflowStageAssignment.from_dict(workflow_stage_assignment_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/WorkflowStageTemplate.md b/docs/WorkflowStageTemplate.md
index be9a90b..5717321 100644
--- a/docs/WorkflowStageTemplate.md
+++ b/docs/WorkflowStageTemplate.md
@@ -1,12 +1,31 @@
# WorkflowStageTemplate
A single stage within a Workflow Template.
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | The human readable name of a Workflow stage. | [optional]
**assignment_type** | **str** | An enum to represent all possible types of Workflow stage. | [optional]
+## Example
+
+```python
+from lilt.models.workflow_stage_template import WorkflowStageTemplate
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WorkflowStageTemplate from a JSON string
+workflow_stage_template_instance = WorkflowStageTemplate.from_json(json)
+# print the JSON string representation of the object
+print(WorkflowStageTemplate.to_json())
+
+# convert the object into a dict
+workflow_stage_template_dict = workflow_stage_template_instance.to_dict()
+# create an instance of WorkflowStageTemplate from a dict
+workflow_stage_template_from_dict = WorkflowStageTemplate.from_dict(workflow_stage_template_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/WorkflowTemplate.md b/docs/WorkflowTemplate.md
index e9e204d..ef43715 100644
--- a/docs/WorkflowTemplate.md
+++ b/docs/WorkflowTemplate.md
@@ -1,14 +1,33 @@
# WorkflowTemplate
A workflow template which defines the workflow's possible steps (combination of Translation, Review and Customer Review).
+
## Properties
+
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **float** | Identifier of a teams Workflow template. Can be used during Job creation for specifying the workflow used for a job or language pair. | [optional]
**name** | **str** | | [optional]
**team_id** | **float** | The name of a given Workflow template. | [optional]
-**stages** | [**list[WorkflowStageTemplate]**](WorkflowStageTemplate.md) | The stages in this workflow template. | [optional]
+**stages** | [**List[WorkflowStageTemplate]**](WorkflowStageTemplate.md) | The stages in this workflow template. | [optional]
+
+## Example
+
+```python
+from lilt.models.workflow_template import WorkflowTemplate
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WorkflowTemplate from a JSON string
+workflow_template_instance = WorkflowTemplate.from_json(json)
+# print the JSON string representation of the object
+print(WorkflowTemplate.to_json())
+# convert the object into a dict
+workflow_template_dict = workflow_template_instance.to_dict()
+# create an instance of WorkflowTemplate from a dict
+workflow_template_from_dict = WorkflowTemplate.from_dict(workflow_template_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/docs/WorkflowsApi.md b/docs/WorkflowsApi.md
index 7381a1b..0641f03 100644
--- a/docs/WorkflowsApi.md
+++ b/docs/WorkflowsApi.md
@@ -8,21 +8,26 @@ Method | HTTP request | Description
# **get_workflow_templates**
-> list[WorkflowTemplate] get_workflow_templates()
+> List[WorkflowTemplate] get_workflow_templates()
Retrieve workflow templates
-Get all of the possible Workflow Templates owned by the team. Useful for retrieving the ids corresponding to each workflow tables, and passing them to subsequent requests, for example, creating a new Job with a specific Workflow. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/workflows/templates?key=API_KEY' ```
+Get all of the possible Workflow Templates owned by the team. Useful for retrieving the ids corresponding to each workflow tables, and passing them to subsequent requests, for example, creating a new Job with a specific Workflow.
+Example CURL:
+```bash curl -X GET 'https://api.lilt.com/v2/workflows/templates?key=API_KEY' ```
+
### Example
+* Basic Authentication (BasicAuth):
* Api Key Authentication (ApiKeyAuth):
+
```python
-from __future__ import print_function
-import time
import lilt
+from lilt.models.workflow_template import WorkflowTemplate
from lilt.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.lilt.com
# See configuration.py for a list of all supported configuration parameters.
configuration = lilt.Configuration(
@@ -34,92 +39,45 @@ configuration = lilt.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
-# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
-
# Configure HTTP basic authorization: BasicAuth
configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
-
-# Enter a context with an instance of the API client
-with lilt.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = lilt.WorkflowsApi(api_client)
-
- try:
- # Retrieve workflow templates
- api_response = api_instance.get_workflow_templates()
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling WorkflowsApi->get_workflow_templates: %s\n" % e)
-```
-
-* Basic Authentication (BasicAuth):
-```python
-from __future__ import print_function
-import time
-import lilt
-from lilt.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://api.lilt.com
-# See configuration.py for a list of all supported configuration parameters.
-configuration = lilt.Configuration(
- host = "https://api.lilt.com"
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
)
-# The client must configure the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
-
# Configure API key authorization: ApiKeyAuth
-configuration = lilt.Configuration(
- host = "https://api.lilt.com",
- api_key = {
- 'key': 'YOUR_API_KEY'
- }
-)
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['key'] = 'Bearer'
+configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
-# Configure HTTP basic authorization: BasicAuth
-configuration = lilt.Configuration(
- username = 'YOUR_USERNAME',
- password = 'YOUR_PASSWORD'
-)
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with lilt.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lilt.WorkflowsApi(api_client)
-
+
try:
# Retrieve workflow templates
api_response = api_instance.get_workflow_templates()
+ print("The response of WorkflowsApi->get_workflow_templates:\n")
pprint(api_response)
- except ApiException as e:
+ except Exception as e:
print("Exception when calling WorkflowsApi->get_workflow_templates: %s\n" % e)
```
+
+
### Parameters
+
This endpoint does not need any parameter.
### Return type
-[**list[WorkflowTemplate]**](WorkflowTemplate.md)
+[**List[WorkflowTemplate]**](WorkflowTemplate.md)
### Authorization
-[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth)
+[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
@@ -127,6 +85,7 @@ This endpoint does not need any parameter.
- **Accept**: application/json, application/octet-stream, text/plain
### HTTP response details
+
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | An array with a team's available WorkflowTemplates. | - |
diff --git a/git_push.sh b/git_push.sh
index 1d69f9a..58915f0 100644
--- a/git_push.sh
+++ b/git_push.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
-# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
@@ -38,14 +38,14 @@ git add .
git commit -m "$release_note"
# Sets the new remote
-git_remote=`git remote`
+git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
- git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
@@ -55,4 +55,3 @@ git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
-
diff --git a/lilt/__init__.py b/lilt/__init__.py
index e55c1cc..edbeac1 100644
--- a/lilt/__init__.py
+++ b/lilt/__init__.py
@@ -5,47 +5,58 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
-__version__ = "3.0.0"
+__version__ = "v3.0.2"
# import apis into sdk package
from lilt.api.create_api import CreateApi
from lilt.api.documents_api import DocumentsApi
+from lilt.api.domains_api import DomainsApi
from lilt.api.files_api import FilesApi
from lilt.api.jobs_api import JobsApi
from lilt.api.languages_api import LanguagesApi
from lilt.api.memories_api import MemoriesApi
from lilt.api.projects_api import ProjectsApi
from lilt.api.translate_api import TranslateApi
+from lilt.api.webhook_configuration_api import WebhookConfigurationApi
from lilt.api.workflows_api import WorkflowsApi
# import ApiClient
+from lilt.api_response import ApiResponse
from lilt.api_client import ApiClient
from lilt.configuration import Configuration
from lilt.exceptions import OpenApiException
from lilt.exceptions import ApiTypeError
from lilt.exceptions import ApiValueError
from lilt.exceptions import ApiKeyError
+from lilt.exceptions import ApiAttributeError
from lilt.exceptions import ApiException
+
# import models into sdk package
from lilt.models.add_file_label_request import AddFileLabelRequest
from lilt.models.create_converter_config_parameters import CreateConverterConfigParameters
+from lilt.models.create_webhook_options import CreateWebhookOptions
+from lilt.models.delete_lilt_create_content200_response import DeleteLiltCreateContent200Response
from lilt.models.delete_segment_from_memory_response import DeleteSegmentFromMemoryResponse
from lilt.models.document_with_segments import DocumentWithSegments
from lilt.models.document_without_segments import DocumentWithoutSegments
from lilt.models.document_without_segments_status import DocumentWithoutSegmentsStatus
+from lilt.models.domain import Domain
+from lilt.models.domain_list import DomainList
+from lilt.models.domain_metadata import DomainMetadata
+from lilt.models.domain_reference import DomainReference
from lilt.models.error import Error
from lilt.models.file_delete_response import FileDeleteResponse
+from lilt.models.filter_config import FilterConfig
from lilt.models.get_lilt_create_content_response import GetLiltCreateContentResponse
-from lilt.models.inline_response200 import InlineResponse200
from lilt.models.job import Job
from lilt.models.job_create_parameters import JobCreateParameters
from lilt.models.job_delete_response import JobDeleteResponse
@@ -64,6 +75,7 @@
from lilt.models.memory_delete_response import MemoryDeleteResponse
from lilt.models.memory_import_response import MemoryImportResponse
from lilt.models.memory_update_parameters import MemoryUpdateParameters
+from lilt.models.model import Model
from lilt.models.project import Project
from lilt.models.project_create_parameters import ProjectCreateParameters
from lilt.models.project_delete_response import ProjectDeleteResponse
@@ -78,7 +90,11 @@
from lilt.models.translation_info import TranslationInfo
from lilt.models.translation_list import TranslationList
from lilt.models.translation_memory_entry import TranslationMemoryEntry
+from lilt.models.webhook_response import WebhookResponse
+from lilt.models.webhooks_update_request import WebhooksUpdateRequest
+from lilt.models.webhooks_update_request_any_of import WebhooksUpdateRequestAnyOf
+from lilt.models.webhooks_update_request_any_of1 import WebhooksUpdateRequestAnyOf1
+from lilt.models.webhooks_update_request_any_of2 import WebhooksUpdateRequestAnyOf2
from lilt.models.workflow_stage_assignment import WorkflowStageAssignment
from lilt.models.workflow_stage_template import WorkflowStageTemplate
from lilt.models.workflow_template import WorkflowTemplate
-
diff --git a/lilt/api/__init__.py b/lilt/api/__init__.py
index 600d121..e682ea2 100644
--- a/lilt/api/__init__.py
+++ b/lilt/api/__init__.py
@@ -1,14 +1,15 @@
-from __future__ import absolute_import
-
# flake8: noqa
# import apis into api package
from lilt.api.create_api import CreateApi
from lilt.api.documents_api import DocumentsApi
+from lilt.api.domains_api import DomainsApi
from lilt.api.files_api import FilesApi
from lilt.api.jobs_api import JobsApi
from lilt.api.languages_api import LanguagesApi
from lilt.api.memories_api import MemoriesApi
from lilt.api.projects_api import ProjectsApi
from lilt.api.translate_api import TranslateApi
+from lilt.api.webhook_configuration_api import WebhookConfigurationApi
from lilt.api.workflows_api import WorkflowsApi
+
diff --git a/lilt/api/create_api.py b/lilt/api/create_api.py
index 00e2826..3787883 100644
--- a/lilt/api/create_api.py
+++ b/lilt/api/create_api.py
@@ -3,1060 +3,2482 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-from __future__ import absolute_import
+ Do not edit the class manually.
+""" # noqa: E501
-import re # noqa: F401
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
-# python 2 and python 3 compatibility library
-import six
+from pydantic import Field, StrictInt
+from typing import Optional
+from typing_extensions import Annotated
+from lilt.models.create_converter_config_parameters import CreateConverterConfigParameters
+from lilt.models.delete_lilt_create_content200_response import DeleteLiltCreateContent200Response
+from lilt.models.get_lilt_create_content_response import GetLiltCreateContentResponse
+from lilt.models.lilt_create_content import LiltCreateContent
+from lilt.models.lilt_create_content_request import LiltCreateContentRequest
+from lilt.models.sign_lilt_create_terms_response import SignLiltCreateTermsResponse
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
-class CreateApi(object):
+class CreateApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def delete_lilt_create_content(self, content_id, **kwargs): # noqa: E501
- """Delete Lilt Create content # noqa: E501
-
- Delete a piece of Lilt Create content. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/create/1234?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_lilt_create_content(content_id, async_req=True)
- >>> result = thread.get()
- :param async_req bool: execute request asynchronously
- :param int content_id: The content ID. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ @validate_call
+ def delete_lilt_create_content(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> DeleteLiltCreateContent200Response:
+ """Delete Lilt Create content
+
+ Delete a piece of Lilt Create content. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/create/1234?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: InlineResponse200
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_lilt_create_content_with_http_info(content_id, **kwargs) # noqa: E501
-
- def delete_lilt_create_content_with_http_info(self, content_id, **kwargs): # noqa: E501
- """Delete Lilt Create content # noqa: E501
-
- Delete a piece of Lilt Create content. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/create/1234?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_lilt_create_content_with_http_info(content_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int content_id: The content ID. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_lilt_create_content_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DeleteLiltCreateContent200Response",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_lilt_create_content_with_http_info(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[DeleteLiltCreateContent200Response]:
+ """Delete Lilt Create content
+
+ Delete a piece of Lilt Create content. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/create/1234?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(InlineResponse200, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_lilt_create_content_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DeleteLiltCreateContent200Response",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'content_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def delete_lilt_create_content_without_preload_content(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete Lilt Create content
+
+ Delete a piece of Lilt Create content. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/create/1234?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_lilt_create_content_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_lilt_create_content" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'content_id' is set
- if self.api_client.client_side_validation and ('content_id' not in local_var_params or # noqa: E501
- local_var_params['content_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `content_id` when calling `delete_lilt_create_content`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'content_id' in local_var_params:
- path_params['contentId'] = local_var_params['content_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create/{contentId}', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='InlineResponse200', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def generate_lilt_create_content(self, template_params, **kwargs): # noqa: E501
- """Generate new Lilt Create content # noqa: E501
-
- Generate new Lilt Create content with the given parameters. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"language\":\"en-US\", \"template\":\"blog-post\", \"templateParams\":{ \"contentLength\":\"100\", \"language\":\"en-US\", \"sections\":[], \"summary\":\"a blog post about hiking\" }, \"preferences\":{\"tone\":\"formal\",\"styleguide\":\"\"} }' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.generate_lilt_create_content(template_params, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param LiltCreateContentRequest template_params: Input parameters that determine what content will be generated. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DeleteLiltCreateContent200Response",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_lilt_create_content_serialize(
+ self,
+ content_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if content_id is not None:
+ _path_params['contentId'] = content_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/v2/create/{contentId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def generate_lilt_create_content(
+ self,
+ template_params: Annotated[LiltCreateContentRequest, Field(description="Input parameters that determine what content will be generated. ")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Generate new Lilt Create content
+
+ Generate new Lilt Create content with the given parameters. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"language\":\"en-US\", \"template\":\"blog-post\", \"templateParams\":{ \"contentLength\":\"100\", \"language\":\"en-US\", \"sections\":[], \"summary\":\"a blog post about hiking\" }, \"preferences\":{\"tone\":\"formal\",\"styleguide\":\"\"} }' ```
+
+ :param template_params: Input parameters that determine what content will be generated. (required)
+ :type template_params: LiltCreateContentRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.generate_lilt_create_content_with_http_info(template_params, **kwargs) # noqa: E501
-
- def generate_lilt_create_content_with_http_info(self, template_params, **kwargs): # noqa: E501
- """Generate new Lilt Create content # noqa: E501
-
- Generate new Lilt Create content with the given parameters. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"language\":\"en-US\", \"template\":\"blog-post\", \"templateParams\":{ \"contentLength\":\"100\", \"language\":\"en-US\", \"sections\":[], \"summary\":\"a blog post about hiking\" }, \"preferences\":{\"tone\":\"formal\",\"styleguide\":\"\"} }' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.generate_lilt_create_content_with_http_info(template_params, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param LiltCreateContentRequest template_params: Input parameters that determine what content will be generated. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._generate_lilt_create_content_serialize(
+ template_params=template_params,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def generate_lilt_create_content_with_http_info(
+ self,
+ template_params: Annotated[LiltCreateContentRequest, Field(description="Input parameters that determine what content will be generated. ")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Generate new Lilt Create content
+
+ Generate new Lilt Create content with the given parameters. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"language\":\"en-US\", \"template\":\"blog-post\", \"templateParams\":{ \"contentLength\":\"100\", \"language\":\"en-US\", \"sections\":[], \"summary\":\"a blog post about hiking\" }, \"preferences\":{\"tone\":\"formal\",\"styleguide\":\"\"} }' ```
+
+ :param template_params: Input parameters that determine what content will be generated. (required)
+ :type template_params: LiltCreateContentRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._generate_lilt_create_content_serialize(
+ template_params=template_params,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- local_var_params = locals()
- all_params = [
- 'template_params'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ @validate_call
+ def generate_lilt_create_content_without_preload_content(
+ self,
+ template_params: Annotated[LiltCreateContentRequest, Field(description="Input parameters that determine what content will be generated. ")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Generate new Lilt Create content
+
+ Generate new Lilt Create content with the given parameters. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"language\":\"en-US\", \"template\":\"blog-post\", \"templateParams\":{ \"contentLength\":\"100\", \"language\":\"en-US\", \"sections\":[], \"summary\":\"a blog post about hiking\" }, \"preferences\":{\"tone\":\"formal\",\"styleguide\":\"\"} }' ```
+
+ :param template_params: Input parameters that determine what content will be generated. (required)
+ :type template_params: LiltCreateContentRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._generate_lilt_create_content_serialize(
+ template_params=template_params,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method generate_lilt_create_content" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _generate_lilt_create_content_serialize(
+ self,
+ template_params,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if template_params is not None:
+ _body_params = template_params
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'template_params' is set
- if self.api_client.client_side_validation and ('template_params' not in local_var_params or # noqa: E501
- local_var_params['template_params'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `template_params` when calling `generate_lilt_create_content`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'template_params' in local_var_params:
- body_params = local_var_params['template_params']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type=None, # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def get_lilt_create_by_id(self, content_id, **kwargs): # noqa: E501
- """Get Lilt Create content by ID. # noqa: E501
-
- Get Lilt Create content by ID. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_lilt_create_by_id(content_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int content_id: The content ID. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/create',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_lilt_create_by_id(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> LiltCreateContent:
+ """Get Lilt Create content by ID.
+
+ Get Lilt Create content by ID. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: LiltCreateContent
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_lilt_create_by_id_with_http_info(content_id, **kwargs) # noqa: E501
-
- def get_lilt_create_by_id_with_http_info(self, content_id, **kwargs): # noqa: E501
- """Get Lilt Create content by ID. # noqa: E501
-
- Get Lilt Create content by ID. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_lilt_create_by_id_with_http_info(content_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int content_id: The content ID. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_by_id_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LiltCreateContent",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_lilt_create_by_id_with_http_info(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[LiltCreateContent]:
+ """Get Lilt Create content by ID.
+
+ Get Lilt Create content by ID. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(LiltCreateContent, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_by_id_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LiltCreateContent",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'content_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def get_lilt_create_by_id_without_preload_content(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Get Lilt Create content by ID.
+
+ Get Lilt Create content by ID. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_by_id_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_lilt_create_by_id" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'content_id' is set
- if self.api_client.client_side_validation and ('content_id' not in local_var_params or # noqa: E501
- local_var_params['content_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `content_id` when calling `get_lilt_create_by_id`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'content_id' in local_var_params:
- path_params['contentId'] = local_var_params['content_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create/{contentId}', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='LiltCreateContent', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def get_lilt_create_content(self, **kwargs): # noqa: E501
- """Get Lilt Create content # noqa: E501
-
- Get a list of all content that has been generated by Lilt Create. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_lilt_create_content(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LiltCreateContent",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_lilt_create_by_id_serialize(
+ self,
+ content_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if content_id is not None:
+ _path_params['contentId'] = content_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/create/{contentId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_lilt_create_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> GetLiltCreateContentResponse:
+ """Get Lilt Create content
+
+ Get a list of all content that has been generated by Lilt Create. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create?key=API_KEY' ```
+
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: GetLiltCreateContentResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_lilt_create_content_with_http_info(**kwargs) # noqa: E501
-
- def get_lilt_create_content_with_http_info(self, **kwargs): # noqa: E501
- """Get Lilt Create content # noqa: E501
-
- Get a list of all content that has been generated by Lilt Create. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_lilt_create_content_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_content_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "GetLiltCreateContentResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_lilt_create_content_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[GetLiltCreateContentResponse]:
+ """Get Lilt Create content
+
+ Get a list of all content that has been generated by Lilt Create. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create?key=API_KEY' ```
+
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(GetLiltCreateContentResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_content_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "GetLiltCreateContentResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def get_lilt_create_content_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Get Lilt Create content
+
+ Get a list of all content that has been generated by Lilt Create. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create?key=API_KEY' ```
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_content_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_lilt_create_content" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='GetLiltCreateContentResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def get_lilt_create_preferences(self, **kwargs): # noqa: E501
- """Get Lilt Create preferences # noqa: E501
-
- Get the stored preferences for Lilt Create. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/preferences?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_lilt_create_preferences(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "GetLiltCreateContentResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_lilt_create_content_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/create',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_lilt_create_preferences(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Get Lilt Create preferences
+
+ Get the stored preferences for Lilt Create. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/preferences?key=API_KEY' ```
+
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_lilt_create_preferences_with_http_info(**kwargs) # noqa: E501
-
- def get_lilt_create_preferences_with_http_info(self, **kwargs): # noqa: E501
- """Get Lilt Create preferences # noqa: E501
-
- Get the stored preferences for Lilt Create. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/preferences?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_lilt_create_preferences_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_preferences_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_lilt_create_preferences_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Get Lilt Create preferences
+
+ Get the stored preferences for Lilt Create. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/preferences?key=API_KEY' ```
+
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_preferences_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def get_lilt_create_preferences_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Get Lilt Create preferences
+
+ Get the stored preferences for Lilt Create. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/preferences?key=API_KEY' ```
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_lilt_create_preferences_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_lilt_create_preferences" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create/preferences', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type=None, # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def regenerate_lilt_create_content(self, content_id, **kwargs): # noqa: E501
- """Regenerate Lilt Create content # noqa: E501
-
- Regenerate the given piece of content with the current parameters. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234/create?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.regenerate_lilt_create_content(content_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int content_id: The content ID. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_lilt_create_preferences_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/create/preferences',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def regenerate_lilt_create_content(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Regenerate Lilt Create content
+
+ Regenerate the given piece of content with the current parameters. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234/create?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.regenerate_lilt_create_content_with_http_info(content_id, **kwargs) # noqa: E501
-
- def regenerate_lilt_create_content_with_http_info(self, content_id, **kwargs): # noqa: E501
- """Regenerate Lilt Create content # noqa: E501
-
- Regenerate the given piece of content with the current parameters. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234/create?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.regenerate_lilt_create_content_with_http_info(content_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int content_id: The content ID. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._regenerate_lilt_create_content_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def regenerate_lilt_create_content_with_http_info(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Regenerate Lilt Create content
+
+ Regenerate the given piece of content with the current parameters. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234/create?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._regenerate_lilt_create_content_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'content_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def regenerate_lilt_create_content_without_preload_content(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Regenerate Lilt Create content
+
+ Regenerate the given piece of content with the current parameters. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/create/1234/create?key=API_KEY' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._regenerate_lilt_create_content_serialize(
+ content_id=content_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method regenerate_lilt_create_content" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'content_id' is set
- if self.api_client.client_side_validation and ('content_id' not in local_var_params or # noqa: E501
- local_var_params['content_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `content_id` when calling `regenerate_lilt_create_content`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'content_id' in local_var_params:
- path_params['contentId'] = local_var_params['content_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create/{contentId}/create', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type=None, # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def sign_lilt_create_terms(self, signed_agreement, **kwargs): # noqa: E501
- """Sign the Lilt Create terms and conditions # noqa: E501
-
- Lilt Create requires that the terms and conditions are signed first before using it. The terms and conditions can be signed by using this endpoint. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/terms-and-conditions?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"signedAgreement\": true}' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.sign_lilt_create_terms(signed_agreement, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param CreateConverterConfigParameters signed_agreement: (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _regenerate_lilt_create_content_serialize(
+ self,
+ content_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if content_id is not None:
+ _path_params['contentId'] = content_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/create/{contentId}/create',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def sign_lilt_create_terms(
+ self,
+ signed_agreement: Annotated[CreateConverterConfigParameters, Field(description="Whether or not to sign the agreement.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> SignLiltCreateTermsResponse:
+ """Sign the Lilt Create terms and conditions
+
+ Lilt Create requires that the terms and conditions are signed first before using it. The terms and conditions can be signed by using this endpoint. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/terms-and-conditions?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"signedAgreement\": true}' ```
+
+ :param signed_agreement: Whether or not to sign the agreement. (required)
+ :type signed_agreement: CreateConverterConfigParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: SignLiltCreateTermsResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.sign_lilt_create_terms_with_http_info(signed_agreement, **kwargs) # noqa: E501
-
- def sign_lilt_create_terms_with_http_info(self, signed_agreement, **kwargs): # noqa: E501
- """Sign the Lilt Create terms and conditions # noqa: E501
-
- Lilt Create requires that the terms and conditions are signed first before using it. The terms and conditions can be signed by using this endpoint. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/terms-and-conditions?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"signedAgreement\": true}' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.sign_lilt_create_terms_with_http_info(signed_agreement, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param CreateConverterConfigParameters signed_agreement: (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._sign_lilt_create_terms_serialize(
+ signed_agreement=signed_agreement,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "SignLiltCreateTermsResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def sign_lilt_create_terms_with_http_info(
+ self,
+ signed_agreement: Annotated[CreateConverterConfigParameters, Field(description="Whether or not to sign the agreement.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[SignLiltCreateTermsResponse]:
+ """Sign the Lilt Create terms and conditions
+
+ Lilt Create requires that the terms and conditions are signed first before using it. The terms and conditions can be signed by using this endpoint. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/terms-and-conditions?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"signedAgreement\": true}' ```
+
+ :param signed_agreement: Whether or not to sign the agreement. (required)
+ :type signed_agreement: CreateConverterConfigParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(SignLiltCreateTermsResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._sign_lilt_create_terms_serialize(
+ signed_agreement=signed_agreement,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "SignLiltCreateTermsResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- local_var_params = locals()
- all_params = [
- 'signed_agreement'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ @validate_call
+ def sign_lilt_create_terms_without_preload_content(
+ self,
+ signed_agreement: Annotated[CreateConverterConfigParameters, Field(description="Whether or not to sign the agreement.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Sign the Lilt Create terms and conditions
+
+ Lilt Create requires that the terms and conditions are signed first before using it. The terms and conditions can be signed by using this endpoint. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/create/terms-and-conditions?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"signedAgreement\": true}' ```
+
+ :param signed_agreement: Whether or not to sign the agreement. (required)
+ :type signed_agreement: CreateConverterConfigParameters
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._sign_lilt_create_terms_serialize(
+ signed_agreement=signed_agreement,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method sign_lilt_create_terms" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "SignLiltCreateTermsResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _sign_lilt_create_terms_serialize(
+ self,
+ signed_agreement,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if signed_agreement is not None:
+ _body_params = signed_agreement
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'signed_agreement' is set
- if self.api_client.client_side_validation and ('signed_agreement' not in local_var_params or # noqa: E501
- local_var_params['signed_agreement'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `signed_agreement` when calling `sign_lilt_create_terms`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'signed_agreement' in local_var_params:
- body_params = local_var_params['signed_agreement']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create/terms-and-conditions', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='SignLiltCreateTermsResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def update_lilt_create_content(self, content_id, **kwargs): # noqa: E501
- """Update Lilt Create content # noqa: E501
-
- Update a piece of Lilt Create content. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/1234?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"language\":\"de-DE\"}' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_lilt_create_content(content_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int content_id: The content ID. (required)
- :param LiltCreateContent body:
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/create/terms-and-conditions',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def update_lilt_create_content(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ body: Optional[LiltCreateContent] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> LiltCreateContent:
+ """Update Lilt Create content
+
+ Update a piece of Lilt Create content. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/1234?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"language\":\"de-DE\"}' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
+ :param body:
+ :type body: LiltCreateContent
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: LiltCreateContent
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.update_lilt_create_content_with_http_info(content_id, **kwargs) # noqa: E501
-
- def update_lilt_create_content_with_http_info(self, content_id, **kwargs): # noqa: E501
- """Update Lilt Create content # noqa: E501
-
- Update a piece of Lilt Create content. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/1234?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"language\":\"de-DE\"}' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_lilt_create_content_with_http_info(content_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int content_id: The content ID. (required)
- :param LiltCreateContent body:
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_lilt_create_content_serialize(
+ content_id=content_id,
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LiltCreateContent",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def update_lilt_create_content_with_http_info(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ body: Optional[LiltCreateContent] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[LiltCreateContent]:
+ """Update Lilt Create content
+
+ Update a piece of Lilt Create content. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/1234?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"language\":\"de-DE\"}' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
+ :param body:
+ :type body: LiltCreateContent
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(LiltCreateContent, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_lilt_create_content_serialize(
+ content_id=content_id,
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LiltCreateContent",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'content_id',
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def update_lilt_create_content_without_preload_content(
+ self,
+ content_id: Annotated[StrictInt, Field(description="The content ID.")],
+ body: Optional[LiltCreateContent] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Update Lilt Create content
+
+ Update a piece of Lilt Create content. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/1234?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"language\":\"de-DE\"}' ```
+
+ :param content_id: The content ID. (required)
+ :type content_id: int
+ :param body:
+ :type body: LiltCreateContent
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_lilt_create_content_serialize(
+ content_id=content_id,
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_lilt_create_content" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LiltCreateContent",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _update_lilt_create_content_serialize(
+ self,
+ content_id,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if content_id is not None:
+ _path_params['contentId'] = content_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'content_id' is set
- if self.api_client.client_side_validation and ('content_id' not in local_var_params or # noqa: E501
- local_var_params['content_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `content_id` when calling `update_lilt_create_content`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'content_id' in local_var_params:
- path_params['contentId'] = local_var_params['content_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create/{contentId}', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='LiltCreateContent', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def update_lilt_create_preferences(self, **kwargs): # noqa: E501
- """Update Lilt Create preferences # noqa: E501
-
- Update the stored preferences for Lilt Create. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/preferences?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"tone\": \"formal\", \"styleguide\": \"\"}' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_lilt_create_preferences(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param LiltCreateContent styleguide: Which styleguide to use.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/v2/create/{contentId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def update_lilt_create_preferences(
+ self,
+ styleguide: Annotated[Optional[LiltCreateContent], Field(description="Which styleguide to use.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Update Lilt Create preferences
+
+ Update the stored preferences for Lilt Create. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/preferences?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"tone\": \"formal\", \"styleguide\": \"\"}' ```
+
+ :param styleguide: Which styleguide to use.
+ :type styleguide: LiltCreateContent
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.update_lilt_create_preferences_with_http_info(**kwargs) # noqa: E501
-
- def update_lilt_create_preferences_with_http_info(self, **kwargs): # noqa: E501
- """Update Lilt Create preferences # noqa: E501
-
- Update the stored preferences for Lilt Create. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/preferences?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"tone\": \"formal\", \"styleguide\": \"\"}' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_lilt_create_preferences_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param LiltCreateContent styleguide: Which styleguide to use.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_lilt_create_preferences_serialize(
+ styleguide=styleguide,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def update_lilt_create_preferences_with_http_info(
+ self,
+ styleguide: Annotated[Optional[LiltCreateContent], Field(description="Which styleguide to use.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Update Lilt Create preferences
+
+ Update the stored preferences for Lilt Create. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/preferences?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"tone\": \"formal\", \"styleguide\": \"\"}' ```
+
+ :param styleguide: Which styleguide to use.
+ :type styleguide: LiltCreateContent
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_lilt_create_preferences_serialize(
+ styleguide=styleguide,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'styleguide'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def update_lilt_create_preferences_without_preload_content(
+ self,
+ styleguide: Annotated[Optional[LiltCreateContent], Field(description="Which styleguide to use.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Update Lilt Create preferences
+
+ Update the stored preferences for Lilt Create. Example CURL: ```bash curl -X PUT 'https://api.lilt.com/v2/create/preferences?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{\"tone\": \"formal\", \"styleguide\": \"\"}' ```
+
+ :param styleguide: Which styleguide to use.
+ :type styleguide: LiltCreateContent
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_lilt_create_preferences_serialize(
+ styleguide=styleguide,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_lilt_create_preferences" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _update_lilt_create_preferences_serialize(
+ self,
+ styleguide,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if styleguide is not None:
+ _body_params = styleguide
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'styleguide' in local_var_params:
- body_params = local_var_params['styleguide']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/create/preferences', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type=None, # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/v2/create/preferences',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/documents_api.py b/lilt/api/documents_api.py
index 6b5ed87..82d8c39 100644
--- a/lilt/api/documents_api.py
+++ b/lilt/api/documents_api.py
@@ -3,315 +3,718 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-from __future__ import absolute_import
+ Do not edit the class manually.
+""" # noqa: E501
-import re # noqa: F401
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
-# python 2 and python 3 compatibility library
-import six
+from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr
+from typing import Optional, Tuple, Union
+from typing_extensions import Annotated
+from lilt.models.document_with_segments import DocumentWithSegments
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
-class DocumentsApi(object):
+class DocumentsApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def download_document(self, id, **kwargs): # noqa: E501
- """Download a Document # noqa: E501
-
- Export a Document that has been translated in the Lilt web application. Any Document can be downloaded in XLIFF 1.2 format, or can be retrieved in its original uploaded format by setting `is_xliff=false`. This endpoint will fail if either (a) export or (b) pre-translation operations are in-progress. The status of those operations can be determined by retrieving the Document resource. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_document(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: An unique Document identifier. (required)
- :param bool is_xliff: Download the document in XLIFF 1.2 format.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+
+ @validate_call
+ def download_document(
+ self,
+ id: Annotated[StrictInt, Field(description="An unique Document identifier.")],
+ is_xliff: Annotated[Optional[StrictBool], Field(description="Download the document in XLIFF 1.2 format.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> bytearray:
+ """Download a Document
+
+ Export a Document that has been translated in the Lilt web application. Any Document can be downloaded in XLIFF 1.2 format, or can be retrieved in its original uploaded format by setting `is_xliff=false`. This endpoint will fail if either (a) export or (b) pre-translation operations are in-progress. The status of those operations can be determined by retrieving the Document resource. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff ```
+
+ :param id: An unique Document identifier. (required)
+ :type id: int
+ :param is_xliff: Download the document in XLIFF 1.2 format.
+ :type is_xliff: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: str
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.download_document_with_http_info(id, **kwargs) # noqa: E501
-
- def download_document_with_http_info(self, id, **kwargs): # noqa: E501
- """Download a Document # noqa: E501
-
- Export a Document that has been translated in the Lilt web application. Any Document can be downloaded in XLIFF 1.2 format, or can be retrieved in its original uploaded format by setting `is_xliff=false`. This endpoint will fail if either (a) export or (b) pre-translation operations are in-progress. The status of those operations can be determined by retrieving the Document resource. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_document_with_http_info(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: An unique Document identifier. (required)
- :param bool is_xliff: Download the document in XLIFF 1.2 format.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_document_serialize(
+ id=id,
+ is_xliff=is_xliff,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ '502': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def download_document_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="An unique Document identifier.")],
+ is_xliff: Annotated[Optional[StrictBool], Field(description="Download the document in XLIFF 1.2 format.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[bytearray]:
+ """Download a Document
+
+ Export a Document that has been translated in the Lilt web application. Any Document can be downloaded in XLIFF 1.2 format, or can be retrieved in its original uploaded format by setting `is_xliff=false`. This endpoint will fail if either (a) export or (b) pre-translation operations are in-progress. The status of those operations can be determined by retrieving the Document resource. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff ```
+
+ :param id: An unique Document identifier. (required)
+ :type id: int
+ :param is_xliff: Download the document in XLIFF 1.2 format.
+ :type is_xliff: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(str, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_document_serialize(
+ id=id,
+ is_xliff=is_xliff,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ '502': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id',
- 'is_xliff'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def download_document_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="An unique Document identifier.")],
+ is_xliff: Annotated[Optional[StrictBool], Field(description="Download the document in XLIFF 1.2 format.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Download a Document
+
+ Export a Document that has been translated in the Lilt web application. Any Document can be downloaded in XLIFF 1.2 format, or can be retrieved in its original uploaded format by setting `is_xliff=false`. This endpoint will fail if either (a) export or (b) pre-translation operations are in-progress. The status of those operations can be determined by retrieving the Document resource. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff ```
+
+ :param id: An unique Document identifier. (required)
+ :type id: int
+ :param is_xliff: Download the document in XLIFF 1.2 format.
+ :type is_xliff: bool
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_document_serialize(
+ id=id,
+ is_xliff=is_xliff,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method download_document" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `download_document`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
- if 'is_xliff' in local_var_params and local_var_params['is_xliff'] is not None: # noqa: E501
- query_params.append(('is_xliff', local_var_params['is_xliff'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', ]) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/documents/files', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='str', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def upload_document(self, name, project_id, body, **kwargs): # noqa: E501
- """Upload a File # noqa: E501
-
- Create a Document from a file in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed as JSON object with the header field `LILT-API`. File names in the header can only contain [US-ASCII characters](https://en.wikipedia.org/wiki/ASCII). File names with characters outside of US-ASCII should be [URI encoded](https://en.wikipedia.org/wiki/Percent-encoding) or transliterated to US-ASCII strings. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/documents/files?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"introduction.xliff\\\",\\\"pretranslate\\\": \\\"tm+mt\\\",\\\"project_id\\\": 9}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @Introduction.xliff ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.upload_document(name, project_id, body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str name: A file name. (required)
- :param int project_id: A unique Project identifier. (required)
- :param file body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
- :param str pretranslate: An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT`
- :param bool auto_accept: An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted.
- :param bool case_sensitive: An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting
- :param bool match_attribution: An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting
- :param int config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ '502': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _download_document_serialize(
+ self,
+ id,
+ is_xliff,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ if is_xliff is not None:
+
+ _query_params.append(('is_xliff', is_xliff))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/documents/files',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def upload_document(
+ self,
+ name: Annotated[StrictStr, Field(description="A file name.")],
+ project_id: Annotated[StrictInt, Field(description="A unique Project identifier.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file. ")],
+ pretranslate: Annotated[Optional[StrictStr], Field(description="An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT` ")] = None,
+ auto_accept: Annotated[Optional[StrictBool], Field(description="An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted. ")] = None,
+ case_sensitive: Annotated[Optional[StrictBool], Field(description="An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting ")] = None,
+ match_attribution: Annotated[Optional[StrictBool], Field(description="An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting ")] = None,
+ config_id: Annotated[Optional[StrictInt], Field(description="An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> DocumentWithSegments:
+ """Upload a File
+
+ Create a Document from a file in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed as JSON object with the header field `LILT-API`. File names in the header can only contain [US-ASCII characters](https://en.wikipedia.org/wiki/ASCII). File names with characters outside of US-ASCII should be [URI encoded](https://en.wikipedia.org/wiki/Percent-encoding) or transliterated to US-ASCII strings. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/documents/files?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"introduction.xliff\\\",\\\"pretranslate\\\": \\\"tm+mt\\\",\\\"project_id\\\": 9}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @Introduction.xliff ```
+
+ :param name: A file name. (required)
+ :type name: str
+ :param project_id: A unique Project identifier. (required)
+ :type project_id: int
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param pretranslate: An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT`
+ :type pretranslate: str
+ :param auto_accept: An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted.
+ :type auto_accept: bool
+ :param case_sensitive: An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting
+ :type case_sensitive: bool
+ :param match_attribution: An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting
+ :type match_attribution: bool
+ :param config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
+ :type config_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: DocumentWithSegments
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.upload_document_with_http_info(name, project_id, body, **kwargs) # noqa: E501
-
- def upload_document_with_http_info(self, name, project_id, body, **kwargs): # noqa: E501
- """Upload a File # noqa: E501
-
- Create a Document from a file in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed as JSON object with the header field `LILT-API`. File names in the header can only contain [US-ASCII characters](https://en.wikipedia.org/wiki/ASCII). File names with characters outside of US-ASCII should be [URI encoded](https://en.wikipedia.org/wiki/Percent-encoding) or transliterated to US-ASCII strings. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/documents/files?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"introduction.xliff\\\",\\\"pretranslate\\\": \\\"tm+mt\\\",\\\"project_id\\\": 9}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @Introduction.xliff ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.upload_document_with_http_info(name, project_id, body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str name: A file name. (required)
- :param int project_id: A unique Project identifier. (required)
- :param file body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
- :param str pretranslate: An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT`
- :param bool auto_accept: An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted.
- :param bool case_sensitive: An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting
- :param bool match_attribution: An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting
- :param int config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_document_serialize(
+ name=name,
+ project_id=project_id,
+ body=body,
+ pretranslate=pretranslate,
+ auto_accept=auto_accept,
+ case_sensitive=case_sensitive,
+ match_attribution=match_attribution,
+ config_id=config_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DocumentWithSegments",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def upload_document_with_http_info(
+ self,
+ name: Annotated[StrictStr, Field(description="A file name.")],
+ project_id: Annotated[StrictInt, Field(description="A unique Project identifier.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file. ")],
+ pretranslate: Annotated[Optional[StrictStr], Field(description="An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT` ")] = None,
+ auto_accept: Annotated[Optional[StrictBool], Field(description="An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted. ")] = None,
+ case_sensitive: Annotated[Optional[StrictBool], Field(description="An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting ")] = None,
+ match_attribution: Annotated[Optional[StrictBool], Field(description="An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting ")] = None,
+ config_id: Annotated[Optional[StrictInt], Field(description="An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[DocumentWithSegments]:
+ """Upload a File
+
+ Create a Document from a file in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed as JSON object with the header field `LILT-API`. File names in the header can only contain [US-ASCII characters](https://en.wikipedia.org/wiki/ASCII). File names with characters outside of US-ASCII should be [URI encoded](https://en.wikipedia.org/wiki/Percent-encoding) or transliterated to US-ASCII strings. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/documents/files?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"introduction.xliff\\\",\\\"pretranslate\\\": \\\"tm+mt\\\",\\\"project_id\\\": 9}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @Introduction.xliff ```
+
+ :param name: A file name. (required)
+ :type name: str
+ :param project_id: A unique Project identifier. (required)
+ :type project_id: int
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param pretranslate: An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT`
+ :type pretranslate: str
+ :param auto_accept: An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted.
+ :type auto_accept: bool
+ :param case_sensitive: An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting
+ :type case_sensitive: bool
+ :param match_attribution: An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting
+ :type match_attribution: bool
+ :param config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
+ :type config_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(DocumentWithSegments, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
-
- local_var_params = locals()
-
- all_params = [
- 'name',
- 'project_id',
- 'body',
- 'pretranslate',
- 'auto_accept',
- 'case_sensitive',
- 'match_attribution',
- 'config_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_document_serialize(
+ name=name,
+ project_id=project_id,
+ body=body,
+ pretranslate=pretranslate,
+ auto_accept=auto_accept,
+ case_sensitive=case_sensitive,
+ match_attribution=match_attribution,
+ config_id=config_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DocumentWithSegments",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def upload_document_without_preload_content(
+ self,
+ name: Annotated[StrictStr, Field(description="A file name.")],
+ project_id: Annotated[StrictInt, Field(description="A unique Project identifier.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file. ")],
+ pretranslate: Annotated[Optional[StrictStr], Field(description="An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT` ")] = None,
+ auto_accept: Annotated[Optional[StrictBool], Field(description="An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted. ")] = None,
+ case_sensitive: Annotated[Optional[StrictBool], Field(description="An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting ")] = None,
+ match_attribution: Annotated[Optional[StrictBool], Field(description="An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting ")] = None,
+ config_id: Annotated[Optional[StrictInt], Field(description="An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file. ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Upload a File
+
+ Create a Document from a file in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed as JSON object with the header field `LILT-API`. File names in the header can only contain [US-ASCII characters](https://en.wikipedia.org/wiki/ASCII). File names with characters outside of US-ASCII should be [URI encoded](https://en.wikipedia.org/wiki/Percent-encoding) or transliterated to US-ASCII strings. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/documents/files?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"introduction.xliff\\\",\\\"pretranslate\\\": \\\"tm+mt\\\",\\\"project_id\\\": 9}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @Introduction.xliff ```
+
+ :param name: A file name. (required)
+ :type name: str
+ :param project_id: A unique Project identifier. (required)
+ :type project_id: int
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param pretranslate: An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are `TM`, or `TM+MT`
+ :type pretranslate: str
+ :param auto_accept: An optional parameter to auto-accept segments with 100% translation memory matches when the `pretranslate` option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for `Accept and lock exact matches`, if set to `false`, no segments will be auto-accepted.
+ :type auto_accept: bool
+ :param case_sensitive: An optional parameter to use case sensitive translation memory matching when the `pretranslate` option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for `Use case sensitive translation memory matching` setting
+ :type case_sensitive: bool
+ :param match_attribution: An optional parameter to attribute translation authorship of exact matches to the author of the file when the `pretranslate` option is also enabled. Default value matches your organization settings for `Translation authorship` setting
+ :type match_attribution: bool
+ :param config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
+ :type config_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_document_serialize(
+ name=name,
+ project_id=project_id,
+ body=body,
+ pretranslate=pretranslate,
+ auto_accept=auto_accept,
+ case_sensitive=case_sensitive,
+ match_attribution=match_attribution,
+ config_id=config_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method upload_document" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DocumentWithSegments",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _upload_document_serialize(
+ self,
+ name,
+ project_id,
+ body,
+ pretranslate,
+ auto_accept,
+ case_sensitive,
+ match_attribution,
+ config_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ if name is not None:
+ _header_params['name'] = name
+ if project_id is not None:
+ _header_params['project_id'] = project_id
+ if pretranslate is not None:
+ _header_params['pretranslate'] = pretranslate
+ if auto_accept is not None:
+ _header_params['auto_accept'] = auto_accept
+ if case_sensitive is not None:
+ _header_params['case_sensitive'] = case_sensitive
+ if match_attribution is not None:
+ _header_params['match_attribution'] = match_attribution
+ if config_id is not None:
+ _header_params['config_id'] = config_id
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ # convert to byte array if the input is a file name (str)
+ if isinstance(body, str):
+ with open(body, "rb") as _fp:
+ _body_params = _fp.read()
+ elif isinstance(body, tuple):
+ # drop the filename from the tuple
+ _body_params = body[1]
+ else:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/octet-stream'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'name' is set
- if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501
- local_var_params['name'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `name` when calling `upload_document`") # noqa: E501
- # verify the required parameter 'project_id' is set
- if self.api_client.client_side_validation and ('project_id' not in local_var_params or # noqa: E501
- local_var_params['project_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `project_id` when calling `upload_document`") # noqa: E501
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `upload_document`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
- if 'name' in local_var_params:
- header_params['name'] = local_var_params['name'] # noqa: E501
- if 'project_id' in local_var_params:
- header_params['project_id'] = local_var_params['project_id'] # noqa: E501
- if 'pretranslate' in local_var_params:
- header_params['pretranslate'] = local_var_params['pretranslate'] # noqa: E501
- if 'auto_accept' in local_var_params:
- header_params['auto_accept'] = local_var_params['auto_accept'] # noqa: E501
- if 'case_sensitive' in local_var_params:
- header_params['case_sensitive'] = local_var_params['case_sensitive'] # noqa: E501
- if 'match_attribution' in local_var_params:
- header_params['match_attribution'] = local_var_params['match_attribution'] # noqa: E501
- if 'config_id' in local_var_params:
- header_params['config_id'] = local_var_params['config_id'] # noqa: E501
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/octet-stream']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/documents/files', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='DocumentWithSegments', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/documents/files',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/domains_api.py b/lilt/api/domains_api.py
new file mode 100644
index 0000000..72f8c9d
--- /dev/null
+++ b/lilt/api/domains_api.py
@@ -0,0 +1,305 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+from typing_extensions import Annotated
+from lilt.models.domain_list import DomainList
+
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
+
+
+class DomainsApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def get_domains(
+ self,
+ key: Annotated[StrictStr, Field(description="the ApiKey used to authenticate with LILT, used to look up the Organization's domain information.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> DomainList:
+ """Retrieve Domains
+
+ Retrieve a list of Domains associated with the Organization's API key. Each Domain contains potentially 4 Arrays related to the Domain these are as follows: - models - the list of models associated with the Domain - filterConfigs - the list of filterConfigs associated with the Domain - domainMetadata - the list of Domain specific options that have been configured for this domain.
+
+ :param key: the ApiKey used to authenticate with LILT, used to look up the Organization's domain information. (required)
+ :type key: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_domains_serialize(
+ key=key,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DomainList",
+ '404': "Error",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_domains_with_http_info(
+ self,
+ key: Annotated[StrictStr, Field(description="the ApiKey used to authenticate with LILT, used to look up the Organization's domain information.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[DomainList]:
+ """Retrieve Domains
+
+ Retrieve a list of Domains associated with the Organization's API key. Each Domain contains potentially 4 Arrays related to the Domain these are as follows: - models - the list of models associated with the Domain - filterConfigs - the list of filterConfigs associated with the Domain - domainMetadata - the list of Domain specific options that have been configured for this domain.
+
+ :param key: the ApiKey used to authenticate with LILT, used to look up the Organization's domain information. (required)
+ :type key: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_domains_serialize(
+ key=key,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DomainList",
+ '404': "Error",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def get_domains_without_preload_content(
+ self,
+ key: Annotated[StrictStr, Field(description="the ApiKey used to authenticate with LILT, used to look up the Organization's domain information.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve Domains
+
+ Retrieve a list of Domains associated with the Organization's API key. Each Domain contains potentially 4 Arrays related to the Domain these are as follows: - models - the list of models associated with the Domain - filterConfigs - the list of filterConfigs associated with the Domain - domainMetadata - the list of Domain specific options that have been configured for this domain.
+
+ :param key: the ApiKey used to authenticate with LILT, used to look up the Organization's domain information. (required)
+ :type key: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_domains_serialize(
+ key=key,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DomainList",
+ '404': "Error",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_domains_serialize(
+ self,
+ key,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if key is not None:
+
+ _query_params.append(('key', key))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v3/domains',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/files_api.py b/lilt/api/files_api.py
index f1db81e..58cbc3f 100644
--- a/lilt/api/files_api.py
+++ b/lilt/api/files_api.py
@@ -3,781 +3,1860 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-from __future__ import absolute_import
+ Do not edit the class manually.
+""" # noqa: E501
-import re # noqa: F401
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
-# python 2 and python 3 compatibility library
-import six
+from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator
+from typing import List, Optional, Tuple, Union
+from typing_extensions import Annotated
+from lilt.models.add_file_label_request import AddFileLabelRequest
+from lilt.models.file_delete_response import FileDeleteResponse
+from lilt.models.source_file import SourceFile
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
-class FilesApi(object):
+class FilesApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def add_label(self, id, name, **kwargs): # noqa: E501
- """Add Label to File # noqa: E501
-
- Add a label to a File. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1' --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"label_name\" }' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.add_label(id, name, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str id: A File id. (required)
- :param AddFileLabelRequest name: (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+
+ @validate_call
+ def add_label(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ name: Annotated[AddFileLabelRequest, Field(description="A label name.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Add Label to File
+
+ Add a label to a File. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1' --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"label_name\" }' ```
+
+ :param id: A File id. (required)
+ :type id: str
+ :param name: A label name. (required)
+ :type name: AddFileLabelRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.add_label_with_http_info(id, name, **kwargs) # noqa: E501
-
- def add_label_with_http_info(self, id, name, **kwargs): # noqa: E501
- """Add Label to File # noqa: E501
-
- Add a label to a File. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1' --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"label_name\" }' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.add_label_with_http_info(id, name, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str id: A File id. (required)
- :param AddFileLabelRequest name: (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._add_label_serialize(
+ id=id,
+ name=name,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def add_label_with_http_info(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ name: Annotated[AddFileLabelRequest, Field(description="A label name.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Add Label to File
+
+ Add a label to a File. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1' --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"label_name\" }' ```
+
+ :param id: A File id. (required)
+ :type id: str
+ :param name: A label name. (required)
+ :type name: AddFileLabelRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._add_label_serialize(
+ id=id,
+ name=name,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id',
- 'name'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def add_label_without_preload_content(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ name: Annotated[AddFileLabelRequest, Field(description="A label name.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Add Label to File
+
+ Add a label to a File. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1' --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"label_name\" }' ```
+
+ :param id: A File id. (required)
+ :type id: str
+ :param name: A label name. (required)
+ :type name: AddFileLabelRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._add_label_serialize(
+ id=id,
+ name=name,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method add_label" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _add_label_serialize(
+ self,
+ id,
+ name,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if name is not None:
+ _body_params = name
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `add_label`") # noqa: E501
- # verify the required parameter 'name' is set
- if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501
- local_var_params['name'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `name` when calling `add_label`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'name' in local_var_params:
- body_params = local_var_params['name']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/files/labels', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type=None, # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def delete_file(self, id, **kwargs): # noqa: E501
- """Delete a File # noqa: E501
-
- Delete a File. Example CURL command: ```bash curl -X DELETE https://api.lilt.com/v2/files?key=API_KEY&id=123 ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_file(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique File identifier. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/files/labels',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def delete_file(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique File identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> FileDeleteResponse:
+ """Delete a File
+
+ Delete a File. Example CURL command: ```bash curl -X DELETE https://api.lilt.com/v2/files?key=API_KEY&id=123 ```
+
+ :param id: A unique File identifier. (required)
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: FileDeleteResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_file_with_http_info(id, **kwargs) # noqa: E501
-
- def delete_file_with_http_info(self, id, **kwargs): # noqa: E501
- """Delete a File # noqa: E501
-
- Delete a File. Example CURL command: ```bash curl -X DELETE https://api.lilt.com/v2/files?key=API_KEY&id=123 ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_file_with_http_info(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique File identifier. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_file_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': "FileDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_file_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique File identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[FileDeleteResponse]:
+ """Delete a File
+
+ Delete a File. Example CURL command: ```bash curl -X DELETE https://api.lilt.com/v2/files?key=API_KEY&id=123 ```
+
+ :param id: A unique File identifier. (required)
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(FileDeleteResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_file_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': "FileDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def delete_file_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique File identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete a File
+
+ Delete a File. Example CURL command: ```bash curl -X DELETE https://api.lilt.com/v2/files?key=API_KEY&id=123 ```
+
+ :param id: A unique File identifier. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_file_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_file" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `delete_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/files', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='FileDeleteResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def download(self, id, **kwargs): # noqa: E501
- """Download file # noqa: E501
-
- Download a File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/files/download?key=API_KEY&id=1' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str id: A File id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': "FileDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_file_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/v2/files',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def download(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> bytearray:
+ """Download file
+
+ Download a File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/files/download?key=API_KEY&id=1' ```
+
+ :param id: A File id. (required)
+ :type id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: str
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.download_with_http_info(id, **kwargs) # noqa: E501
-
- def download_with_http_info(self, id, **kwargs): # noqa: E501
- """Download file # noqa: E501
-
- Download a File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/files/download?key=API_KEY&id=1' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_with_http_info(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str id: A File id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def download_with_http_info(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[bytearray]:
+ """Download file
+
+ Download a File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/files/download?key=API_KEY&id=1' ```
+
+ :param id: A File id. (required)
+ :type id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(str, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def download_without_preload_content(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Download file
+
+ Download a File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/files/download?key=API_KEY&id=1' ```
+
+ :param id: A File id. (required)
+ :type id: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method download" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `download`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/files/download', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='str', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def get_files(self, **kwargs): # noqa: E501
- """Retrieve a File # noqa: E501
-
- Retrieves one or more files available to your user. Files are not associated with a project or a memory. They are unprocessed and can be used later in the project/document creation workflow step. To retrieve a specific file, specify the id request parameter. To retrieve all files, omit the id request parameter. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/files?key=API_KEY&id=274 ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_files(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique File identifier.
- :param list[str] labels: One or more labels. This will return the files which contain all of the given labels.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _download_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/files/download',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_files(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique File identifier.")] = None,
+ labels: Annotated[Optional[List[StrictStr]], Field(description="One or more labels. This will return the files which contain all of the given labels. ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[SourceFile]:
+ """Retrieve a File
+
+ Retrieves one or more files available to your user. Files are not associated with a project or a memory. They are unprocessed and can be used later in the project/document creation workflow step. To retrieve a specific file, specify the id request parameter. To retrieve all files, omit the id request parameter. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/files?key=API_KEY&id=274 ```
+
+ :param id: A unique File identifier.
+ :type id: int
+ :param labels: One or more labels. This will return the files which contain all of the given labels.
+ :type labels: List[str]
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: list[SourceFile]
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_files_with_http_info(**kwargs) # noqa: E501
-
- def get_files_with_http_info(self, **kwargs): # noqa: E501
- """Retrieve a File # noqa: E501
-
- Retrieves one or more files available to your user. Files are not associated with a project or a memory. They are unprocessed and can be used later in the project/document creation workflow step. To retrieve a specific file, specify the id request parameter. To retrieve all files, omit the id request parameter. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/files?key=API_KEY&id=274 ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_files_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique File identifier.
- :param list[str] labels: One or more labels. This will return the files which contain all of the given labels.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_files_serialize(
+ id=id,
+ labels=labels,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[SourceFile]",
+ '401': "str",
+ '403': None,
+ '410': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_files_with_http_info(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique File identifier.")] = None,
+ labels: Annotated[Optional[List[StrictStr]], Field(description="One or more labels. This will return the files which contain all of the given labels. ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[SourceFile]]:
+ """Retrieve a File
+
+ Retrieves one or more files available to your user. Files are not associated with a project or a memory. They are unprocessed and can be used later in the project/document creation workflow step. To retrieve a specific file, specify the id request parameter. To retrieve all files, omit the id request parameter. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/files?key=API_KEY&id=274 ```
+
+ :param id: A unique File identifier.
+ :type id: int
+ :param labels: One or more labels. This will return the files which contain all of the given labels.
+ :type labels: List[str]
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(list[SourceFile], status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_files_serialize(
+ id=id,
+ labels=labels,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[SourceFile]",
+ '401': "str",
+ '403': None,
+ '410': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- local_var_params = locals()
- all_params = [
- 'id',
- 'labels'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ @validate_call
+ def get_files_without_preload_content(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique File identifier.")] = None,
+ labels: Annotated[Optional[List[StrictStr]], Field(description="One or more labels. This will return the files which contain all of the given labels. ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve a File
+
+ Retrieves one or more files available to your user. Files are not associated with a project or a memory. They are unprocessed and can be used later in the project/document creation workflow step. To retrieve a specific file, specify the id request parameter. To retrieve all files, omit the id request parameter. Example CURL command: ```bash curl -X GET https://api.lilt.com/v2/files?key=API_KEY&id=274 ```
+
+ :param id: A unique File identifier.
+ :type id: int
+ :param labels: One or more labels. This will return the files which contain all of the given labels.
+ :type labels: List[str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_files_serialize(
+ id=id,
+ labels=labels,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_files" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
- if 'labels' in local_var_params and local_var_params['labels'] is not None: # noqa: E501
- query_params.append(('labels', local_var_params['labels'])) # noqa: E501
- collection_formats['labels'] = 'csv' # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/files', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='list[SourceFile]', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def remove_label(self, id, name, **kwargs): # noqa: E501
- """Remove Label from File # noqa: E501
-
- Remove a label from a File. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1&name=label_name' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.remove_label(id, name, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str id: A File id. (required)
- :param str name: A label name. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[SourceFile]",
+ '401': "str",
+ '403': None,
+ '410': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_files_serialize(
+ self,
+ id,
+ labels,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ 'labels': 'csv',
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ if labels is not None:
+
+ _query_params.append(('labels', labels))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/files',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def remove_label(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ name: Annotated[StrictStr, Field(description="A label name.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Remove Label from File
+
+ Remove a label from a File. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1&name=label_name' ```
+
+ :param id: A File id. (required)
+ :type id: str
+ :param name: A label name. (required)
+ :type name: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.remove_label_with_http_info(id, name, **kwargs) # noqa: E501
-
- def remove_label_with_http_info(self, id, name, **kwargs): # noqa: E501
- """Remove Label from File # noqa: E501
-
- Remove a label from a File. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1&name=label_name' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.remove_label_with_http_info(id, name, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str id: A File id. (required)
- :param str name: A label name. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._remove_label_serialize(
+ id=id,
+ name=name,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def remove_label_with_http_info(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ name: Annotated[StrictStr, Field(description="A label name.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Remove Label from File
+
+ Remove a label from a File. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1&name=label_name' ```
+
+ :param id: A File id. (required)
+ :type id: str
+ :param name: A label name. (required)
+ :type name: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._remove_label_serialize(
+ id=id,
+ name=name,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id',
- 'name'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def remove_label_without_preload_content(
+ self,
+ id: Annotated[StrictStr, Field(description="A File id.")],
+ name: Annotated[StrictStr, Field(description="A label name.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Remove Label from File
+
+ Remove a label from a File. Example CURL: ```bash curl -X DELETE 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1&name=label_name' ```
+
+ :param id: A File id. (required)
+ :type id: str
+ :param name: A label name. (required)
+ :type name: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._remove_label_serialize(
+ id=id,
+ name=name,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method remove_label" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `remove_label`") # noqa: E501
- # verify the required parameter 'name' is set
- if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501
- local_var_params['name'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `name` when calling `remove_label`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
- if 'name' in local_var_params and local_var_params['name'] is not None: # noqa: E501
- query_params.append(('name', local_var_params['name'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/files/labels', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type=None, # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def upload_file(self, name, body, **kwargs): # noqa: E501
- """Upload a File # noqa: E501
-
- Upload a File in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed in as query string parameters. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @en_US.json ``` Calls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score. The language detection will complete asynchronously. Prior to completion, the `detected_lang` value will be `zxx`, the reserved ISO 639-2 code for \"No linguistic content/not applicable\". If the language can not be determined, or the detection process fails, the `detected_lang` field will return `und`, the reserved ISO 639-2 code for undetermined language, and the `detected_lang_confidence` score will be `0`. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.upload_file(name, body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str name: A file name. (required)
- :param file body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
- :param str file_hash: A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.
- :param bool lang_id: Flag indicating whether to perform language detection on the uploaded file. Default is false.
- :param int project_id: The project to associate the uploaded file with.
- :param str category: The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.
- :param str labels: Comma-separated list of labels to add to the uploaded document.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _remove_label_serialize(
+ self,
+ id,
+ name,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ if name is not None:
+
+ _query_params.append(('name', name))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/v2/files/labels',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def upload_file(
+ self,
+ name: Annotated[StrictStr, Field(description="A file name.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file.")],
+ file_hash: Annotated[Optional[StrictStr], Field(description="A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.")] = None,
+ lang_id: Annotated[Optional[StrictBool], Field(description="Flag indicating whether to perform language detection on the uploaded file. Default is false.")] = None,
+ project_id: Annotated[Optional[StrictInt], Field(description="The project to associate the uploaded file with.")] = None,
+ category: Annotated[Optional[StrictStr], Field(description="The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.")] = None,
+ labels: Annotated[Optional[StrictStr], Field(description="Comma-separated list of labels to add to the uploaded document.")] = None,
+ job_type: Annotated[Optional[StrictStr], Field(description="Specifies the job type when adding this file to a job.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> SourceFile:
+ """Upload a File
+
+ Upload a File in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed in as query string parameters. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @en_US.json ``` Calls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score. The language detection will complete asynchronously. Prior to completion, the `detected_lang` value will be `zxx`, the reserved ISO 639-2 code for \"No linguistic content/not applicable\". If the language can not be determined, or the detection process fails, the `detected_lang` field will return `und`, the reserved ISO 639-2 code for undetermined language, and the `detected_lang_confidence` score will be `0`.
+
+ :param name: A file name. (required)
+ :type name: str
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param file_hash: A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.
+ :type file_hash: str
+ :param lang_id: Flag indicating whether to perform language detection on the uploaded file. Default is false.
+ :type lang_id: bool
+ :param project_id: The project to associate the uploaded file with.
+ :type project_id: int
+ :param category: The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.
+ :type category: str
+ :param labels: Comma-separated list of labels to add to the uploaded document.
+ :type labels: str
+ :param job_type: Specifies the job type when adding this file to a job.
+ :type job_type: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: SourceFile
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.upload_file_with_http_info(name, body, **kwargs) # noqa: E501
-
- def upload_file_with_http_info(self, name, body, **kwargs): # noqa: E501
- """Upload a File # noqa: E501
-
- Upload a File in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed in as query string parameters. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @en_US.json ``` Calls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score. The language detection will complete asynchronously. Prior to completion, the `detected_lang` value will be `zxx`, the reserved ISO 639-2 code for \"No linguistic content/not applicable\". If the language can not be determined, or the detection process fails, the `detected_lang` field will return `und`, the reserved ISO 639-2 code for undetermined language, and the `detected_lang_confidence` score will be `0`. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.upload_file_with_http_info(name, body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str name: A file name. (required)
- :param file body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
- :param str file_hash: A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.
- :param bool lang_id: Flag indicating whether to perform language detection on the uploaded file. Default is false.
- :param int project_id: The project to associate the uploaded file with.
- :param str category: The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.
- :param str labels: Comma-separated list of labels to add to the uploaded document.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_serialize(
+ name=name,
+ body=body,
+ file_hash=file_hash,
+ lang_id=lang_id,
+ project_id=project_id,
+ category=category,
+ labels=labels,
+ job_type=job_type,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '201': "SourceFile",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def upload_file_with_http_info(
+ self,
+ name: Annotated[StrictStr, Field(description="A file name.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file.")],
+ file_hash: Annotated[Optional[StrictStr], Field(description="A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.")] = None,
+ lang_id: Annotated[Optional[StrictBool], Field(description="Flag indicating whether to perform language detection on the uploaded file. Default is false.")] = None,
+ project_id: Annotated[Optional[StrictInt], Field(description="The project to associate the uploaded file with.")] = None,
+ category: Annotated[Optional[StrictStr], Field(description="The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.")] = None,
+ labels: Annotated[Optional[StrictStr], Field(description="Comma-separated list of labels to add to the uploaded document.")] = None,
+ job_type: Annotated[Optional[StrictStr], Field(description="Specifies the job type when adding this file to a job.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[SourceFile]:
+ """Upload a File
+
+ Upload a File in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed in as query string parameters. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @en_US.json ``` Calls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score. The language detection will complete asynchronously. Prior to completion, the `detected_lang` value will be `zxx`, the reserved ISO 639-2 code for \"No linguistic content/not applicable\". If the language can not be determined, or the detection process fails, the `detected_lang` field will return `und`, the reserved ISO 639-2 code for undetermined language, and the `detected_lang_confidence` score will be `0`.
+
+ :param name: A file name. (required)
+ :type name: str
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param file_hash: A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.
+ :type file_hash: str
+ :param lang_id: Flag indicating whether to perform language detection on the uploaded file. Default is false.
+ :type lang_id: bool
+ :param project_id: The project to associate the uploaded file with.
+ :type project_id: int
+ :param category: The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.
+ :type category: str
+ :param labels: Comma-separated list of labels to add to the uploaded document.
+ :type labels: str
+ :param job_type: Specifies the job type when adding this file to a job.
+ :type job_type: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(SourceFile, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
-
- local_var_params = locals()
-
- all_params = [
- 'name',
- 'body',
- 'file_hash',
- 'lang_id',
- 'project_id',
- 'category',
- 'labels'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_serialize(
+ name=name,
+ body=body,
+ file_hash=file_hash,
+ lang_id=lang_id,
+ project_id=project_id,
+ category=category,
+ labels=labels,
+ job_type=job_type,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '201': "SourceFile",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def upload_file_without_preload_content(
+ self,
+ name: Annotated[StrictStr, Field(description="A file name.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file.")],
+ file_hash: Annotated[Optional[StrictStr], Field(description="A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.")] = None,
+ lang_id: Annotated[Optional[StrictBool], Field(description="Flag indicating whether to perform language detection on the uploaded file. Default is false.")] = None,
+ project_id: Annotated[Optional[StrictInt], Field(description="The project to associate the uploaded file with.")] = None,
+ category: Annotated[Optional[StrictStr], Field(description="The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.")] = None,
+ labels: Annotated[Optional[StrictStr], Field(description="Comma-separated list of labels to add to the uploaded document.")] = None,
+ job_type: Annotated[Optional[StrictStr], Field(description="Specifies the job type when adding this file to a job.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Upload a File
+
+ Upload a File in any of the formats [documented in our knowledge base](https://support.lilt.com/hc/en-us/articles/360020816253-File-Formats). Request parameters should be passed in as query string parameters. Example CURL command: ```bash curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @en_US.json ``` Calls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score. The language detection will complete asynchronously. Prior to completion, the `detected_lang` value will be `zxx`, the reserved ISO 639-2 code for \"No linguistic content/not applicable\". If the language can not be determined, or the detection process fails, the `detected_lang` field will return `und`, the reserved ISO 639-2 code for undetermined language, and the `detected_lang_confidence` score will be `0`.
+
+ :param name: A file name. (required)
+ :type name: str
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param file_hash: A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.
+ :type file_hash: str
+ :param lang_id: Flag indicating whether to perform language detection on the uploaded file. Default is false.
+ :type lang_id: bool
+ :param project_id: The project to associate the uploaded file with.
+ :type project_id: int
+ :param category: The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.
+ :type category: str
+ :param labels: Comma-separated list of labels to add to the uploaded document.
+ :type labels: str
+ :param job_type: Specifies the job type when adding this file to a job.
+ :type job_type: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_serialize(
+ name=name,
+ body=body,
+ file_hash=file_hash,
+ lang_id=lang_id,
+ project_id=project_id,
+ category=category,
+ labels=labels,
+ job_type=job_type,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method upload_file" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '201': "SourceFile",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _upload_file_serialize(
+ self,
+ name,
+ body,
+ file_hash,
+ lang_id,
+ project_id,
+ category,
+ labels,
+ job_type,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if name is not None:
+
+ _query_params.append(('name', name))
+
+ if file_hash is not None:
+
+ _query_params.append(('file_hash', file_hash))
+
+ if lang_id is not None:
+
+ _query_params.append(('langId', lang_id))
+
+ if project_id is not None:
+
+ _query_params.append(('project_id', project_id))
+
+ if category is not None:
+
+ _query_params.append(('category', category))
+
+ if labels is not None:
+
+ _query_params.append(('labels', labels))
+
+ if job_type is not None:
+
+ _query_params.append(('job_type', job_type))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ # convert to byte array if the input is a file name (str)
+ if isinstance(body, str):
+ with open(body, "rb") as _fp:
+ _body_params = _fp.read()
+ elif isinstance(body, tuple):
+ # drop the filename from the tuple
+ _body_params = body[1]
+ else:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/octet-stream'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'name' is set
- if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501
- local_var_params['name'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `name` when calling `upload_file`") # noqa: E501
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `upload_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'name' in local_var_params and local_var_params['name'] is not None: # noqa: E501
- query_params.append(('name', local_var_params['name'])) # noqa: E501
- if 'file_hash' in local_var_params and local_var_params['file_hash'] is not None: # noqa: E501
- query_params.append(('file_hash', local_var_params['file_hash'])) # noqa: E501
- if 'lang_id' in local_var_params and local_var_params['lang_id'] is not None: # noqa: E501
- query_params.append(('langId', local_var_params['lang_id'])) # noqa: E501
- if 'project_id' in local_var_params and local_var_params['project_id'] is not None: # noqa: E501
- query_params.append(('project_id', local_var_params['project_id'])) # noqa: E501
- if 'category' in local_var_params and local_var_params['category'] is not None: # noqa: E501
- query_params.append(('category', local_var_params['category'])) # noqa: E501
- if 'labels' in local_var_params and local_var_params['labels'] is not None: # noqa: E501
- query_params.append(('labels', local_var_params['labels'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/octet-stream']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/files', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='SourceFile', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/files',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/jobs_api.py b/lilt/api/jobs_api.py
index 3ef7acd..351b27c 100644
--- a/lilt/api/jobs_api.py
+++ b/lilt/api/jobs_api.py
@@ -3,1440 +3,3356 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-from __future__ import absolute_import
+ Do not edit the class manually.
+""" # noqa: E501
-import re # noqa: F401
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
-# python 2 and python 3 compatibility library
-import six
+from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr
+from typing import List, Optional, Union
+from typing_extensions import Annotated
+from lilt.models.job import Job
+from lilt.models.job_create_parameters import JobCreateParameters
+from lilt.models.job_delete_response import JobDeleteResponse
+from lilt.models.job_leverage_stats import JobLeverageStats
+from lilt.models.job_update_parameters import JobUpdateParameters
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
-class JobsApi(object):
+class JobsApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def archive_job(self, job_id, **kwargs): # noqa: E501
- """Archive a Job # noqa: E501
- Set job to archived, unassign all linguists and archive all projects and documents inside the job. It will return the archived job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/archive?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.archive_job(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ @validate_call
+ def archive_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Job:
+ """Archive a Job
+
+ Set job to archived, unassign all linguists and archive all projects and documents inside the job. It will return the archived job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/archive?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Job
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.archive_job_with_http_info(job_id, **kwargs) # noqa: E501
-
- def archive_job_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Archive a Job # noqa: E501
-
- Set job to archived, unassign all linguists and archive all projects and documents inside the job. It will return the archived job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/archive?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.archive_job_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._archive_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def archive_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Job]:
+ """Archive a Job
+
+ Set job to archived, unassign all linguists and archive all projects and documents inside the job. It will return the archived job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/archive?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Job, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._archive_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def archive_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Archive a Job
+
+ Set job to archived, unassign all linguists and archive all projects and documents inside the job. It will return the archived job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/archive?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._archive_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method archive_job" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `archive_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}/archive', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Job', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def create_job(self, body, **kwargs): # noqa: E501
- """Create a Job # noqa: E501
-
- Create a Job. A Job is a collection of Projects. A Job will contain multiple projects, based on the language pair. A Project is associated with exactly one Memory. Jobs appear in the Jobs dashboard of the web app. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"fileIds\": [5009, 5010, 5011], \"due\": \"2022-05-05T10:56:44.985Z\", \"srcLang\": \"en\", \"srcLocale\": \"US\", \"languagePairs\": [ { \"memoryId\": 3121, \"trgLang\": \"de\" }, { \"memoryId\": 2508, \"trgLang\": \"fr\" }, { \"memoryId\": 3037, \"trgLang\": \"zh\" } ] }' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.create_job(body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param JobCreateParameters body: (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _archive_job_serialize(
+ self,
+ job_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/jobs/{jobId}/archive',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def create_job(
+ self,
+ body: Annotated[JobCreateParameters, Field(description="The Job resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Job:
+ """Create a Job
+
+ Create a Job. A Job is a collection of Projects. A Job will contain multiple projects, based on the language pair. A Project is associated with exactly one Memory. Jobs appear in the Jobs dashboard of the web app. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"fileIds\": [5009, 5010, 5011], \"due\": \"2022-05-05T10:56:44.985Z\", \"srcLang\": \"en\", \"srcLocale\": \"US\", \"languagePairs\": [ { \"memoryId\": 3121, \"trgLang\": \"de\" }, { \"memoryId\": 2508, \"trgLang\": \"fr\" }, { \"memoryId\": 3037, \"trgLang\": \"zh\" } ] }' ```
+
+ :param body: The Job resource to create. (required)
+ :type body: JobCreateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Job
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.create_job_with_http_info(body, **kwargs) # noqa: E501
-
- def create_job_with_http_info(self, body, **kwargs): # noqa: E501
- """Create a Job # noqa: E501
-
- Create a Job. A Job is a collection of Projects. A Job will contain multiple projects, based on the language pair. A Project is associated with exactly one Memory. Jobs appear in the Jobs dashboard of the web app. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"fileIds\": [5009, 5010, 5011], \"due\": \"2022-05-05T10:56:44.985Z\", \"srcLang\": \"en\", \"srcLocale\": \"US\", \"languagePairs\": [ { \"memoryId\": 3121, \"trgLang\": \"de\" }, { \"memoryId\": 2508, \"trgLang\": \"fr\" }, { \"memoryId\": 3037, \"trgLang\": \"zh\" } ] }' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.create_job_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param JobCreateParameters body: (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_job_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def create_job_with_http_info(
+ self,
+ body: Annotated[JobCreateParameters, Field(description="The Job resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Job]:
+ """Create a Job
+
+ Create a Job. A Job is a collection of Projects. A Job will contain multiple projects, based on the language pair. A Project is associated with exactly one Memory. Jobs appear in the Jobs dashboard of the web app. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"fileIds\": [5009, 5010, 5011], \"due\": \"2022-05-05T10:56:44.985Z\", \"srcLang\": \"en\", \"srcLocale\": \"US\", \"languagePairs\": [ { \"memoryId\": 3121, \"trgLang\": \"de\" }, { \"memoryId\": 2508, \"trgLang\": \"fr\" }, { \"memoryId\": 3037, \"trgLang\": \"zh\" } ] }' ```
+
+ :param body: The Job resource to create. (required)
+ :type body: JobCreateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Job, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_job_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def create_job_without_preload_content(
+ self,
+ body: Annotated[JobCreateParameters, Field(description="The Job resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Create a Job
+
+ Create a Job. A Job is a collection of Projects. A Job will contain multiple projects, based on the language pair. A Project is associated with exactly one Memory. Jobs appear in the Jobs dashboard of the web app. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"fileIds\": [5009, 5010, 5011], \"due\": \"2022-05-05T10:56:44.985Z\", \"srcLang\": \"en\", \"srcLocale\": \"US\", \"languagePairs\": [ { \"memoryId\": 3121, \"trgLang\": \"de\" }, { \"memoryId\": 2508, \"trgLang\": \"fr\" }, { \"memoryId\": 3037, \"trgLang\": \"zh\" } ] }' ```
+
+ :param body: The Job resource to create. (required)
+ :type body: JobCreateParameters
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_job_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_job" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _create_job_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `create_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Job', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def delete_job(self, job_id, **kwargs): # noqa: E501
- """Delete a Job # noqa: E501
-
- Delete a job, deletes all projects and documents in the job, deletes all the segments from all the job's translation memories. Example CURL command: ```bash curl -X DELETE 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_job(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/jobs',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def delete_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> JobDeleteResponse:
+ """Delete a Job
+
+ Delete a job, deletes all projects and documents in the job, deletes all the segments from all the job's translation memories. Example CURL command: ```bash curl -X DELETE 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: JobDeleteResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_job_with_http_info(job_id, **kwargs) # noqa: E501
-
- def delete_job_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Delete a Job # noqa: E501
-
- Delete a job, deletes all projects and documents in the job, deletes all the segments from all the job's translation memories. Example CURL command: ```bash curl -X DELETE 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_job_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "JobDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[JobDeleteResponse]:
+ """Delete a Job
+
+ Delete a job, deletes all projects and documents in the job, deletes all the segments from all the job's translation memories. Example CURL command: ```bash curl -X DELETE 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(JobDeleteResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "JobDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def delete_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete a Job
+
+ Delete a job, deletes all projects and documents in the job, deletes all the segments from all the job's translation memories. Example CURL command: ```bash curl -X DELETE 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_job" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `delete_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='JobDeleteResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def deliver_job(self, job_id, **kwargs): # noqa: E501
- """Deliver a Job # noqa: E501
-
- Set the job state to delivered and set all the projects in the job to done It will return the delivered job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/deliver?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.deliver_job(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "JobDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_job_serialize(
+ self,
+ job_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/v2/jobs/{jobId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def deliver_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Job:
+ """Deliver a Job
+
+ Set the job state to delivered and set all the projects in the job to done It will return the delivered job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/deliver?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Job
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.deliver_job_with_http_info(job_id, **kwargs) # noqa: E501
-
- def deliver_job_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Deliver a Job # noqa: E501
-
- Set the job state to delivered and set all the projects in the job to done It will return the delivered job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/deliver?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.deliver_job_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._deliver_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def deliver_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Job]:
+ """Deliver a Job
+
+ Set the job state to delivered and set all the projects in the job to done It will return the delivered job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/deliver?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Job, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._deliver_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def deliver_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Deliver a Job
+
+ Set the job state to delivered and set all the projects in the job to done It will return the delivered job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/deliver?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._deliver_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method deliver_job" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `deliver_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}/deliver', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Job', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def download_job(self, job_id, **kwargs): # noqa: E501
- """Download a Job # noqa: E501
-
- Make sure you have exported a job with the same id before using this api. Downloading files requires the exported job `id` in the param. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/download?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_job(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _deliver_job_serialize(
+ self,
+ job_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/jobs/{jobId}/deliver',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def download_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> bytearray:
+ """Download a Job
+
+ Make sure you have exported a job with the same id before using this api. Downloading files requires the exported job `id` in the param. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/download?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: str
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.download_job_with_http_info(job_id, **kwargs) # noqa: E501
-
- def download_job_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Download a Job # noqa: E501
-
- Make sure you have exported a job with the same id before using this api. Downloading files requires the exported job `id` in the param. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/download?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_job_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def download_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[bytearray]:
+ """Download a Job
+
+ Make sure you have exported a job with the same id before using this api. Downloading files requires the exported job `id` in the param. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/download?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(str, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def download_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Download a Job
+
+ Make sure you have exported a job with the same id before using this api. Downloading files requires the exported job `id` in the param. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/download?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method download_job" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `download_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}/download', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='str', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def export_job(self, job_id, type, **kwargs): # noqa: E501
- """Export a Job # noqa: E501
-
- Prepare job files for download. To export translated documents from the job use the query parameter `type=files`: Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/export?key=API_KEY&type=files' ``` To export job memories use the query parameter `type=memory`. The status of the export can be checked by requesting the job `GET /jobs/:jobId`, `job.isProcessing` will be `1` while in progress, `0` when idle and `-2` when the export failed. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.export_job(job_id, type, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param str type: category for files and memory. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _download_job_serialize(
+ self,
+ job_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/jobs/{jobId}/download',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def export_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ type: Annotated[StrictStr, Field(description="category for files and memory.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Export a Job
+
+ Prepare job files for download. To export translated documents from the job use the query parameter `type=files`: Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/export?key=API_KEY&type=files' ``` To export job memories use the query parameter `type=memory`. The status of the export can be checked by requesting the job `GET /jobs/:jobId`, `job.isProcessing` will be `1` while in progress, `0` when idle and `-2` when the export failed.
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param type: category for files and memory. (required)
+ :type type: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.export_job_with_http_info(job_id, type, **kwargs) # noqa: E501
-
- def export_job_with_http_info(self, job_id, type, **kwargs): # noqa: E501
- """Export a Job # noqa: E501
-
- Prepare job files for download. To export translated documents from the job use the query parameter `type=files`: Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/export?key=API_KEY&type=files' ``` To export job memories use the query parameter `type=memory`. The status of the export can be checked by requesting the job `GET /jobs/:jobId`, `job.isProcessing` will be `1` while in progress, `0` when idle and `-2` when the export failed. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.export_job_with_http_info(job_id, type, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param str type: category for files and memory. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._export_job_serialize(
+ job_id=job_id,
+ type=type,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def export_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ type: Annotated[StrictStr, Field(description="category for files and memory.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Export a Job
+
+ Prepare job files for download. To export translated documents from the job use the query parameter `type=files`: Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/export?key=API_KEY&type=files' ``` To export job memories use the query parameter `type=memory`. The status of the export can be checked by requesting the job `GET /jobs/:jobId`, `job.isProcessing` will be `1` while in progress, `0` when idle and `-2` when the export failed.
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param type: category for files and memory. (required)
+ :type type: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: None
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._export_job_serialize(
+ job_id=job_id,
+ type=type,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id',
- 'type'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def export_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ type: Annotated[StrictStr, Field(description="category for files and memory.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Export a Job
+
+ Prepare job files for download. To export translated documents from the job use the query parameter `type=files`: Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}/export?key=API_KEY&type=files' ``` To export job memories use the query parameter `type=memory`. The status of the export can be checked by requesting the job `GET /jobs/:jobId`, `job.isProcessing` will be `1` while in progress, `0` when idle and `-2` when the export failed.
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param type: category for files and memory. (required)
+ :type type: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._export_job_serialize(
+ job_id=job_id,
+ type=type,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method export_job" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `export_job`") # noqa: E501
- # verify the required parameter 'type' is set
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
- local_var_params['type'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `type` when calling `export_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
- if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501
- query_params.append(('type', local_var_params['type'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}/export', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type=None, # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def get_job(self, job_id, **kwargs): # noqa: E501
- """Retrieve a Job # noqa: E501
-
- Retrieves a job data along with stats. To retrieve a specific job, you will need the job `id` in the url path. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_job(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _export_job_serialize(
+ self,
+ job_id,
+ type,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ if type is not None:
+
+ _query_params.append(('type', type))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/jobs/{jobId}/export',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Job:
+ """Retrieve a Job
+
+ Retrieves a job data along with stats. To retrieve a specific job, you will need the job `id` in the url path. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Job
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_job_with_http_info(job_id, **kwargs) # noqa: E501
-
- def get_job_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Retrieve a Job # noqa: E501
-
- Retrieves a job data along with stats. To retrieve a specific job, you will need the job `id` in the url path. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_job_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Job]:
+ """Retrieve a Job
+
+ Retrieves a job data along with stats. To retrieve a specific job, you will need the job `id` in the url path. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Job, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def get_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve a Job
+
+ Retrieves a job data along with stats. To retrieve a specific job, you will need the job `id` in the url path. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_job" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `get_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Job', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def get_job_leverage_stats(self, job_id, **kwargs): # noqa: E501
- """Retrieve Job Leverage Stats # noqa: E501
-
- Get the TM leverage stats for the job (new/exact/fuzzy matches). Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/stats?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_job_leverage_stats(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_job_serialize(
+ self,
+ job_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/jobs/{jobId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_job_leverage_stats(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> JobLeverageStats:
+ """Retrieve Job Leverage Stats
+
+ Get the TM leverage stats for the job (new/exact/fuzzy matches). Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/stats?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: JobLeverageStats
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_job_leverage_stats_with_http_info(job_id, **kwargs) # noqa: E501
-
- def get_job_leverage_stats_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Retrieve Job Leverage Stats # noqa: E501
-
- Get the TM leverage stats for the job (new/exact/fuzzy matches). Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/stats?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_job_leverage_stats_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_job_leverage_stats_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "JobLeverageStats",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_job_leverage_stats_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[JobLeverageStats]:
+ """Retrieve Job Leverage Stats
+
+ Get the TM leverage stats for the job (new/exact/fuzzy matches). Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/stats?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(JobLeverageStats, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_job_leverage_stats_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "JobLeverageStats",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def get_job_leverage_stats_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve Job Leverage Stats
+
+ Get the TM leverage stats for the job (new/exact/fuzzy matches). Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/stats?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_job_leverage_stats_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_job_leverage_stats" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `get_job_leverage_stats`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}/stats', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='JobLeverageStats', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def reactivate_job(self, job_id, **kwargs): # noqa: E501
- """Reactivate a Job # noqa: E501
-
- Set the job state to active. Does not change the state of projects associated with the given job. It will return the reactivated job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/reactivate?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.reactivate_job(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "JobLeverageStats",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_job_leverage_stats_serialize(
+ self,
+ job_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/jobs/{jobId}/stats',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def reactivate_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Job:
+ """Reactivate a Job
+
+ Set the job state to active. Does not change the state of projects associated with the given job. It will return the reactivated job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/reactivate?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Job
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.reactivate_job_with_http_info(job_id, **kwargs) # noqa: E501
-
- def reactivate_job_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Reactivate a Job # noqa: E501
-
- Set the job state to active. Does not change the state of projects associated with the given job. It will return the reactivated job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/reactivate?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.reactivate_job_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._reactivate_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def reactivate_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Job]:
+ """Reactivate a Job
+
+ Set the job state to active. Does not change the state of projects associated with the given job. It will return the reactivated job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/reactivate?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Job, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._reactivate_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id'
+
+ @validate_call
+ def reactivate_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Reactivate a Job
+
+ Set the job state to active. Does not change the state of projects associated with the given job. It will return the reactivated job. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/reactivate?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._reactivate_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _reactivate_job_serialize(
+ self,
+ job_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/jobs/{jobId}/reactivate',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def retrieve_all_jobs(
+ self,
+ is_archived: Annotated[Optional[StrictBool], Field(description="Retrieves all jobs that are archived.")] = None,
+ is_delivered: Annotated[Optional[StrictBool], Field(description="Retrieves all jobs that are delivered.")] = None,
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Return jobs starting at the offset row. If not given the default offset will be 0.")] = None,
+ limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True)]], Field(description="The maximum number of jobs to be returned. If not given the default limit will be 25.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[Job]:
+ """Retrieve all Jobs
+
+ Get all Jobs within a given offset and limit. You can retrieve jobs from your account using the above API. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs?key=API_KEY&isArchived=false' ```
+
+ :param is_archived: Retrieves all jobs that are archived.
+ :type is_archived: bool
+ :param is_delivered: Retrieves all jobs that are delivered.
+ :type is_delivered: bool
+ :param offset: Return jobs starting at the offset row. If not given the default offset will be 0.
+ :type offset: int
+ :param limit: The maximum number of jobs to be returned. If not given the default limit will be 25.
+ :type limit: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._retrieve_all_jobs_serialize(
+ is_archived=is_archived,
+ is_delivered=is_delivered,
+ offset=offset,
+ limit=limit,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method reactivate_job" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `reactivate_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}/reactivate', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Job', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def retrieve_all_jobs(self, **kwargs): # noqa: E501
- """Retrieve all Jobs # noqa: E501
-
- Get all Jobs within a given offset and limit. You can retrieve jobs from your account using the above API. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs?key=API_KEY&isArchived=false' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.retrieve_all_jobs(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param bool is_archived: Retrieves all jobs that are archived.
- :param bool is_delivered: Retrieves all jobs that are delivered.
- :param int offset: Return jobs starting at the offset row. If not given the default offset will be 0.
- :param int limit: The maximum number of jobs to be returned. If not given the default limit will be 25.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Job]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def retrieve_all_jobs_with_http_info(
+ self,
+ is_archived: Annotated[Optional[StrictBool], Field(description="Retrieves all jobs that are archived.")] = None,
+ is_delivered: Annotated[Optional[StrictBool], Field(description="Retrieves all jobs that are delivered.")] = None,
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Return jobs starting at the offset row. If not given the default offset will be 0.")] = None,
+ limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True)]], Field(description="The maximum number of jobs to be returned. If not given the default limit will be 25.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[Job]]:
+ """Retrieve all Jobs
+
+ Get all Jobs within a given offset and limit. You can retrieve jobs from your account using the above API. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs?key=API_KEY&isArchived=false' ```
+
+ :param is_archived: Retrieves all jobs that are archived.
+ :type is_archived: bool
+ :param is_delivered: Retrieves all jobs that are delivered.
+ :type is_delivered: bool
+ :param offset: Return jobs starting at the offset row. If not given the default offset will be 0.
+ :type offset: int
+ :param limit: The maximum number of jobs to be returned. If not given the default limit will be 25.
+ :type limit: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: list[Job]
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.retrieve_all_jobs_with_http_info(**kwargs) # noqa: E501
-
- def retrieve_all_jobs_with_http_info(self, **kwargs): # noqa: E501
- """Retrieve all Jobs # noqa: E501
-
- Get all Jobs within a given offset and limit. You can retrieve jobs from your account using the above API. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs?key=API_KEY&isArchived=false' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.retrieve_all_jobs_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param bool is_archived: Retrieves all jobs that are archived.
- :param bool is_delivered: Retrieves all jobs that are delivered.
- :param int offset: Return jobs starting at the offset row. If not given the default offset will be 0.
- :param int limit: The maximum number of jobs to be returned. If not given the default limit will be 25.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._retrieve_all_jobs_serialize(
+ is_archived=is_archived,
+ is_delivered=is_delivered,
+ offset=offset,
+ limit=limit,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Job]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def retrieve_all_jobs_without_preload_content(
+ self,
+ is_archived: Annotated[Optional[StrictBool], Field(description="Retrieves all jobs that are archived.")] = None,
+ is_delivered: Annotated[Optional[StrictBool], Field(description="Retrieves all jobs that are delivered.")] = None,
+ offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Return jobs starting at the offset row. If not given the default offset will be 0.")] = None,
+ limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True)]], Field(description="The maximum number of jobs to be returned. If not given the default limit will be 25.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve all Jobs
+
+ Get all Jobs within a given offset and limit. You can retrieve jobs from your account using the above API. Example CURL command: ```bash curl -X GET 'https://api.lilt.com/v2/jobs?key=API_KEY&isArchived=false' ```
+
+ :param is_archived: Retrieves all jobs that are archived.
+ :type is_archived: bool
+ :param is_delivered: Retrieves all jobs that are delivered.
+ :type is_delivered: bool
+ :param offset: Return jobs starting at the offset row. If not given the default offset will be 0.
+ :type offset: int
+ :param limit: The maximum number of jobs to be returned. If not given the default limit will be 25.
+ :type limit: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(list[Job], status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
-
- local_var_params = locals()
-
- all_params = [
- 'is_archived',
- 'is_delivered',
- 'offset',
- 'limit'
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._retrieve_all_jobs_serialize(
+ is_archived=is_archived,
+ is_delivered=is_delivered,
+ offset=offset,
+ limit=limit,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Job]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _retrieve_all_jobs_serialize(
+ self,
+ is_archived,
+ is_delivered,
+ offset,
+ limit,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if is_archived is not None:
+
+ _query_params.append(('isArchived', is_archived))
+
+ if is_delivered is not None:
+
+ _query_params.append(('isDelivered', is_delivered))
+
+ if offset is not None:
+
+ _query_params.append(('offset', offset))
+
+ if limit is not None:
+
+ _query_params.append(('limit', limit))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
- ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/jobs',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method retrieve_all_jobs" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501
- raise ApiValueError("Invalid value for parameter `offset` when calling `retrieve_all_jobs`, must be a value greater than or equal to `0`") # noqa: E501
- if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 50: # noqa: E501
- raise ApiValueError("Invalid value for parameter `limit` when calling `retrieve_all_jobs`, must be a value less than or equal to `50`") # noqa: E501
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'is_archived' in local_var_params and local_var_params['is_archived'] is not None: # noqa: E501
- query_params.append(('isArchived', local_var_params['is_archived'])) # noqa: E501
- if 'is_delivered' in local_var_params and local_var_params['is_delivered'] is not None: # noqa: E501
- query_params.append(('isDelivered', local_var_params['is_delivered'])) # noqa: E501
- if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501
- query_params.append(('offset', local_var_params['offset'])) # noqa: E501
- if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
- query_params.append(('limit', local_var_params['limit'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='list[Job]', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def unarchive_job(self, job_id, **kwargs): # noqa: E501
- """Unarchive a Job # noqa: E501
-
- Set job to unarchived, the job will move to active status. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/unarchive?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.unarchive_job(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+
+
+
+ @validate_call
+ def unarchive_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Job:
+ """Unarchive a Job
+
+ Set job to unarchived, the job will move to active status. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/unarchive?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Job
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.unarchive_job_with_http_info(job_id, **kwargs) # noqa: E501
-
- def unarchive_job_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Unarchive a Job # noqa: E501
-
- Set job to unarchived, the job will move to active status. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/unarchive?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.unarchive_job_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._unarchive_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def unarchive_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Job]:
+ """Unarchive a Job
+
+ Set job to unarchived, the job will move to active status. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/unarchive?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Job, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._unarchive_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def unarchive_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Unarchive a Job
+
+ Set job to unarchived, the job will move to active status. Example CURL command: ```bash curl -X POST 'https://api.lilt.com/v2/jobs/{id}/unarchive?key=API_KEY' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._unarchive_job_serialize(
+ job_id=job_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method unarchive_job" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `unarchive_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}/unarchive', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Job', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def update_job(self, job_id, **kwargs): # noqa: E501
- """Update a Job # noqa: E501
-
- Updates a job with the new job properties. To update a specific job, you will need the job `id` in the url path. You can update job's name and due date by passing the property and new value in the body. Example CURL command: ```bash curl -X PUT 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"due\": \"2022-05-05T10:56:44.985Z\" }' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_job(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param JobUpdateParameters body:
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _unarchive_job_serialize(
+ self,
+ job_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/jobs/{jobId}/unarchive',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def update_job(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ body: Annotated[Optional[JobUpdateParameters], Field(description="The Job resource to update.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Job:
+ """Update a Job
+
+ Updates a job with the new job properties. To update a specific job, you will need the job `id` in the url path. You can update job's name and due date by passing the property and new value in the body. Example CURL command: ```bash curl -X PUT 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"due\": \"2022-05-05T10:56:44.985Z\" }' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param body: The Job resource to update.
+ :type body: JobUpdateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Job
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.update_job_with_http_info(job_id, **kwargs) # noqa: E501
-
- def update_job_with_http_info(self, job_id, **kwargs): # noqa: E501
- """Update a Job # noqa: E501
-
- Updates a job with the new job properties. To update a specific job, you will need the job `id` in the url path. You can update job's name and due date by passing the property and new value in the body. Example CURL command: ```bash curl -X PUT 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"due\": \"2022-05-05T10:56:44.985Z\" }' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_job_with_http_info(job_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int job_id: A job id. (required)
- :param JobUpdateParameters body:
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_job_serialize(
+ job_id=job_id,
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def update_job_with_http_info(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ body: Annotated[Optional[JobUpdateParameters], Field(description="The Job resource to update.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Job]:
+ """Update a Job
+
+ Updates a job with the new job properties. To update a specific job, you will need the job `id` in the url path. You can update job's name and due date by passing the property and new value in the body. Example CURL command: ```bash curl -X PUT 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"due\": \"2022-05-05T10:56:44.985Z\" }' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param body: The Job resource to update.
+ :type body: JobUpdateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Job, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_job_serialize(
+ job_id=job_id,
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'job_id',
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def update_job_without_preload_content(
+ self,
+ job_id: Annotated[StrictInt, Field(description="A job id.")],
+ body: Annotated[Optional[JobUpdateParameters], Field(description="The Job resource to update.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Update a Job
+
+ Updates a job with the new job properties. To update a specific job, you will need the job `id` in the url path. You can update job's name and due date by passing the property and new value in the body. Example CURL command: ```bash curl -X PUT 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"name\": \"test job\", \"due\": \"2022-05-05T10:56:44.985Z\" }' ```
+
+ :param job_id: A job id. (required)
+ :type job_id: int
+ :param body: The Job resource to update.
+ :type body: JobUpdateParameters
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_job_serialize(
+ job_id=job_id,
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_job" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Job",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _update_job_serialize(
+ self,
+ job_id,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if job_id is not None:
+ _path_params['jobId'] = job_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'job_id' is set
- if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501
- local_var_params['job_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `job_id` when calling `update_job`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
- if 'job_id' in local_var_params:
- path_params['jobId'] = local_var_params['job_id'] # noqa: E501
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/jobs/{jobId}', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Job', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/v2/jobs/{jobId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/languages_api.py b/lilt/api/languages_api.py
index 45f26da..7efaeed 100644
--- a/lilt/api/languages_api.py
+++ b/lilt/api/languages_api.py
@@ -3,140 +3,286 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-from __future__ import absolute_import
+ Do not edit the class manually.
+""" # noqa: E501
-import re # noqa: F401
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
-# python 2 and python 3 compatibility library
-import six
+from lilt.models.languages_response import LanguagesResponse
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
-class LanguagesApi(object):
+class LanguagesApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def get_languages(self, **kwargs): # noqa: E501
- """Retrieve supported languages # noqa: E501
- Get a list of supported languages. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_languages(async_req=True)
- >>> result = thread.get()
+ @validate_call
+ def get_languages(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> LanguagesResponse:
+ """Retrieve supported languages
+
+ Get a list of supported languages.
- :param async_req bool: execute request asynchronously
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: LanguagesResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_languages_with_http_info(**kwargs) # noqa: E501
-
- def get_languages_with_http_info(self, **kwargs): # noqa: E501
- """Retrieve supported languages # noqa: E501
-
- Get a list of supported languages. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_languages_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_languages_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LanguagesResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_languages_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[LanguagesResponse]:
+ """Retrieve supported languages
+
+ Get a list of supported languages.
+
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(LanguagesResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
- local_var_params = locals()
+ _param = self._get_languages_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LanguagesResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def get_languages_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve supported languages
+
+ Get a list of supported languages.
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_languages_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_languages" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/languages', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='LanguagesResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "LanguagesResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_languages_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/languages',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/memories_api.py b/lilt/api/memories_api.py
index 306a37a..9ec7a19 100644
--- a/lilt/api/memories_api.py
+++ b/lilt/api/memories_api.py
@@ -3,1126 +3,2637 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-
-import re # noqa: F401
-
-# python 2 and python 3 compatibility library
-import six
-
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-class MemoriesApi(object):
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr
+from typing import List, Optional, Tuple, Union
+from typing_extensions import Annotated
+from lilt.models.delete_segment_from_memory_response import DeleteSegmentFromMemoryResponse
+from lilt.models.memory import Memory
+from lilt.models.memory_create_parameters import MemoryCreateParameters
+from lilt.models.memory_delete_response import MemoryDeleteResponse
+from lilt.models.memory_import_response import MemoryImportResponse
+from lilt.models.memory_update_parameters import MemoryUpdateParameters
+from lilt.models.sdlxliff_filter import SDLXLIFFFilter
+from lilt.models.termbase_export_response import TermbaseExportResponse
+from lilt.models.translation_memory_entry import TranslationMemoryEntry
+
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
+
+
+class MemoriesApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def create_memory(self, body, **kwargs): # noqa: E501
- """Create a Memory # noqa: E501
-
- Create a new Memory. A Memory is a container that collects source/target sentences for a specific language pair (e.g., English>French). The data in the Memory is used to train the MT system, populate the TM, and update the lexicon. Memories are private to your account - the data is not shared across users - unless you explicitly share a Memory with your team (via web app only). Refer to our KB for a more detailed description. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.create_memory(body, async_req=True)
- >>> result = thread.get()
- :param async_req bool: execute request asynchronously
- :param MemoryCreateParameters body: (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ @validate_call
+ def create_memory(
+ self,
+ body: Annotated[MemoryCreateParameters, Field(description="The Memory resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Memory:
+ """Create a Memory
+
+ Create a new Memory. A Memory is a container that collects source/target sentences for a specific language pair (e.g., English>French). The data in the Memory is used to train the MT system, populate the TM, and update the lexicon. Memories are private to your account - the data is not shared across users - unless you explicitly share a Memory with your team (via web app only). Refer to our KB for a more detailed description.
+
+ :param body: The Memory resource to create. (required)
+ :type body: MemoryCreateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Memory
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.create_memory_with_http_info(body, **kwargs) # noqa: E501
-
- def create_memory_with_http_info(self, body, **kwargs): # noqa: E501
- """Create a Memory # noqa: E501
-
- Create a new Memory. A Memory is a container that collects source/target sentences for a specific language pair (e.g., English>French). The data in the Memory is used to train the MT system, populate the TM, and update the lexicon. Memories are private to your account - the data is not shared across users - unless you explicitly share a Memory with your team (via web app only). Refer to our KB for a more detailed description. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.create_memory_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param MemoryCreateParameters body: (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_memory_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Memory",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def create_memory_with_http_info(
+ self,
+ body: Annotated[MemoryCreateParameters, Field(description="The Memory resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Memory]:
+ """Create a Memory
+
+ Create a new Memory. A Memory is a container that collects source/target sentences for a specific language pair (e.g., English>French). The data in the Memory is used to train the MT system, populate the TM, and update the lexicon. Memories are private to your account - the data is not shared across users - unless you explicitly share a Memory with your team (via web app only). Refer to our KB for a more detailed description.
+
+ :param body: The Memory resource to create. (required)
+ :type body: MemoryCreateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Memory, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_memory_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Memory",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def create_memory_without_preload_content(
+ self,
+ body: Annotated[MemoryCreateParameters, Field(description="The Memory resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Create a Memory
+
+ Create a new Memory. A Memory is a container that collects source/target sentences for a specific language pair (e.g., English>French). The data in the Memory is used to train the MT system, populate the TM, and update the lexicon. Memories are private to your account - the data is not shared across users - unless you explicitly share a Memory with your team (via web app only). Refer to our KB for a more detailed description.
+
+ :param body: The Memory resource to create. (required)
+ :type body: MemoryCreateParameters
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_memory_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_memory" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Memory",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _create_memory_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `create_memory`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Memory', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def delete_memory(self, id, **kwargs): # noqa: E501
- """Delete a Memory # noqa: E501
-
- Delete a Memory. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_memory(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/memories',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def delete_memory(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> MemoryDeleteResponse:
+ """Delete a Memory
+
+ Delete a Memory.
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: MemoryDeleteResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_memory_with_http_info(id, **kwargs) # noqa: E501
-
- def delete_memory_with_http_info(self, id, **kwargs): # noqa: E501
- """Delete a Memory # noqa: E501
-
- Delete a Memory. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_memory_with_http_info(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_memory_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "MemoryDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_memory_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[MemoryDeleteResponse]:
+ """Delete a Memory
+
+ Delete a Memory.
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(MemoryDeleteResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_memory_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "MemoryDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def delete_memory_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete a Memory
+
+ Delete a Memory.
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_memory_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_memory" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `delete_memory`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='MemoryDeleteResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def delete_segment_from_memory(self, id, segment_id, **kwargs): # noqa: E501
- """Delete a segment from a memory. # noqa: E501
-
- Delete a segment from a memory. ```bash curl -X DELETE https://api.lilt.com/v2/memories/segment?key=API_KEY&id=ID&segment_id=$SEGMENT_ID ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_segment_from_memory(id, segment_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param int segment_id: A unique Segment identifier. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "MemoryDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_memory_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/v2/memories',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def delete_segment_from_memory(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ segment_id: Annotated[StrictInt, Field(description="A unique Segment identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> DeleteSegmentFromMemoryResponse:
+ """Delete a segment from a memory.
+
+ Delete a segment from a memory. ```bash curl -X DELETE https://api.lilt.com/v2/memories/segment?key=API_KEY&id=ID&segment_id=$SEGMENT_ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param segment_id: A unique Segment identifier. (required)
+ :type segment_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: DeleteSegmentFromMemoryResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_segment_from_memory_with_http_info(id, segment_id, **kwargs) # noqa: E501
-
- def delete_segment_from_memory_with_http_info(self, id, segment_id, **kwargs): # noqa: E501
- """Delete a segment from a memory. # noqa: E501
-
- Delete a segment from a memory. ```bash curl -X DELETE https://api.lilt.com/v2/memories/segment?key=API_KEY&id=ID&segment_id=$SEGMENT_ID ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_segment_from_memory_with_http_info(id, segment_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param int segment_id: A unique Segment identifier. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_segment_from_memory_serialize(
+ id=id,
+ segment_id=segment_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DeleteSegmentFromMemoryResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_segment_from_memory_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ segment_id: Annotated[StrictInt, Field(description="A unique Segment identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[DeleteSegmentFromMemoryResponse]:
+ """Delete a segment from a memory.
+
+ Delete a segment from a memory. ```bash curl -X DELETE https://api.lilt.com/v2/memories/segment?key=API_KEY&id=ID&segment_id=$SEGMENT_ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param segment_id: A unique Segment identifier. (required)
+ :type segment_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(DeleteSegmentFromMemoryResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_segment_from_memory_serialize(
+ id=id,
+ segment_id=segment_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DeleteSegmentFromMemoryResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- local_var_params = locals()
- all_params = [
- 'id',
- 'segment_id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ @validate_call
+ def delete_segment_from_memory_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ segment_id: Annotated[StrictInt, Field(description="A unique Segment identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete a segment from a memory.
+
+ Delete a segment from a memory. ```bash curl -X DELETE https://api.lilt.com/v2/memories/segment?key=API_KEY&id=ID&segment_id=$SEGMENT_ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param segment_id: A unique Segment identifier. (required)
+ :type segment_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_segment_from_memory_serialize(
+ id=id,
+ segment_id=segment_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_segment_from_memory" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `delete_segment_from_memory`") # noqa: E501
- # verify the required parameter 'segment_id' is set
- if self.api_client.client_side_validation and ('segment_id' not in local_var_params or # noqa: E501
- local_var_params['segment_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `segment_id` when calling `delete_segment_from_memory`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
- if 'segment_id' in local_var_params and local_var_params['segment_id'] is not None: # noqa: E501
- query_params.append(('segment_id', local_var_params['segment_id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories/segment', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='DeleteSegmentFromMemoryResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def download_termbase(self, id, **kwargs): # noqa: E501
- """Termbase download for a Memory # noqa: E501
-
- Downloads the termbase export for the given memory as a CSV file. Ensure you first call the `/2/memories/termbase/export` endpoint to start the export process before you try to download it. ```bash curl -X GET https://api.lilt.com/v2/memories/termbase/download?key=API_KEY&id=ID ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_termbase(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "DeleteSegmentFromMemoryResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_segment_from_memory_serialize(
+ self,
+ id,
+ segment_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ if segment_id is not None:
+
+ _query_params.append(('segment_id', segment_id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/v2/memories/segment',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def download_termbase(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> bytearray:
+ """Termbase download for a Memory
+
+ Downloads the termbase export for the given memory as a CSV file. Ensure you first call the `/2/memories/termbase/export` endpoint to start the export process before you try to download it. ```bash curl -X GET https://api.lilt.com/v2/memories/termbase/download?key=API_KEY&id=ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: str
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.download_termbase_with_http_info(id, **kwargs) # noqa: E501
-
- def download_termbase_with_http_info(self, id, **kwargs): # noqa: E501
- """Termbase download for a Memory # noqa: E501
-
- Downloads the termbase export for the given memory as a CSV file. Ensure you first call the `/2/memories/termbase/export` endpoint to start the export process before you try to download it. ```bash curl -X GET https://api.lilt.com/v2/memories/termbase/download?key=API_KEY&id=ID ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_termbase_with_http_info(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_termbase_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def download_termbase_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[bytearray]:
+ """Termbase download for a Memory
+
+ Downloads the termbase export for the given memory as a CSV file. Ensure you first call the `/2/memories/termbase/export` endpoint to start the export process before you try to download it. ```bash curl -X GET https://api.lilt.com/v2/memories/termbase/download?key=API_KEY&id=ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(str, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_termbase_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def download_termbase_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Termbase download for a Memory
+
+ Downloads the termbase export for the given memory as a CSV file. Ensure you first call the `/2/memories/termbase/export` endpoint to start the export process before you try to download it. ```bash curl -X GET https://api.lilt.com/v2/memories/termbase/download?key=API_KEY&id=ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_termbase_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method download_termbase" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `download_termbase`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories/termbase/download', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='str', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def export_termbase(self, id, **kwargs): # noqa: E501
- """Termbase export for a Memory # noqa: E501
-
- Exports the termbase entries for the given memory into a CSV file. Calling this endpoint will begin the export process in the background. Check that the processing is complete by polling the `GET /2/memories` endpoint. When the `is_processing` value is 0 then call the `POST /2/memories/termbase/download` endpoint. ```bash curl -X POST https://api.lilt.com/v2/memories/termbase/export?key=API_KEY&id=ID ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.export_termbase(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _download_termbase_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/memories/termbase/download',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def export_termbase(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> TermbaseExportResponse:
+ """Termbase export for a Memory
+
+ Exports the termbase entries for the given memory into a CSV file. Calling this endpoint will begin the export process in the background. Check that the processing is complete by polling the `GET /2/memories` endpoint. When the `is_processing` value is 0 then call the `POST /2/memories/termbase/download` endpoint. ```bash curl -X POST https://api.lilt.com/v2/memories/termbase/export?key=API_KEY&id=ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: TermbaseExportResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.export_termbase_with_http_info(id, **kwargs) # noqa: E501
-
- def export_termbase_with_http_info(self, id, **kwargs): # noqa: E501
- """Termbase export for a Memory # noqa: E501
-
- Exports the termbase entries for the given memory into a CSV file. Calling this endpoint will begin the export process in the background. Check that the processing is complete by polling the `GET /2/memories` endpoint. When the `is_processing` value is 0 then call the `POST /2/memories/termbase/download` endpoint. ```bash curl -X POST https://api.lilt.com/v2/memories/termbase/export?key=API_KEY&id=ID ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.export_termbase_with_http_info(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._export_termbase_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "TermbaseExportResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def export_termbase_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[TermbaseExportResponse]:
+ """Termbase export for a Memory
+
+ Exports the termbase entries for the given memory into a CSV file. Calling this endpoint will begin the export process in the background. Check that the processing is complete by polling the `GET /2/memories` endpoint. When the `is_processing` value is 0 then call the `POST /2/memories/termbase/download` endpoint. ```bash curl -X POST https://api.lilt.com/v2/memories/termbase/export?key=API_KEY&id=ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(TermbaseExportResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._export_termbase_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "TermbaseExportResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def export_termbase_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Termbase export for a Memory
+
+ Exports the termbase entries for the given memory into a CSV file. Calling this endpoint will begin the export process in the background. Check that the processing is complete by polling the `GET /2/memories` endpoint. When the `is_processing` value is 0 then call the `POST /2/memories/termbase/download` endpoint. ```bash curl -X POST https://api.lilt.com/v2/memories/termbase/export?key=API_KEY&id=ID ```
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._export_termbase_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method export_termbase" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `export_termbase`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories/termbase/export', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='TermbaseExportResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def get_memory(self, **kwargs): # noqa: E501
- """Retrieve a Memory # noqa: E501
-
- Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory). # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_memory(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: An optional Memory identifier.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "TermbaseExportResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _export_termbase_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/memories/termbase/export',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_memory(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="An optional Memory identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[Memory]:
+ """Retrieve a Memory
+
+ Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory).
+
+ :param id: An optional Memory identifier.
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: list[Memory]
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_memory_with_http_info(**kwargs) # noqa: E501
-
- def get_memory_with_http_info(self, **kwargs): # noqa: E501
- """Retrieve a Memory # noqa: E501
-
- Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory). # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_memory_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: An optional Memory identifier.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_memory_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Memory]",
+ '401': "str",
+ '404': "Error",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_memory_with_http_info(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="An optional Memory identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[Memory]]:
+ """Retrieve a Memory
+
+ Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory).
+
+ :param id: An optional Memory identifier.
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(list[Memory], status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_memory_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Memory]",
+ '401': "str",
+ '404': "Error",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- local_var_params = locals()
- all_params = [
- 'id'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ @validate_call
+ def get_memory_without_preload_content(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="An optional Memory identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve a Memory
+
+ Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory).
+
+ :param id: An optional Memory identifier.
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_memory_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_memory" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='list[Memory]', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def import_memory_file(self, memory_id, name, body, **kwargs): # noqa: E501
- """File import for a Memory # noqa: E501
-
- Imports common translation memory or termbase file formats to a specific Lilt memory. Currently supported file formats are `*.tmx`, `*.sdltm`, `*.sdlxliff`(With custom Filters), '*.xliff', and `*.tmq` for TM data; `*.csv` and `*.tbx` for termbase data. Request parameters should be passed as JSON object with the header field `LILT-API`. Example CURL command to upload a translation memory file named `my_memory.sdltm` in the current working directory: ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdltm\\\",\\\"memory_id\\\": 42}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdltm ``` Example CURL command to upload a translation memory file named `my_memory.sdlxliff` in the current working directory, with Custom Filters based on SDLXLIFF fields, conf_name which maps to, percentage, and whether we should ignore unlocked segments. ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdlxliff\\\",\\\"memory_id\\\": 12,\\\"sdlxliff_filters\\\":[{\\\"conf_name\\\": \\\"Translated\\\", \\\"percentage\\\": 100, \\\"allow_unlocked\\\": false}]\"}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdlxliff ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.import_memory_file(memory_id, name, body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int memory_id: A unique Memory identifier. (required)
- :param str name: Name of the TM or termbase file. (required)
- :param file body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
- :param list[SDLXLIFFFilter] sdlxliff_filters: Contains Filter information Unique to SDLXLIFF
- :param bool has_header_row: A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).
- :param bool skip_duplicates: A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`).
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Memory]",
+ '401': "str",
+ '404': "Error",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_memory_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/memories',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def import_memory_file(
+ self,
+ memory_id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ name: Annotated[StrictStr, Field(description="Name of the TM or termbase file.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file.")],
+ sdlxliff_filters: Annotated[Optional[List[SDLXLIFFFilter]], Field(description="Contains Filter information Unique to SDLXLIFF")] = None,
+ has_header_row: Annotated[Optional[StrictBool], Field(description="A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).")] = None,
+ skip_duplicates: Annotated[Optional[StrictBool], Field(description="A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`). ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> MemoryImportResponse:
+ """File import for a Memory
+
+ Imports common translation memory or termbase file formats to a specific Lilt memory. Currently supported file formats are `*.tmx`, `*.sdltm`, `*.sdlxliff`(With custom Filters), '*.xliff', and `*.tmq` for TM data; `*.csv` and `*.tbx` for termbase data. Request parameters should be passed as JSON object with the header field `LILT-API`. Example CURL command to upload a translation memory file named `my_memory.sdltm` in the current working directory: ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdltm\\\",\\\"memory_id\\\": 42}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdltm ``` Example CURL command to upload a translation memory file named `my_memory.sdlxliff` in the current working directory, with Custom Filters based on SDLXLIFF fields, conf_name which maps to, percentage, and whether we should ignore unlocked segments. ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdlxliff\\\",\\\"memory_id\\\": 12,\\\"sdlxliff_filters\\\":[{\\\"conf_name\\\": \\\"Translated\\\", \\\"percentage\\\": 100, \\\"allow_unlocked\\\": false}]\"}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdlxliff ```
+
+ :param memory_id: A unique Memory identifier. (required)
+ :type memory_id: int
+ :param name: Name of the TM or termbase file. (required)
+ :type name: str
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param sdlxliff_filters: Contains Filter information Unique to SDLXLIFF
+ :type sdlxliff_filters: List[SDLXLIFFFilter]
+ :param has_header_row: A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).
+ :type has_header_row: bool
+ :param skip_duplicates: A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`).
+ :type skip_duplicates: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: MemoryImportResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.import_memory_file_with_http_info(memory_id, name, body, **kwargs) # noqa: E501
-
- def import_memory_file_with_http_info(self, memory_id, name, body, **kwargs): # noqa: E501
- """File import for a Memory # noqa: E501
-
- Imports common translation memory or termbase file formats to a specific Lilt memory. Currently supported file formats are `*.tmx`, `*.sdltm`, `*.sdlxliff`(With custom Filters), '*.xliff', and `*.tmq` for TM data; `*.csv` and `*.tbx` for termbase data. Request parameters should be passed as JSON object with the header field `LILT-API`. Example CURL command to upload a translation memory file named `my_memory.sdltm` in the current working directory: ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdltm\\\",\\\"memory_id\\\": 42}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdltm ``` Example CURL command to upload a translation memory file named `my_memory.sdlxliff` in the current working directory, with Custom Filters based on SDLXLIFF fields, conf_name which maps to, percentage, and whether we should ignore unlocked segments. ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdlxliff\\\",\\\"memory_id\\\": 12,\\\"sdlxliff_filters\\\":[{\\\"conf_name\\\": \\\"Translated\\\", \\\"percentage\\\": 100, \\\"allow_unlocked\\\": false}]\"}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdlxliff ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.import_memory_file_with_http_info(memory_id, name, body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int memory_id: A unique Memory identifier. (required)
- :param str name: Name of the TM or termbase file. (required)
- :param file body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
- :param list[SDLXLIFFFilter] sdlxliff_filters: Contains Filter information Unique to SDLXLIFF
- :param bool has_header_row: A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).
- :param bool skip_duplicates: A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`).
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._import_memory_file_serialize(
+ memory_id=memory_id,
+ name=name,
+ body=body,
+ sdlxliff_filters=sdlxliff_filters,
+ has_header_row=has_header_row,
+ skip_duplicates=skip_duplicates,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "MemoryImportResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def import_memory_file_with_http_info(
+ self,
+ memory_id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ name: Annotated[StrictStr, Field(description="Name of the TM or termbase file.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file.")],
+ sdlxliff_filters: Annotated[Optional[List[SDLXLIFFFilter]], Field(description="Contains Filter information Unique to SDLXLIFF")] = None,
+ has_header_row: Annotated[Optional[StrictBool], Field(description="A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).")] = None,
+ skip_duplicates: Annotated[Optional[StrictBool], Field(description="A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`). ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[MemoryImportResponse]:
+ """File import for a Memory
+
+ Imports common translation memory or termbase file formats to a specific Lilt memory. Currently supported file formats are `*.tmx`, `*.sdltm`, `*.sdlxliff`(With custom Filters), '*.xliff', and `*.tmq` for TM data; `*.csv` and `*.tbx` for termbase data. Request parameters should be passed as JSON object with the header field `LILT-API`. Example CURL command to upload a translation memory file named `my_memory.sdltm` in the current working directory: ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdltm\\\",\\\"memory_id\\\": 42}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdltm ``` Example CURL command to upload a translation memory file named `my_memory.sdlxliff` in the current working directory, with Custom Filters based on SDLXLIFF fields, conf_name which maps to, percentage, and whether we should ignore unlocked segments. ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdlxliff\\\",\\\"memory_id\\\": 12,\\\"sdlxliff_filters\\\":[{\\\"conf_name\\\": \\\"Translated\\\", \\\"percentage\\\": 100, \\\"allow_unlocked\\\": false}]\"}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdlxliff ```
+
+ :param memory_id: A unique Memory identifier. (required)
+ :type memory_id: int
+ :param name: Name of the TM or termbase file. (required)
+ :type name: str
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param sdlxliff_filters: Contains Filter information Unique to SDLXLIFF
+ :type sdlxliff_filters: List[SDLXLIFFFilter]
+ :param has_header_row: A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).
+ :type has_header_row: bool
+ :param skip_duplicates: A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`).
+ :type skip_duplicates: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(MemoryImportResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
-
- local_var_params = locals()
-
- all_params = [
- 'memory_id',
- 'name',
- 'body',
- 'sdlxliff_filters',
- 'has_header_row',
- 'skip_duplicates'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._import_memory_file_serialize(
+ memory_id=memory_id,
+ name=name,
+ body=body,
+ sdlxliff_filters=sdlxliff_filters,
+ has_header_row=has_header_row,
+ skip_duplicates=skip_duplicates,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "MemoryImportResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def import_memory_file_without_preload_content(
+ self,
+ memory_id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ name: Annotated[StrictStr, Field(description="Name of the TM or termbase file.")],
+ body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file contents to be uploaded. The entire POST body will be treated as the file.")],
+ sdlxliff_filters: Annotated[Optional[List[SDLXLIFFFilter]], Field(description="Contains Filter information Unique to SDLXLIFF")] = None,
+ has_header_row: Annotated[Optional[StrictBool], Field(description="A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).")] = None,
+ skip_duplicates: Annotated[Optional[StrictBool], Field(description="A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`). ")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """File import for a Memory
+
+ Imports common translation memory or termbase file formats to a specific Lilt memory. Currently supported file formats are `*.tmx`, `*.sdltm`, `*.sdlxliff`(With custom Filters), '*.xliff', and `*.tmq` for TM data; `*.csv` and `*.tbx` for termbase data. Request parameters should be passed as JSON object with the header field `LILT-API`. Example CURL command to upload a translation memory file named `my_memory.sdltm` in the current working directory: ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdltm\\\",\\\"memory_id\\\": 42}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdltm ``` Example CURL command to upload a translation memory file named `my_memory.sdlxliff` in the current working directory, with Custom Filters based on SDLXLIFF fields, conf_name which maps to, percentage, and whether we should ignore unlocked segments. ```bash curl -X POST https://api.lilt.com/v2/memories/import?key=API_KEY \\ --header \"LILT-API: {\\\"name\\\": \\\"my_memory.sdlxliff\\\",\\\"memory_id\\\": 12,\\\"sdlxliff_filters\\\":[{\\\"conf_name\\\": \\\"Translated\\\", \\\"percentage\\\": 100, \\\"allow_unlocked\\\": false}]\"}\" \\ --header \"Content-Type: application/octet-stream\" \\ --data-binary @my_memory.sdlxliff ```
+
+ :param memory_id: A unique Memory identifier. (required)
+ :type memory_id: int
+ :param name: Name of the TM or termbase file. (required)
+ :type name: str
+ :param body: The file contents to be uploaded. The entire POST body will be treated as the file. (required)
+ :type body: bytearray
+ :param sdlxliff_filters: Contains Filter information Unique to SDLXLIFF
+ :type sdlxliff_filters: List[SDLXLIFFFilter]
+ :param has_header_row: A flag indicating whether an imported Termbase CSV has a header row or not (the default value is `false`).
+ :type has_header_row: bool
+ :param skip_duplicates: A flag indicating whether or not to skip the import of segments which already exist in the memory. (the default value is `false`).
+ :type skip_duplicates: bool
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._import_memory_file_serialize(
+ memory_id=memory_id,
+ name=name,
+ body=body,
+ sdlxliff_filters=sdlxliff_filters,
+ has_header_row=has_header_row,
+ skip_duplicates=skip_duplicates,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method import_memory_file" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "MemoryImportResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _import_memory_file_serialize(
+ self,
+ memory_id,
+ name,
+ body,
+ sdlxliff_filters,
+ has_header_row,
+ skip_duplicates,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ 'sdlxliff_filters': 'csv',
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ if memory_id is not None:
+ _header_params['memory_id'] = memory_id
+ if name is not None:
+ _header_params['name'] = name
+ if sdlxliff_filters is not None:
+ _header_params['sdlxliff_filters'] = sdlxliff_filters
+ if has_header_row is not None:
+ _header_params['has_header_row'] = has_header_row
+ if skip_duplicates is not None:
+ _header_params['skip_duplicates'] = skip_duplicates
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ # convert to byte array if the input is a file name (str)
+ if isinstance(body, str):
+ with open(body, "rb") as _fp:
+ _body_params = _fp.read()
+ elif isinstance(body, tuple):
+ # drop the filename from the tuple
+ _body_params = body[1]
+ else:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/octet-stream'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'memory_id' is set
- if self.api_client.client_side_validation and ('memory_id' not in local_var_params or # noqa: E501
- local_var_params['memory_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `memory_id` when calling `import_memory_file`") # noqa: E501
- # verify the required parameter 'name' is set
- if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501
- local_var_params['name'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `name` when calling `import_memory_file`") # noqa: E501
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `import_memory_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
- if 'memory_id' in local_var_params:
- header_params['memory_id'] = local_var_params['memory_id'] # noqa: E501
- if 'name' in local_var_params:
- header_params['name'] = local_var_params['name'] # noqa: E501
- if 'sdlxliff_filters' in local_var_params:
- header_params['sdlxliff_filters'] = local_var_params['sdlxliff_filters'] # noqa: E501
- collection_formats['sdlxliff_filters'] = 'csv' # noqa: E501
- if 'has_header_row' in local_var_params:
- header_params['has_header_row'] = local_var_params['has_header_row'] # noqa: E501
- if 'skip_duplicates' in local_var_params:
- header_params['skip_duplicates'] = local_var_params['skip_duplicates'] # noqa: E501
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/octet-stream']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories/import', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='MemoryImportResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def query_memory(self, id, query, **kwargs): # noqa: E501
- """Query a Memory # noqa: E501
-
- Perform a translation memory query. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.query_memory(id, query, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param str query: A source query. (required)
- :param int n: Maximum number of results to return.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/memories/import',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def query_memory(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ query: Annotated[StrictStr, Field(description="A source query.")],
+ n: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[TranslationMemoryEntry]:
+ """Query a Memory
+
+ Perform a translation memory query.
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param query: A source query. (required)
+ :type query: str
+ :param n: Maximum number of results to return.
+ :type n: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: list[TranslationMemoryEntry]
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.query_memory_with_http_info(id, query, **kwargs) # noqa: E501
-
- def query_memory_with_http_info(self, id, query, **kwargs): # noqa: E501
- """Query a Memory # noqa: E501
-
- Perform a translation memory query. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.query_memory_with_http_info(id, query, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Memory identifier. (required)
- :param str query: A source query. (required)
- :param int n: Maximum number of results to return.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._query_memory_serialize(
+ id=id,
+ query=query,
+ n=n,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationMemoryEntry]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def query_memory_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ query: Annotated[StrictStr, Field(description="A source query.")],
+ n: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[TranslationMemoryEntry]]:
+ """Query a Memory
+
+ Perform a translation memory query.
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param query: A source query. (required)
+ :type query: str
+ :param n: Maximum number of results to return.
+ :type n: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(list[TranslationMemoryEntry], status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._query_memory_serialize(
+ id=id,
+ query=query,
+ n=n,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationMemoryEntry]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'id',
- 'query',
- 'n'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def query_memory_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="A unique Memory identifier.")],
+ query: Annotated[StrictStr, Field(description="A source query.")],
+ n: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Query a Memory
+
+ Perform a translation memory query.
+
+ :param id: A unique Memory identifier. (required)
+ :type id: int
+ :param query: A source query. (required)
+ :type query: str
+ :param n: Maximum number of results to return.
+ :type n: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._query_memory_serialize(
+ id=id,
+ query=query,
+ n=n,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method query_memory" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `query_memory`") # noqa: E501
- # verify the required parameter 'query' is set
- if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501
- local_var_params['query'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `query` when calling `query_memory`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
- if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501
- query_params.append(('query', local_var_params['query'])) # noqa: E501
- if 'n' in local_var_params and local_var_params['n'] is not None: # noqa: E501
- query_params.append(('n', local_var_params['n'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories/query', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='list[TranslationMemoryEntry]', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def update_memory(self, body, **kwargs): # noqa: E501
- """Update the name of a Memory # noqa: E501
-
- Update a Memory. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_memory(body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param MemoryUpdateParameters body: (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationMemoryEntry]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _query_memory_serialize(
+ self,
+ id,
+ query,
+ n,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ if query is not None:
+
+ _query_params.append(('query', query))
+
+ if n is not None:
+
+ _query_params.append(('n', n))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/memories/query',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def update_memory(
+ self,
+ body: Annotated[MemoryUpdateParameters, Field(description="The Memory resource to update.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Memory:
+ """Update the name of a Memory
+
+ Update a Memory.
+
+ :param body: The Memory resource to update. (required)
+ :type body: MemoryUpdateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Memory
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.update_memory_with_http_info(body, **kwargs) # noqa: E501
-
- def update_memory_with_http_info(self, body, **kwargs): # noqa: E501
- """Update the name of a Memory # noqa: E501
-
- Update a Memory. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_memory_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param MemoryUpdateParameters body: (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_memory_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Memory",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def update_memory_with_http_info(
+ self,
+ body: Annotated[MemoryUpdateParameters, Field(description="The Memory resource to update.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Memory]:
+ """Update the name of a Memory
+
+ Update a Memory.
+
+ :param body: The Memory resource to update. (required)
+ :type body: MemoryUpdateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Memory, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_memory_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Memory",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- local_var_params = locals()
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ @validate_call
+ def update_memory_without_preload_content(
+ self,
+ body: Annotated[MemoryUpdateParameters, Field(description="The Memory resource to update.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Update the name of a Memory
+
+ Update a Memory.
+
+ :param body: The Memory resource to update. (required)
+ :type body: MemoryUpdateParameters
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_memory_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method update_memory" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Memory",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _update_memory_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `update_memory`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/memories', 'PUT',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Memory', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/v2/memories',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/projects_api.py b/lilt/api/projects_api.py
index 9b466f4..d722b5c 100644
--- a/lilt/api/projects_api.py
+++ b/lilt/api/projects_api.py
@@ -3,408 +3,976 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-from __future__ import absolute_import
+ Do not edit the class manually.
+""" # noqa: E501
-import re # noqa: F401
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
-# python 2 and python 3 compatibility library
-import six
+from pydantic import Field, StrictBool, StrictInt, StrictStr
+from typing import List, Optional
+from typing_extensions import Annotated
+from lilt.models.project import Project
+from lilt.models.project_create_parameters import ProjectCreateParameters
+from lilt.models.project_delete_response import ProjectDeleteResponse
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
-class ProjectsApi(object):
+class ProjectsApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def create_project(self, body, **kwargs): # noqa: E501
- """Create a Project # noqa: E501
- Create a Project. A Project is a collection of Documents. A Project is associated with exactly one Memory. Projects appear in the dashboard of the web app. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.create_project(body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param ProjectCreateParameters body: (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ @validate_call
+ def create_project(
+ self,
+ body: Annotated[ProjectCreateParameters, Field(description="The Project resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Project:
+ """Create a Project
+
+ Create a Project. A Project is a collection of Documents. A Project is associated with exactly one Memory. Projects appear in the dashboard of the web app.
+
+ :param body: The Project resource to create. (required)
+ :type body: ProjectCreateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: Project
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.create_project_with_http_info(body, **kwargs) # noqa: E501
-
- def create_project_with_http_info(self, body, **kwargs): # noqa: E501
- """Create a Project # noqa: E501
-
- Create a Project. A Project is a collection of Documents. A Project is associated with exactly one Memory. Projects appear in the dashboard of the web app. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.create_project_with_http_info(body, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param ProjectCreateParameters body: (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_project_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Project",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def create_project_with_http_info(
+ self,
+ body: Annotated[ProjectCreateParameters, Field(description="The Project resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Project]:
+ """Create a Project
+
+ Create a Project. A Project is a collection of Documents. A Project is associated with exactly one Memory. Projects appear in the dashboard of the web app.
+
+ :param body: The Project resource to create. (required)
+ :type body: ProjectCreateParameters
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(Project, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_project_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Project",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def create_project_without_preload_content(
+ self,
+ body: Annotated[ProjectCreateParameters, Field(description="The Project resource to create.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Create a Project
+
+ Create a Project. A Project is a collection of Documents. A Project is associated with exactly one Memory. Projects appear in the dashboard of the web app.
+
+ :param body: The Project resource to create. (required)
+ :type body: ProjectCreateParameters
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_project_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method create_project" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Project",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _create_project_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'body' is set
- if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
- local_var_params['body'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `body` when calling `create_project`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/projects', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='Project', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def delete_project(self, **kwargs): # noqa: E501
- """Delete a Project # noqa: E501
-
- Delete a Project. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_project(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Project identifier.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/projects',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def delete_project(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique Project identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ProjectDeleteResponse:
+ """Delete a Project
+
+ Delete a Project.
+
+ :param id: A unique Project identifier.
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: ProjectDeleteResponse
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.delete_project_with_http_info(**kwargs) # noqa: E501
-
- def delete_project_with_http_info(self, **kwargs): # noqa: E501
- """Delete a Project # noqa: E501
-
- Delete a Project. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.delete_project_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Project identifier.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_project_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ProjectDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_project_with_http_info(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique Project identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[ProjectDeleteResponse]:
+ """Delete a Project
+
+ Delete a Project.
+
+ :param id: A unique Project identifier.
+ :type id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(ProjectDeleteResponse, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_project_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ProjectDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- local_var_params = locals()
- all_params = [
- 'id'
+ @validate_call
+ def delete_project_without_preload_content(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique Project identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete a Project
+
+ Delete a Project.
+
+ :param id: A unique Project identifier.
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_project_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ProjectDeleteResponse",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_project_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/v2/projects',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_projects(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique Project identifier. It can be a single id or multiple ids separated by a comma")] = None,
+ srclang: Annotated[Optional[StrictStr], Field(description="An ISO 639-1 language code.")] = None,
+ trglang: Annotated[Optional[StrictStr], Field(description="An ISO 639-1 language code.")] = None,
+ from_time: Annotated[Optional[StrictInt], Field(description="Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value.")] = None,
+ to_time: Annotated[Optional[StrictInt], Field(description="Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value.")] = None,
+ state: Annotated[Optional[StrictStr], Field(description="A project state (backlog, inProgress, inReview, inQA, done).")] = None,
+ archived: Annotated[Optional[StrictBool], Field(description="A flag that toggles whether to include archived projects in the response (the default is `true`).")] = None,
+ connector_id: Annotated[Optional[StrictInt], Field(description="A unique Connector identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[Project]:
+ """Retrieve a Project
+
+ Retrieves one or more projects, including the documents associated with each project. Retrieving a project is the most efficient way to retrieve a single project, multiple projects or a list of all available projects. To retrieve a specific project, specify the `id` request parameter or you can retrieve multiple projects by adding comma (,) between ids eg. `?id=1234,5678`. To retrieve all projects, omit the `id` request parameter. To limit the retrieved projects to those with a particular source language or target language, specify the corresponding ISO 639-1 language codes in the `srclang` and `trglang` request parameters, respectively.
+
+ :param id: A unique Project identifier. It can be a single id or multiple ids separated by a comma
+ :type id: int
+ :param srclang: An ISO 639-1 language code.
+ :type srclang: str
+ :param trglang: An ISO 639-1 language code.
+ :type trglang: str
+ :param from_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value.
+ :type from_time: int
+ :param to_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value.
+ :type to_time: int
+ :param state: A project state (backlog, inProgress, inReview, inQA, done).
+ :type state: str
+ :param archived: A flag that toggles whether to include archived projects in the response (the default is `true`).
+ :type archived: bool
+ :param connector_id: A unique Connector identifier.
+ :type connector_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_projects_serialize(
+ id=id,
+ srclang=srclang,
+ trglang=trglang,
+ from_time=from_time,
+ to_time=to_time,
+ state=state,
+ archived=archived,
+ connector_id=connector_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method delete_project" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/projects', 'DELETE',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='ProjectDeleteResponse', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def get_projects(self, **kwargs): # noqa: E501
- """Retrieve a Project # noqa: E501
-
- Retrieves one or more projects, including the documents associated with each project. Retrieving a project is the most efficient way to retrieve a single project, multiple projects or a list of all available projects. To retrieve a specific project, specify the `id` request parameter or you can retrieve multiple projects by adding comma (,) between ids eg. `?id=1234,5678`. To retrieve all projects, omit the `id` request parameter. To limit the retrieved projects to those with a particular source language or target language, specify the corresponding ISO 639-1 language codes in the `srclang` and `trglang` request parameters, respectively. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_projects(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Project identifier. It can be a single id or multiple ids separated by a comma
- :param str srclang: An ISO 639-1 language code.
- :param str trglang: An ISO 639-1 language code.
- :param int from_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value.
- :param int to_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value.
- :param str state: A project state (backlog, inProgress, inReview, inQA, done).
- :param bool archived: A flag that toggles whether to include archived projects in the response (the default is `true`).
- :param int connector_id: A unique Connector identifier.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Project]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_projects_with_http_info(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique Project identifier. It can be a single id or multiple ids separated by a comma")] = None,
+ srclang: Annotated[Optional[StrictStr], Field(description="An ISO 639-1 language code.")] = None,
+ trglang: Annotated[Optional[StrictStr], Field(description="An ISO 639-1 language code.")] = None,
+ from_time: Annotated[Optional[StrictInt], Field(description="Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value.")] = None,
+ to_time: Annotated[Optional[StrictInt], Field(description="Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value.")] = None,
+ state: Annotated[Optional[StrictStr], Field(description="A project state (backlog, inProgress, inReview, inQA, done).")] = None,
+ archived: Annotated[Optional[StrictBool], Field(description="A flag that toggles whether to include archived projects in the response (the default is `true`).")] = None,
+ connector_id: Annotated[Optional[StrictInt], Field(description="A unique Connector identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[Project]]:
+ """Retrieve a Project
+
+ Retrieves one or more projects, including the documents associated with each project. Retrieving a project is the most efficient way to retrieve a single project, multiple projects or a list of all available projects. To retrieve a specific project, specify the `id` request parameter or you can retrieve multiple projects by adding comma (,) between ids eg. `?id=1234,5678`. To retrieve all projects, omit the `id` request parameter. To limit the retrieved projects to those with a particular source language or target language, specify the corresponding ISO 639-1 language codes in the `srclang` and `trglang` request parameters, respectively.
+
+ :param id: A unique Project identifier. It can be a single id or multiple ids separated by a comma
+ :type id: int
+ :param srclang: An ISO 639-1 language code.
+ :type srclang: str
+ :param trglang: An ISO 639-1 language code.
+ :type trglang: str
+ :param from_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value.
+ :type from_time: int
+ :param to_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value.
+ :type to_time: int
+ :param state: A project state (backlog, inProgress, inReview, inQA, done).
+ :type state: str
+ :param archived: A flag that toggles whether to include archived projects in the response (the default is `true`).
+ :type archived: bool
+ :param connector_id: A unique Connector identifier.
+ :type connector_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: list[Project]
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_projects_with_http_info(**kwargs) # noqa: E501
-
- def get_projects_with_http_info(self, **kwargs): # noqa: E501
- """Retrieve a Project # noqa: E501
-
- Retrieves one or more projects, including the documents associated with each project. Retrieving a project is the most efficient way to retrieve a single project, multiple projects or a list of all available projects. To retrieve a specific project, specify the `id` request parameter or you can retrieve multiple projects by adding comma (,) between ids eg. `?id=1234,5678`. To retrieve all projects, omit the `id` request parameter. To limit the retrieved projects to those with a particular source language or target language, specify the corresponding ISO 639-1 language codes in the `srclang` and `trglang` request parameters, respectively. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_projects_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param int id: A unique Project identifier. It can be a single id or multiple ids separated by a comma
- :param str srclang: An ISO 639-1 language code.
- :param str trglang: An ISO 639-1 language code.
- :param int from_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value.
- :param int to_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value.
- :param str state: A project state (backlog, inProgress, inReview, inQA, done).
- :param bool archived: A flag that toggles whether to include archived projects in the response (the default is `true`).
- :param int connector_id: A unique Connector identifier.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_projects_serialize(
+ id=id,
+ srclang=srclang,
+ trglang=trglang,
+ from_time=from_time,
+ to_time=to_time,
+ state=state,
+ archived=archived,
+ connector_id=connector_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Project]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def get_projects_without_preload_content(
+ self,
+ id: Annotated[Optional[StrictInt], Field(description="A unique Project identifier. It can be a single id or multiple ids separated by a comma")] = None,
+ srclang: Annotated[Optional[StrictStr], Field(description="An ISO 639-1 language code.")] = None,
+ trglang: Annotated[Optional[StrictStr], Field(description="An ISO 639-1 language code.")] = None,
+ from_time: Annotated[Optional[StrictInt], Field(description="Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value.")] = None,
+ to_time: Annotated[Optional[StrictInt], Field(description="Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value.")] = None,
+ state: Annotated[Optional[StrictStr], Field(description="A project state (backlog, inProgress, inReview, inQA, done).")] = None,
+ archived: Annotated[Optional[StrictBool], Field(description="A flag that toggles whether to include archived projects in the response (the default is `true`).")] = None,
+ connector_id: Annotated[Optional[StrictInt], Field(description="A unique Connector identifier.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve a Project
+
+ Retrieves one or more projects, including the documents associated with each project. Retrieving a project is the most efficient way to retrieve a single project, multiple projects or a list of all available projects. To retrieve a specific project, specify the `id` request parameter or you can retrieve multiple projects by adding comma (,) between ids eg. `?id=1234,5678`. To retrieve all projects, omit the `id` request parameter. To limit the retrieved projects to those with a particular source language or target language, specify the corresponding ISO 639-1 language codes in the `srclang` and `trglang` request parameters, respectively.
+
+ :param id: A unique Project identifier. It can be a single id or multiple ids separated by a comma
+ :type id: int
+ :param srclang: An ISO 639-1 language code.
+ :type srclang: str
+ :param trglang: An ISO 639-1 language code.
+ :type trglang: str
+ :param from_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` greater than or equal to the value.
+ :type from_time: int
+ :param to_time: Unix time stamp (epoch, in seconds) of Projects with `created_at` less than the value.
+ :type to_time: int
+ :param state: A project state (backlog, inProgress, inReview, inQA, done).
+ :type state: str
+ :param archived: A flag that toggles whether to include archived projects in the response (the default is `true`).
+ :type archived: bool
+ :param connector_id: A unique Connector identifier.
+ :type connector_id: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(list[Project], status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
-
- local_var_params = locals()
-
- all_params = [
- 'id',
- 'srclang',
- 'trglang',
- 'from_time',
- 'to_time',
- 'state',
- 'archived',
- 'connector_id'
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_projects_serialize(
+ id=id,
+ srclang=srclang,
+ trglang=trglang,
+ from_time=from_time,
+ to_time=to_time,
+ state=state,
+ archived=archived,
+ connector_id=connector_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Project]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_projects_serialize(
+ self,
+ id,
+ srclang,
+ trglang,
+ from_time,
+ to_time,
+ state,
+ archived,
+ connector_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ if srclang is not None:
+
+ _query_params.append(('srclang', srclang))
+
+ if trglang is not None:
+
+ _query_params.append(('trglang', trglang))
+
+ if from_time is not None:
+
+ _query_params.append(('from_time', from_time))
+
+ if to_time is not None:
+
+ _query_params.append(('to_time', to_time))
+
+ if state is not None:
+
+ _query_params.append(('state', state))
+
+ if archived is not None:
+
+ _query_params.append(('archived', archived))
+
+ if connector_id is not None:
+
+ _query_params.append(('connector_id', connector_id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
- ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/projects',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_projects" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
- if 'srclang' in local_var_params and local_var_params['srclang'] is not None: # noqa: E501
- query_params.append(('srclang', local_var_params['srclang'])) # noqa: E501
- if 'trglang' in local_var_params and local_var_params['trglang'] is not None: # noqa: E501
- query_params.append(('trglang', local_var_params['trglang'])) # noqa: E501
- if 'from_time' in local_var_params and local_var_params['from_time'] is not None: # noqa: E501
- query_params.append(('from_time', local_var_params['from_time'])) # noqa: E501
- if 'to_time' in local_var_params and local_var_params['to_time'] is not None: # noqa: E501
- query_params.append(('to_time', local_var_params['to_time'])) # noqa: E501
- if 'state' in local_var_params and local_var_params['state'] is not None: # noqa: E501
- query_params.append(('state', local_var_params['state'])) # noqa: E501
- if 'archived' in local_var_params and local_var_params['archived'] is not None: # noqa: E501
- query_params.append(('archived', local_var_params['archived'])) # noqa: E501
- if 'connector_id' in local_var_params and local_var_params['connector_id'] is not None: # noqa: E501
- query_params.append(('connector_id', local_var_params['connector_id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/projects', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='list[Project]', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+
diff --git a/lilt/api/translate_api.py b/lilt/api/translate_api.py
index 4de1e18..00cd531 100644
--- a/lilt/api/translate_api.py
+++ b/lilt/api/translate_api.py
@@ -3,521 +3,1228 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-from __future__ import absolute_import
+ Do not edit the class manually.
+""" # noqa: E501
-import re # noqa: F401
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
-# python 2 and python 3 compatibility library
-import six
+from pydantic import Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr
+from typing import List, Optional, Union
+from typing_extensions import Annotated
+from lilt.models.translate_segment_body import TranslateSegmentBody
+from lilt.models.translation_info import TranslationInfo
+from lilt.models.translation_list import TranslationList
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
-class TranslateApi(object):
+class TranslateApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def batch_translate_file(self, file_id, memory_id, **kwargs): # noqa: E501
- """Translate a File # noqa: E501
-
- Start machine translation of one or more Files that have previously been uploaded. The response will include an `id` parameter that can be used to monitor and download the translations in subsequent calls. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/translate/file?key=API_KEY&fileId=583&memoryId=2495&configId=123&withTM=true' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.batch_translate_file(file_id, memory_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str file_id: List of File ids to be translated, comma separated. (required)
- :param str memory_id: Id of Memory to use in translation. (required)
- :param float config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
- :param bool with_tm: An optional boolean parameter to toggle the use of Translation Memory in the translation of the file.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+
+ @validate_call
+ def batch_translate_file(
+ self,
+ file_id: Annotated[StrictStr, Field(description="List of File ids to be translated, comma separated.")],
+ memory_id: Annotated[StrictStr, Field(description="Id of Memory to use in translation.")],
+ config_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.")] = None,
+ with_tm: Annotated[Optional[StrictBool], Field(description="An optional boolean parameter to toggle the use of Translation Memory in the translation of the file.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[TranslationInfo]:
+ """Translate a File
+
+ Start machine translation of one or more Files that have previously been uploaded. The response will include an `id` parameter that can be used to monitor and download the translations in subsequent calls. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/translate/file?key=API_KEY&fileId=583&memoryId=2495&configId=123&withTM=true' ```
+
+ :param file_id: List of File ids to be translated, comma separated. (required)
+ :type file_id: str
+ :param memory_id: Id of Memory to use in translation. (required)
+ :type memory_id: str
+ :param config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
+ :type config_id: float
+ :param with_tm: An optional boolean parameter to toggle the use of Translation Memory in the translation of the file.
+ :type with_tm: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: list[TranslationInfo]
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.batch_translate_file_with_http_info(file_id, memory_id, **kwargs) # noqa: E501
-
- def batch_translate_file_with_http_info(self, file_id, memory_id, **kwargs): # noqa: E501
- """Translate a File # noqa: E501
-
- Start machine translation of one or more Files that have previously been uploaded. The response will include an `id` parameter that can be used to monitor and download the translations in subsequent calls. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/translate/file?key=API_KEY&fileId=583&memoryId=2495&configId=123&withTM=true' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.batch_translate_file_with_http_info(file_id, memory_id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str file_id: List of File ids to be translated, comma separated. (required)
- :param str memory_id: Id of Memory to use in translation. (required)
- :param float config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
- :param bool with_tm: An optional boolean parameter to toggle the use of Translation Memory in the translation of the file.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._batch_translate_file_serialize(
+ file_id=file_id,
+ memory_id=memory_id,
+ config_id=config_id,
+ with_tm=with_tm,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationInfo]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def batch_translate_file_with_http_info(
+ self,
+ file_id: Annotated[StrictStr, Field(description="List of File ids to be translated, comma separated.")],
+ memory_id: Annotated[StrictStr, Field(description="Id of Memory to use in translation.")],
+ config_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.")] = None,
+ with_tm: Annotated[Optional[StrictBool], Field(description="An optional boolean parameter to toggle the use of Translation Memory in the translation of the file.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[TranslationInfo]]:
+ """Translate a File
+
+ Start machine translation of one or more Files that have previously been uploaded. The response will include an `id` parameter that can be used to monitor and download the translations in subsequent calls. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/translate/file?key=API_KEY&fileId=583&memoryId=2495&configId=123&withTM=true' ```
+
+ :param file_id: List of File ids to be translated, comma separated. (required)
+ :type file_id: str
+ :param memory_id: Id of Memory to use in translation. (required)
+ :type memory_id: str
+ :param config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
+ :type config_id: float
+ :param with_tm: An optional boolean parameter to toggle the use of Translation Memory in the translation of the file.
+ :type with_tm: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(list[TranslationInfo], status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
-
- local_var_params = locals()
-
- all_params = [
- 'file_id',
- 'memory_id',
- 'config_id',
- 'with_tm'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._batch_translate_file_serialize(
+ file_id=file_id,
+ memory_id=memory_id,
+ config_id=config_id,
+ with_tm=with_tm,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationInfo]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def batch_translate_file_without_preload_content(
+ self,
+ file_id: Annotated[StrictStr, Field(description="List of File ids to be translated, comma separated.")],
+ memory_id: Annotated[StrictStr, Field(description="Id of Memory to use in translation.")],
+ config_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.")] = None,
+ with_tm: Annotated[Optional[StrictBool], Field(description="An optional boolean parameter to toggle the use of Translation Memory in the translation of the file.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Translate a File
+
+ Start machine translation of one or more Files that have previously been uploaded. The response will include an `id` parameter that can be used to monitor and download the translations in subsequent calls. Example CURL: ```bash curl -X POST 'https://api.lilt.com/v2/translate/file?key=API_KEY&fileId=583&memoryId=2495&configId=123&withTM=true' ```
+
+ :param file_id: List of File ids to be translated, comma separated. (required)
+ :type file_id: str
+ :param memory_id: Id of Memory to use in translation. (required)
+ :type memory_id: str
+ :param config_id: An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.
+ :type config_id: float
+ :param with_tm: An optional boolean parameter to toggle the use of Translation Memory in the translation of the file.
+ :type with_tm: bool
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._batch_translate_file_serialize(
+ file_id=file_id,
+ memory_id=memory_id,
+ config_id=config_id,
+ with_tm=with_tm,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method batch_translate_file" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'file_id' is set
- if self.api_client.client_side_validation and ('file_id' not in local_var_params or # noqa: E501
- local_var_params['file_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `file_id` when calling `batch_translate_file`") # noqa: E501
- # verify the required parameter 'memory_id' is set
- if self.api_client.client_side_validation and ('memory_id' not in local_var_params or # noqa: E501
- local_var_params['memory_id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `memory_id` when calling `batch_translate_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'file_id' in local_var_params and local_var_params['file_id'] is not None: # noqa: E501
- query_params.append(('fileId', local_var_params['file_id'])) # noqa: E501
- if 'memory_id' in local_var_params and local_var_params['memory_id'] is not None: # noqa: E501
- query_params.append(('memoryId', local_var_params['memory_id'])) # noqa: E501
- if 'config_id' in local_var_params and local_var_params['config_id'] is not None: # noqa: E501
- query_params.append(('configId', local_var_params['config_id'])) # noqa: E501
- if 'with_tm' in local_var_params and local_var_params['with_tm'] is not None: # noqa: E501
- query_params.append(('withTM', local_var_params['with_tm'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/translate/file', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='list[TranslationInfo]', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def download_file(self, id, **kwargs): # noqa: E501
- """Download translated file # noqa: E501
-
- Download a translated File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/files?key=API_KEY&id=1' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_file(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str id: A translation id. (required)
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationInfo]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _batch_translate_file_serialize(
+ self,
+ file_id,
+ memory_id,
+ config_id,
+ with_tm,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if file_id is not None:
+
+ _query_params.append(('fileId', file_id))
+
+ if memory_id is not None:
+
+ _query_params.append(('memoryId', memory_id))
+
+ if config_id is not None:
+
+ _query_params.append(('configId', config_id))
+
+ if with_tm is not None:
+
+ _query_params.append(('withTM', with_tm))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/translate/file',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def download_file(
+ self,
+ id: Annotated[StrictStr, Field(description="A translation id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> bytearray:
+ """Download translated file
+
+ Download a translated File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/files?key=API_KEY&id=1' ```
+
+ :param id: A translation id. (required)
+ :type id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: str
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.download_file_with_http_info(id, **kwargs) # noqa: E501
-
- def download_file_with_http_info(self, id, **kwargs): # noqa: E501
- """Download translated file # noqa: E501
-
- Download a translated File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/files?key=API_KEY&id=1' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.download_file_with_http_info(id, async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str id: A translation id. (required)
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_file_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def download_file_with_http_info(
+ self,
+ id: Annotated[StrictStr, Field(description="A translation id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[bytearray]:
+ """Download translated file
+
+ Download a translated File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/files?key=API_KEY&id=1' ```
+
+ :param id: A translation id. (required)
+ :type id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(str, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_file_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
- local_var_params = locals()
+ @validate_call
+ def download_file_without_preload_content(
+ self,
+ id: Annotated[StrictStr, Field(description="A translation id.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Download translated file
+
+ Download a translated File. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/files?key=API_KEY&id=1' ```
+
+ :param id: A translation id. (required)
+ :type id: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._download_file_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- all_params = [
- 'id'
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _download_file_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if id is not None:
+
+ _query_params.append(('id', id))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/octet-stream',
+ 'text/plain',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/translate/files',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def monitor_file_translation(
+ self,
+ translation_ids: Annotated[Optional[StrictStr], Field(description="List of translation ids, comma separated")] = None,
+ status: Annotated[Optional[StrictStr], Field(description="One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload`")] = None,
+ from_time: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch.")] = None,
+ to_time: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[TranslationInfo]:
+ """Monitor file translation
+
+ Get information about the one or more Files that are being translated with machine translation. Query filters are optional but at least one must be provided. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/file?key=API_KEY&translationIds=1,2&fromTime=1607966744&toTime=1707966744&status=InProgress' ```
+
+ :param translation_ids: List of translation ids, comma separated
+ :type translation_ids: str
+ :param status: One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload`
+ :type status: str
+ :param from_time: Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch.
+ :type from_time: float
+ :param to_time: Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch.
+ :type to_time: float
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._monitor_file_translation_serialize(
+ translation_ids=translation_ids,
+ status=status,
+ from_time=from_time,
+ to_time=to_time,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method download_file" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
- # verify the required parameter 'id' is set
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
- local_var_params['id'] is None): # noqa: E501
- raise ApiValueError("Missing the required parameter `id` when calling `download_file`") # noqa: E501
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501
- query_params.append(('id', local_var_params['id'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/translate/files', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='str', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def monitor_file_translation(self, **kwargs): # noqa: E501
- """Monitor file translation # noqa: E501
-
- Get information about the one or more Files that are being translated with machine translation. Query filters are optional but at least one must be provided. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/file?key=API_KEY&translationIds=1,2&fromTime=1607966744&toTime=1707966744&status=InProgress' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.monitor_file_translation(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str translation_ids: List of translation ids, comma separated
- :param str status: One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload`
- :param float from_time: Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch.
- :param float to_time: Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationInfo]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def monitor_file_translation_with_http_info(
+ self,
+ translation_ids: Annotated[Optional[StrictStr], Field(description="List of translation ids, comma separated")] = None,
+ status: Annotated[Optional[StrictStr], Field(description="One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload`")] = None,
+ from_time: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch.")] = None,
+ to_time: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[TranslationInfo]]:
+ """Monitor file translation
+
+ Get information about the one or more Files that are being translated with machine translation. Query filters are optional but at least one must be provided. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/file?key=API_KEY&translationIds=1,2&fromTime=1607966744&toTime=1707966744&status=InProgress' ```
+
+ :param translation_ids: List of translation ids, comma separated
+ :type translation_ids: str
+ :param status: One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload`
+ :type status: str
+ :param from_time: Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch.
+ :type from_time: float
+ :param to_time: Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch.
+ :type to_time: float
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: list[TranslationInfo]
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.monitor_file_translation_with_http_info(**kwargs) # noqa: E501
-
- def monitor_file_translation_with_http_info(self, **kwargs): # noqa: E501
- """Monitor file translation # noqa: E501
-
- Get information about the one or more Files that are being translated with machine translation. Query filters are optional but at least one must be provided. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/file?key=API_KEY&translationIds=1,2&fromTime=1607966744&toTime=1707966744&status=InProgress' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.monitor_file_translation_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param str translation_ids: List of translation ids, comma separated
- :param str status: One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload`
- :param float from_time: Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch.
- :param float to_time: Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch.
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._monitor_file_translation_serialize(
+ translation_ids=translation_ids,
+ status=status,
+ from_time=from_time,
+ to_time=to_time,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationInfo]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def monitor_file_translation_without_preload_content(
+ self,
+ translation_ids: Annotated[Optional[StrictStr], Field(description="List of translation ids, comma separated")] = None,
+ status: Annotated[Optional[StrictStr], Field(description="One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload`")] = None,
+ from_time: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch.")] = None,
+ to_time: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch.")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Monitor file translation
+
+ Get information about the one or more Files that are being translated with machine translation. Query filters are optional but at least one must be provided. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/translate/file?key=API_KEY&translationIds=1,2&fromTime=1607966744&toTime=1707966744&status=InProgress' ```
+
+ :param translation_ids: List of translation ids, comma separated
+ :type translation_ids: str
+ :param status: One of the translation statuses - `InProgress`, `Completed`, `Failed`, `ReadyForDownload`
+ :type status: str
+ :param from_time: Results after this time (inclusive) will be returned, specified as seconds since the Unix epoch.
+ :type from_time: float
+ :param to_time: Results before this time (exclusive) will be returned, specified as seconds since the Unix epoch.
+ :type to_time: float
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(list[TranslationInfo], status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
-
- local_var_params = locals()
-
- all_params = [
- 'translation_ids',
- 'status',
- 'from_time',
- 'to_time'
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._monitor_file_translation_serialize(
+ translation_ids=translation_ids,
+ status=status,
+ from_time=from_time,
+ to_time=to_time,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[TranslationInfo]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _monitor_file_translation_serialize(
+ self,
+ translation_ids,
+ status,
+ from_time,
+ to_time,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if translation_ids is not None:
+
+ _query_params.append(('translationIds', translation_ids))
+
+ if status is not None:
+
+ _query_params.append(('status', status))
+
+ if from_time is not None:
+
+ _query_params.append(('fromTime', from_time))
+
+ if to_time is not None:
+
+ _query_params.append(('toTime', to_time))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
- ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/translate/file',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method monitor_file_translation" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
- if 'translation_ids' in local_var_params and local_var_params['translation_ids'] is not None: # noqa: E501
- query_params.append(('translationIds', local_var_params['translation_ids'])) # noqa: E501
- if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501
- query_params.append(('status', local_var_params['status'])) # noqa: E501
- if 'from_time' in local_var_params and local_var_params['from_time'] is not None: # noqa: E501
- query_params.append(('fromTime', local_var_params['from_time'])) # noqa: E501
- if 'to_time' in local_var_params and local_var_params['to_time'] is not None: # noqa: E501
- query_params.append(('toTime', local_var_params['to_time'])) # noqa: E501
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/translate/file', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='list[TranslationInfo]', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
-
- def translate_segment_post(self, **kwargs): # noqa: E501
- """Translate a segment # noqa: E501
-
- Translate a source string. Setting the `rich` parameter to `true` will change the response format to include additional information about each translation including a model score, word alignments, and formatting information. The rich format can be seen in the example response on this page. By default, this endpoint also returns translation memory (TM) fuzzy matches, along with associated scores. Fuzzy matches always appear ahead of machine translation output in the response. The maximum source length is 5,000 characters. Usage charges apply to this endpoint for production REST API keys. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.translate_segment_post(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param TranslateSegmentBody body:
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+
+
+
+ @validate_call
+ def translate_segment_post(
+ self,
+ body: Optional[TranslateSegmentBody] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> TranslationList:
+ """Translate a segment
+
+ Translate a source string. Setting the `rich` parameter to `true` will change the response format to include additional information about each translation including a model score, word alignments, and formatting information. The rich format can be seen in the example response on this page. By default, this endpoint also returns translation memory (TM) fuzzy matches, along with associated scores. Fuzzy matches always appear ahead of machine translation output in the response. The maximum source length is 5,000 characters. Usage charges apply to this endpoint for production REST API keys.
+
+ :param body:
+ :type body: TranslateSegmentBody
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: TranslationList
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.translate_segment_post_with_http_info(**kwargs) # noqa: E501
-
- def translate_segment_post_with_http_info(self, **kwargs): # noqa: E501
- """Translate a segment # noqa: E501
-
- Translate a source string. Setting the `rich` parameter to `true` will change the response format to include additional information about each translation including a model score, word alignments, and formatting information. The rich format can be seen in the example response on this page. By default, this endpoint also returns translation memory (TM) fuzzy matches, along with associated scores. Fuzzy matches always appear ahead of machine translation output in the response. The maximum source length is 5,000 characters. Usage charges apply to this endpoint for production REST API keys. # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.translate_segment_post_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param TranslateSegmentBody body:
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._translate_segment_post_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "TranslationList",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def translate_segment_post_with_http_info(
+ self,
+ body: Optional[TranslateSegmentBody] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[TranslationList]:
+ """Translate a segment
+
+ Translate a source string. Setting the `rich` parameter to `true` will change the response format to include additional information about each translation including a model score, word alignments, and formatting information. The rich format can be seen in the example response on this page. By default, this endpoint also returns translation memory (TM) fuzzy matches, along with associated scores. Fuzzy matches always appear ahead of machine translation output in the response. The maximum source length is 5,000 characters. Usage charges apply to this endpoint for production REST API keys.
+
+ :param body:
+ :type body: TranslateSegmentBody
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(TranslationList, status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._translate_segment_post_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- local_var_params = locals()
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "TranslationList",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
- all_params = [
- 'body'
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+
+ @validate_call
+ def translate_segment_post_without_preload_content(
+ self,
+ body: Optional[TranslateSegmentBody] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Translate a segment
+
+ Translate a source string. Setting the `rich` parameter to `true` will change the response format to include additional information about each translation including a model score, word alignments, and formatting information. The rich format can be seen in the example response on this page. By default, this endpoint also returns translation memory (TM) fuzzy matches, along with associated scores. Fuzzy matches always appear ahead of machine translation output in the response. The maximum source length is 5,000 characters. Usage charges apply to this endpoint for production REST API keys.
+
+ :param body:
+ :type body: TranslateSegmentBody
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._translate_segment_post_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method translate_segment_post" % key
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "TranslationList",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _translate_segment_post_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
)
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- if 'body' in local_var_params:
- body_params = local_var_params['body']
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # HTTP header `Content-Type`
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
- ['application/json']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/translate', 'POST',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='TranslationList', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v2/translate',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/webhook_configuration_api.py b/lilt/api/webhook_configuration_api.py
new file mode 100644
index 0000000..ba87dd4
--- /dev/null
+++ b/lilt/api/webhook_configuration_api.py
@@ -0,0 +1,1374 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictInt
+from typing import List
+from typing_extensions import Annotated
+from lilt.models.create_webhook_options import CreateWebhookOptions
+from lilt.models.webhook_response import WebhookResponse
+from lilt.models.webhooks_update_request import WebhooksUpdateRequest
+
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
+
+
+class WebhookConfigurationApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def services_configuration_api_webhooks_delete(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Delete a specific Webhook Configuration by ID.
+
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._services_configuration_api_webhooks_delete_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def services_configuration_api_webhooks_delete_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Delete a specific Webhook Configuration by ID.
+
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._services_configuration_api_webhooks_delete_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def services_configuration_api_webhooks_delete_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete a specific Webhook Configuration by ID.
+
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._services_configuration_api_webhooks_delete_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _services_configuration_api_webhooks_delete_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if id is not None:
+ _path_params['id'] = id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/v3/connectors/configuration/webhooks/{id}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def webhooks_create(
+ self,
+ create_webhook_options: CreateWebhookOptions,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> WebhookResponse:
+ """Creates a new Webhook Configuration
+
+ Creates a new webhook configuration for your LILT organization.
+
+ :param create_webhook_options: (required)
+ :type create_webhook_options: CreateWebhookOptions
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_create_serialize(
+ create_webhook_options=create_webhook_options,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def webhooks_create_with_http_info(
+ self,
+ create_webhook_options: CreateWebhookOptions,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[WebhookResponse]:
+ """Creates a new Webhook Configuration
+
+ Creates a new webhook configuration for your LILT organization.
+
+ :param create_webhook_options: (required)
+ :type create_webhook_options: CreateWebhookOptions
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_create_serialize(
+ create_webhook_options=create_webhook_options,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def webhooks_create_without_preload_content(
+ self,
+ create_webhook_options: CreateWebhookOptions,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Creates a new Webhook Configuration
+
+ Creates a new webhook configuration for your LILT organization.
+
+ :param create_webhook_options: (required)
+ :type create_webhook_options: CreateWebhookOptions
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_create_serialize(
+ create_webhook_options=create_webhook_options,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _webhooks_create_serialize(
+ self,
+ create_webhook_options,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if create_webhook_options is not None:
+ _body_params = create_webhook_options
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v3/connectors/configuration/webhooks',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def webhooks_get(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> WebhookResponse:
+ """Retrieve a specific Webhook Configuration by ID.
+
+ Retrieves a specific webhook configuration by its ID. Deleted webhook configurations are not returned.
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_get_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def webhooks_get_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[WebhookResponse]:
+ """Retrieve a specific Webhook Configuration by ID.
+
+ Retrieves a specific webhook configuration by its ID. Deleted webhook configurations are not returned.
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_get_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def webhooks_get_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve a specific Webhook Configuration by ID.
+
+ Retrieves a specific webhook configuration by its ID. Deleted webhook configurations are not returned.
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_get_serialize(
+ id=id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _webhooks_get_serialize(
+ self,
+ id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if id is not None:
+ _path_params['id'] = id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v3/connectors/configuration/webhooks/{id}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def webhooks_get_many(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[WebhookResponse]:
+ """Retrieve a list of Webhook Configurations.
+
+ Retrieves a list of webhook configurations available to your LILT organization. Use this to manage your webhook configurations.
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_get_many_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[WebhookResponse]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def webhooks_get_many_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[WebhookResponse]]:
+ """Retrieve a list of Webhook Configurations.
+
+ Retrieves a list of webhook configurations available to your LILT organization. Use this to manage your webhook configurations.
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_get_many_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[WebhookResponse]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def webhooks_get_many_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve a list of Webhook Configurations.
+
+ Retrieves a list of webhook configurations available to your LILT organization. Use this to manage your webhook configurations.
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_get_many_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[WebhookResponse]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _webhooks_get_many_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v3/connectors/configuration/webhooks',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def webhooks_update(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ webhooks_update_request: WebhooksUpdateRequest,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> WebhookResponse:
+ """Update a specific Webhook Configuration by ID.
+
+ Updates a specific webhook configuration by its ID. Only the fields that are provided in the request body will be updated.
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param webhooks_update_request: (required)
+ :type webhooks_update_request: WebhooksUpdateRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_update_serialize(
+ id=id,
+ webhooks_update_request=webhooks_update_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def webhooks_update_with_http_info(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ webhooks_update_request: WebhooksUpdateRequest,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[WebhookResponse]:
+ """Update a specific Webhook Configuration by ID.
+
+ Updates a specific webhook configuration by its ID. Only the fields that are provided in the request body will be updated.
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param webhooks_update_request: (required)
+ :type webhooks_update_request: WebhooksUpdateRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_update_serialize(
+ id=id,
+ webhooks_update_request=webhooks_update_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def webhooks_update_without_preload_content(
+ self,
+ id: Annotated[StrictInt, Field(description="The Webhook Configuration ID.")],
+ webhooks_update_request: WebhooksUpdateRequest,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Update a specific Webhook Configuration by ID.
+
+ Updates a specific webhook configuration by its ID. Only the fields that are provided in the request body will be updated.
+
+ :param id: The Webhook Configuration ID. (required)
+ :type id: int
+ :param webhooks_update_request: (required)
+ :type webhooks_update_request: WebhooksUpdateRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._webhooks_update_serialize(
+ id=id,
+ webhooks_update_request=webhooks_update_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "WebhookResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _webhooks_update_serialize(
+ self,
+ id,
+ webhooks_update_request,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if id is not None:
+ _path_params['id'] = id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if webhooks_update_request is not None:
+ _body_params = webhooks_update_request
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/v3/connectors/configuration/webhooks/{id}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api/workflows_api.py b/lilt/api/workflows_api.py
index 06559a2..274e6e2 100644
--- a/lilt/api/workflows_api.py
+++ b/lilt/api/workflows_api.py
@@ -3,140 +3,287 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-from __future__ import absolute_import
+ Do not edit the class manually.
+""" # noqa: E501
-import re # noqa: F401
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
-# python 2 and python 3 compatibility library
-import six
+from typing import List
+from lilt.models.workflow_template import WorkflowTemplate
-from lilt.api_client import ApiClient
-from lilt.exceptions import ( # noqa: F401
- ApiTypeError,
- ApiValueError
-)
+from lilt.api_client import ApiClient, RequestSerialized
+from lilt.api_response import ApiResponse
+from lilt.rest import RESTResponseType
-class WorkflowsApi(object):
+class WorkflowsApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
- def __init__(self, api_client=None):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- def get_workflow_templates(self, **kwargs): # noqa: E501
- """Retrieve workflow templates # noqa: E501
- Get all of the possible Workflow Templates owned by the team. Useful for retrieving the ids corresponding to each workflow tables, and passing them to subsequent requests, for example, creating a new Job with a specific Workflow. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/workflows/templates?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_workflow_templates(async_req=True)
- >>> result = thread.get()
+ @validate_call
+ def get_workflow_templates(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[WorkflowTemplate]:
+ """Retrieve workflow templates
+
+ Get all of the possible Workflow Templates owned by the team. Useful for retrieving the ids corresponding to each workflow tables, and passing them to subsequent requests, for example, creating a new Job with a specific Workflow. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/workflows/templates?key=API_KEY' ```
- :param async_req bool: execute request asynchronously
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: list[WorkflowTemplate]
- If the method is called asynchronously,
- returns the request thread.
- """
- kwargs['_return_http_data_only'] = True
- return self.get_workflow_templates_with_http_info(**kwargs) # noqa: E501
-
- def get_workflow_templates_with_http_info(self, **kwargs): # noqa: E501
- """Retrieve workflow templates # noqa: E501
-
- Get all of the possible Workflow Templates owned by the team. Useful for retrieving the ids corresponding to each workflow tables, and passing them to subsequent requests, for example, creating a new Job with a specific Workflow. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/workflows/templates?key=API_KEY' ``` # noqa: E501
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
- >>> thread = api.get_workflow_templates_with_http_info(async_req=True)
- >>> result = thread.get()
-
- :param async_req bool: execute request asynchronously
- :param _return_http_data_only: response data without head status code
- and headers
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_workflow_templates_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[WorkflowTemplate]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_workflow_templates_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[WorkflowTemplate]]:
+ """Retrieve workflow templates
+
+ Get all of the possible Workflow Templates owned by the team. Useful for retrieving the ids corresponding to each workflow tables, and passing them to subsequent requests, for example, creating a new Job with a specific Workflow. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/workflows/templates?key=API_KEY' ```
+
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
- :return: tuple(list[WorkflowTemplate], status_code(int), headers(HTTPHeaderDict))
- If the method is called asynchronously,
- returns the request thread.
- """
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
- local_var_params = locals()
+ _param = self._get_workflow_templates_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
- all_params = [
- ]
- all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout'
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[WorkflowTemplate]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def get_workflow_templates_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Retrieve workflow templates
+
+ Get all of the possible Workflow Templates owned by the team. Useful for retrieving the ids corresponding to each workflow tables, and passing them to subsequent requests, for example, creating a new Job with a specific Workflow. Example CURL: ```bash curl -X GET 'https://api.lilt.com/v2/workflows/templates?key=API_KEY' ```
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_workflow_templates_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
)
- for key, val in six.iteritems(local_var_params['kwargs']):
- if key not in all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method get_workflow_templates" % key
- )
- local_var_params[key] = val
- del local_var_params['kwargs']
-
- collection_formats = {}
-
- path_params = {}
-
- query_params = []
-
- header_params = {}
-
- form_params = []
- local_var_files = {}
-
- body_params = None
- # HTTP header `Accept`
- header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json', 'application/octet-stream', 'text/plain']) # noqa: E501
-
- # Authentication setting
- auth_settings = ['ApiKeyAuth', 'BasicAuth'] # noqa: E501
-
- return self.api_client.call_api(
- '/v2/workflows/templates', 'GET',
- path_params,
- query_params,
- header_params,
- body=body_params,
- post_params=form_params,
- files=local_var_files,
- response_type='list[WorkflowTemplate]', # noqa: E501
- auth_settings=auth_settings,
- async_req=local_var_params.get('async_req'),
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=local_var_params.get('_preload_content', True),
- _request_timeout=local_var_params.get('_request_timeout'),
- collection_formats=collection_formats)
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[WorkflowTemplate]",
+ '401': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_workflow_templates_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json',
+ 'application/octet-stream',
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'BasicAuth',
+ 'ApiKeyAuth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/v2/workflows/templates',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/lilt/api_client.py b/lilt/api_client.py
index 0ea9803..09709f0 100644
--- a/lilt/api_client.py
+++ b/lilt/api_client.py
@@ -1,36 +1,48 @@
# coding: utf-8
+
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
-import atexit
import datetime
from dateutil.parser import parse
+from enum import Enum
+import decimal
import json
import mimetypes
-from multiprocessing.pool import ThreadPool
import os
import re
import tempfile
-# python 2 and python 3 compatibility library
-import six
-from six.moves.urllib.parse import quote
+from urllib.parse import quote
+from typing import Tuple, Optional, List, Dict, Union
+from pydantic import SecretStr
from lilt.configuration import Configuration
+from lilt.api_response import ApiResponse, T as ApiResponseT
import lilt.models
from lilt import rest
-from lilt.exceptions import ApiValueError, ApiException
-
-
-class ApiClient(object):
+from lilt.exceptions import (
+ ApiValueError,
+ ApiException,
+ BadRequestException,
+ UnauthorizedException,
+ ForbiddenException,
+ NotFoundException,
+ ServiceException
+)
+
+RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
+
+class ApiClient:
"""Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client-
@@ -38,39 +50,39 @@ class ApiClient(object):
the methods and models for each application are generated from the OpenAPI
templates.
- NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
- Do not edit the class manually.
-
:param configuration: .Configuration object for this client
:param header_name: a header to pass when making calls to the API.
:param header_value: a header value to pass when making calls to
the API.
:param cookie: a cookie to include in the header when making calls
to the API
- :param pool_threads: The number of threads to use for async requests
- to the API. More threads means more concurrent API requests.
"""
- PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
+ PRIMITIVE_TYPES = (float, bool, bytes, str, int)
NATIVE_TYPES_MAPPING = {
'int': int,
- 'long': int if six.PY3 else long, # noqa: F821
+ 'long': int, # TODO remove as only py3 is supported?
'float': float,
'str': str,
'bool': bool,
'date': datetime.date,
'datetime': datetime.datetime,
+ 'decimal': decimal.Decimal,
'object': object,
}
_pool = None
- def __init__(self, configuration=None, header_name=None, header_value=None,
- cookie=None, pool_threads=1):
+ def __init__(
+ self,
+ configuration=None,
+ header_name=None,
+ header_value=None,
+ cookie=None
+ ) -> None:
+ # use default configuration if none is provided
if configuration is None:
- configuration = Configuration.get_default_copy()
+ configuration = Configuration.get_default()
self.configuration = configuration
- self.pool_threads = pool_threads
self.rest_client = rest.RESTClientObject(configuration)
self.default_headers = {}
@@ -78,32 +90,14 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
- self.user_agent = 'OpenAPI-Generator/3.0.0/python'
+ self.user_agent = 'Lilt_Client_Library-Python'
self.client_side_validation = configuration.client_side_validation
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
- self.close()
-
- def close(self):
- if self._pool:
- self._pool.close()
- self._pool.join()
- self._pool = None
- if hasattr(atexit, 'unregister'):
- atexit.unregister(self.close)
-
- @property
- def pool(self):
- """Create thread pool on first request
- avoids instantiating unused threadpool for blocking clients.
- """
- if self._pool is None:
- atexit.register(self.close)
- self._pool = ThreadPool(self.pool_threads)
- return self._pool
+ pass
@property
def user_agent(self):
@@ -117,12 +111,69 @@ def user_agent(self, value):
def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value
- def __call_api(
- self, resource_path, method, path_params=None,
- query_params=None, header_params=None, body=None, post_params=None,
- files=None, response_type=None, auth_settings=None,
- _return_http_data_only=None, collection_formats=None,
- _preload_content=True, _request_timeout=None, _host=None):
+
+ _default = None
+
+ @classmethod
+ def get_default(cls):
+ """Return new instance of ApiClient.
+
+ This method returns newly created, based on default constructor,
+ object of ApiClient class or returns a copy of default
+ ApiClient.
+
+ :return: The ApiClient object.
+ """
+ if cls._default is None:
+ cls._default = ApiClient()
+ return cls._default
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of ApiClient.
+
+ It stores default ApiClient.
+
+ :param default: object of ApiClient.
+ """
+ cls._default = default
+
+ def param_serialize(
+ self,
+ method,
+ resource_path,
+ path_params=None,
+ query_params=None,
+ header_params=None,
+ body=None,
+ post_params=None,
+ files=None, auth_settings=None,
+ collection_formats=None,
+ _host=None,
+ _request_auth=None
+ ) -> RequestSerialized:
+
+ """Builds the HTTP request params needed by the request.
+ :param method: Method to call.
+ :param resource_path: Path to method endpoint.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :param collection_formats: dict of collection formats for path, query,
+ header, and post parameters.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :return: tuple of form (path, http_method, query_params, header_params,
+ body, post_params, files)
+ """
config = self.configuration
@@ -133,14 +184,17 @@ def __call_api(
header_params['Cookie'] = self.cookie
if header_params:
header_params = self.sanitize_for_serialization(header_params)
- header_params = dict(self.parameters_to_tuples(header_params,
- collection_formats))
+ header_params = dict(
+ self.parameters_to_tuples(header_params,collection_formats)
+ )
# path parameters
if path_params:
path_params = self.sanitize_for_serialization(path_params)
- path_params = self.parameters_to_tuples(path_params,
- collection_formats)
+ path_params = self.parameters_to_tuples(
+ path_params,
+ collection_formats
+ )
for k, v in path_params:
# specified safe chars, encode everything
resource_path = resource_path.replace(
@@ -148,80 +202,145 @@ def __call_api(
quote(str(v), safe=config.safe_chars_for_path_param)
)
- # query parameters
- if query_params:
- query_params = self.sanitize_for_serialization(query_params)
- query_params = self.parameters_to_tuples(query_params,
- collection_formats)
-
# post parameters
if post_params or files:
post_params = post_params if post_params else []
post_params = self.sanitize_for_serialization(post_params)
- post_params = self.parameters_to_tuples(post_params,
- collection_formats)
- post_params.extend(self.files_parameters(files))
+ post_params = self.parameters_to_tuples(
+ post_params,
+ collection_formats
+ )
+ if files:
+ post_params.extend(self.files_parameters(files))
# auth setting
- self.update_params_for_auth(header_params, query_params, auth_settings)
+ self.update_params_for_auth(
+ header_params,
+ query_params,
+ auth_settings,
+ resource_path,
+ method,
+ body,
+ request_auth=_request_auth
+ )
# body
if body:
body = self.sanitize_for_serialization(body)
# request url
- if _host is None:
+ if _host is None or self.configuration.ignore_operation_servers:
url = self.configuration.host + resource_path
else:
# use server/host defined in path or operation instead
url = _host + resource_path
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ url_query = self.parameters_to_url_query(
+ query_params,
+ collection_formats
+ )
+ url += "?" + url_query
+
+ return method, url, header_params, body, post_params
+
+
+ def call_api(
+ self,
+ method,
+ url,
+ header_params=None,
+ body=None,
+ post_params=None,
+ _request_timeout=None
+ ) -> rest.RESTResponse:
+ """Makes the HTTP request (synchronous)
+ :param method: Method to call.
+ :param url: Path to method endpoint.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param _request_timeout: timeout setting for this request.
+ :return: RESTResponse
+ """
+
try:
# perform request and return response
- response_data = self.request(
- method, url, query_params=query_params, headers=header_params,
- post_params=post_params, body=body,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout)
+ response_data = self.rest_client.request(
+ method, url,
+ headers=header_params,
+ body=body, post_params=post_params,
+ _request_timeout=_request_timeout
+ )
+
except ApiException as e:
- e.body = e.body.decode('utf-8') if six.PY3 else e.body
raise e
- content_type = response_data.getheader('content-type')
+ return response_data
- self.last_response = response_data
-
- return_data = response_data
+ def response_deserialize(
+ self,
+ response_data: rest.RESTResponse,
+ response_types_map: Optional[Dict[str, ApiResponseT]]=None
+ ) -> ApiResponse[ApiResponseT]:
+ """Deserializes response into an object.
+ :param response_data: RESTResponse object to be deserialized.
+ :param response_types_map: dict of response types.
+ :return: ApiResponse
+ """
- if not _preload_content:
- return return_data
+ msg = "RESTResponse.read() must be called before passing it to response_deserialize()"
+ assert response_data.data is not None, msg
- if six.PY3 and response_type not in ["file", "bytes"]:
- match = None
- if content_type is not None:
- match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
- encoding = match.group(1) if match else "utf-8"
- response_data.data = response_data.data.decode(encoding)
+ response_type = response_types_map.get(str(response_data.status), None)
+ if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
+ # if not found, look for '1XX', '2XX', etc.
+ response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
# deserialize response data
- if response_type:
- return_data = self.deserialize(response_data, response_type)
- else:
- return_data = None
+ response_text = None
+ return_data = None
+ try:
+ if response_type == "bytearray":
+ return_data = response_data.data
+ elif response_type == "file":
+ return_data = self.__deserialize_file(response_data)
+ elif response_type is not None:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_text = response_data.data.decode(encoding)
+ return_data = self.deserialize(response_text, response_type, content_type)
+ finally:
+ if not 200 <= response_data.status <= 299:
+ raise ApiException.from_response(
+ http_resp=response_data,
+ body=response_text,
+ data=return_data,
+ )
- if _return_http_data_only:
- return (return_data)
- else:
- return (return_data, response_data.status,
- response_data.getheaders())
+ return ApiResponse(
+ status_code = response_data.status,
+ data = return_data,
+ headers = response_data.getheaders(),
+ raw_data = response_data.data
+ )
def sanitize_for_serialization(self, obj):
"""Builds a JSON POST object.
If obj is None, return None.
+ If obj is SecretStr, return obj.get_secret_value()
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
+ If obj is decimal.Decimal return string representation.
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is OpenAPI model, return the properties dict.
@@ -231,18 +350,26 @@ def sanitize_for_serialization(self, obj):
"""
if obj is None:
return None
+ elif isinstance(obj, Enum):
+ return obj.value
+ elif isinstance(obj, SecretStr):
+ return obj.get_secret_value()
elif isinstance(obj, self.PRIMITIVE_TYPES):
return obj
elif isinstance(obj, list):
- return [self.sanitize_for_serialization(sub_obj)
- for sub_obj in obj]
+ return [
+ self.sanitize_for_serialization(sub_obj) for sub_obj in obj
+ ]
elif isinstance(obj, tuple):
- return tuple(self.sanitize_for_serialization(sub_obj)
- for sub_obj in obj)
+ return tuple(
+ self.sanitize_for_serialization(sub_obj) for sub_obj in obj
+ )
elif isinstance(obj, (datetime.datetime, datetime.date)):
return obj.isoformat()
+ elif isinstance(obj, decimal.Decimal):
+ return str(obj)
- if isinstance(obj, dict):
+ elif isinstance(obj, dict):
obj_dict = obj
else:
# Convert model obj to dict except
@@ -250,32 +377,45 @@ def sanitize_for_serialization(self, obj):
# and attributes which value is not None.
# Convert attribute name to json key in
# model definition for request.
- obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
- for attr, _ in six.iteritems(obj.openapi_types)
- if getattr(obj, attr) is not None}
+ if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
+ obj_dict = obj.to_dict()
+ else:
+ obj_dict = obj.__dict__
- return {key: self.sanitize_for_serialization(val)
- for key, val in six.iteritems(obj_dict)}
+ return {
+ key: self.sanitize_for_serialization(val)
+ for key, val in obj_dict.items()
+ }
- def deserialize(self, response, response_type):
+ def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
"""Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
:param response_type: class literal for
deserialized object, or string of class name.
+ :param content_type: content type of response.
:return: deserialized object.
"""
- # handle file downloading
- # save response body into a tmp file and return the instance
- if response_type == "file":
- return self.__deserialize_file(response)
# fetch data from response object
- try:
- data = json.loads(response.data)
- except ValueError:
- data = response.data
+ if content_type is None:
+ try:
+ data = json.loads(response_text)
+ except ValueError:
+ data = response_text
+ elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
+ if response_text == "":
+ data = ""
+ else:
+ data = json.loads(response_text)
+ elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
+ data = response_text
+ else:
+ raise ApiException(
+ status=0,
+ reason="Unsupported content type: {0}".format(content_type)
+ )
return self.__deserialize(data, response_type)
@@ -290,16 +430,20 @@ def __deserialize(self, data, klass):
if data is None:
return None
- if type(klass) == str:
- if klass.startswith('list['):
- sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
+ if isinstance(klass, str):
+ if klass.startswith('List['):
+ m = re.match(r'List\[(.*)]', klass)
+ assert m is not None, "Malformed List type definition"
+ sub_kls = m.group(1)
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
- if klass.startswith('dict('):
- sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
+ if klass.startswith('Dict['):
+ m = re.match(r'Dict\[([^,]*), (.*)]', klass)
+ assert m is not None, "Malformed Dict type definition"
+ sub_kls = m.group(2)
return {k: self.__deserialize(v, sub_kls)
- for k, v in six.iteritems(data)}
+ for k, v in data.items()}
# convert str to class
if klass in self.NATIVE_TYPES_MAPPING:
@@ -315,131 +459,13 @@ def __deserialize(self, data, klass):
return self.__deserialize_date(data)
elif klass == datetime.datetime:
return self.__deserialize_datetime(data)
+ elif klass == decimal.Decimal:
+ return decimal.Decimal(data)
+ elif issubclass(klass, Enum):
+ return self.__deserialize_enum(data, klass)
else:
return self.__deserialize_model(data, klass)
- def call_api(self, resource_path, method,
- path_params=None, query_params=None, header_params=None,
- body=None, post_params=None, files=None,
- response_type=None, auth_settings=None, async_req=None,
- _return_http_data_only=None, collection_formats=None,
- _preload_content=True, _request_timeout=None, _host=None):
- """Makes the HTTP request (synchronous) and returns deserialized data.
-
- To make an async_req request, set the async_req parameter.
-
- :param resource_path: Path to method endpoint.
- :param method: Method to call.
- :param path_params: Path parameters in the url.
- :param query_params: Query parameters in the url.
- :param header_params: Header parameters to be
- placed in the request header.
- :param body: Request body.
- :param post_params dict: Request post form parameters,
- for `application/x-www-form-urlencoded`, `multipart/form-data`.
- :param auth_settings list: Auth Settings names for the request.
- :param response: Response data type.
- :param files dict: key -> filename, value -> filepath,
- for `multipart/form-data`.
- :param async_req bool: execute request asynchronously
- :param _return_http_data_only: response data without head status code
- and headers
- :param collection_formats: dict of collection formats for path, query,
- header, and post parameters.
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return:
- If async_req parameter is True,
- the request will be called asynchronously.
- The method will return the request thread.
- If parameter async_req is False or missing,
- then the method will return the response directly.
- """
- if not async_req:
- return self.__call_api(resource_path, method,
- path_params, query_params, header_params,
- body, post_params, files,
- response_type, auth_settings,
- _return_http_data_only, collection_formats,
- _preload_content, _request_timeout, _host)
-
- return self.pool.apply_async(self.__call_api, (resource_path,
- method, path_params,
- query_params,
- header_params, body,
- post_params, files,
- response_type,
- auth_settings,
- _return_http_data_only,
- collection_formats,
- _preload_content,
- _request_timeout,
- _host))
-
- def request(self, method, url, query_params=None, headers=None,
- post_params=None, body=None, _preload_content=True,
- _request_timeout=None):
- """Makes the HTTP request using RESTClient."""
- if method == "GET":
- return self.rest_client.GET(url,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- headers=headers)
- elif method == "HEAD":
- return self.rest_client.HEAD(url,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- headers=headers)
- elif method == "OPTIONS":
- return self.rest_client.OPTIONS(url,
- query_params=query_params,
- headers=headers,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout)
- elif method == "POST":
- return self.rest_client.POST(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "PUT":
- return self.rest_client.PUT(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "PATCH":
- return self.rest_client.PATCH(url,
- query_params=query_params,
- headers=headers,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- elif method == "DELETE":
- return self.rest_client.DELETE(url,
- query_params=query_params,
- headers=headers,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
- else:
- raise ApiValueError(
- "http method must be `GET`, `HEAD`, `OPTIONS`,"
- " `POST`, `PATCH`, `PUT` or `DELETE`."
- )
-
def parameters_to_tuples(self, params, collection_formats):
"""Get parameters as list of tuples, formatting collections.
@@ -447,10 +473,10 @@ def parameters_to_tuples(self, params, collection_formats):
:param dict collection_formats: Parameter collection formats
:return: Parameters as list of tuples, collections formatted
"""
- new_params = []
+ new_params: List[Tuple[str, str]] = []
if collection_formats is None:
collection_formats = {}
- for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
+ for k, v in params.items() if isinstance(params, dict) else params:
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
@@ -470,45 +496,94 @@ def parameters_to_tuples(self, params, collection_formats):
new_params.append((k, v))
return new_params
- def files_parameters(self, files=None):
+ def parameters_to_url_query(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: URL query string (e.g. a=Hello%20World&b=123)
+ """
+ new_params: List[Tuple[str, str]] = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params:
+ if isinstance(v, bool):
+ v = str(v).lower()
+ if isinstance(v, (int, float)):
+ v = str(v)
+ if isinstance(v, dict):
+ v = json.dumps(v)
+
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, quote(str(value))) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(quote(str(value)) for value in v))
+ )
+ else:
+ new_params.append((k, quote(str(v))))
+
+ return "&".join(["=".join(map(str, item)) for item in new_params])
+
+ def files_parameters(
+ self,
+ files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
+ ):
"""Builds form parameters.
:param files: File parameters.
:return: Form parameters with files.
"""
params = []
-
- if files:
- for k, v in six.iteritems(files):
- if not v:
- continue
- file_names = v if type(v) is list else [v]
- for n in file_names:
- with open(n, 'rb') as f:
- filename = os.path.basename(f.name)
- filedata = f.read()
- mimetype = (mimetypes.guess_type(filename)[0] or
- 'application/octet-stream')
- params.append(
- tuple([k, tuple([filename, filedata, mimetype])]))
-
+ for k, v in files.items():
+ if isinstance(v, str):
+ with open(v, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ elif isinstance(v, bytes):
+ filename = k
+ filedata = v
+ elif isinstance(v, tuple):
+ filename, filedata = v
+ elif isinstance(v, list):
+ for file_param in v:
+ params.extend(self.files_parameters({k: file_param}))
+ continue
+ else:
+ raise ValueError("Unsupported file value")
+ mimetype = (
+ mimetypes.guess_type(filename)[0]
+ or 'application/octet-stream'
+ )
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])])
+ )
return params
- def select_header_accept(self, accepts):
+ def select_header_accept(self, accepts: List[str]) -> Optional[str]:
"""Returns `Accept` based on an array of accepts provided.
:param accepts: List of headers.
:return: Accept (e.g. application/json).
"""
if not accepts:
- return
+ return None
- accepts = [x.lower() for x in accepts]
+ for accept in accepts:
+ if re.search('json', accept, re.IGNORECASE):
+ return accept
- if 'application/json' in accepts:
- return 'application/json'
- else:
- return ', '.join(accepts)
+ return accepts[0]
def select_header_content_type(self, content_types):
"""Returns `Content-Type` based on an array of content_types provided.
@@ -517,45 +592,101 @@ def select_header_content_type(self, content_types):
:return: Content-Type (e.g. application/json).
"""
if not content_types:
- return 'application/json'
-
- content_types = [x.lower() for x in content_types]
-
- if 'application/json' in content_types or '*/*' in content_types:
- return 'application/json'
- else:
- return content_types[0]
+ return None
- def update_params_for_auth(self, headers, querys, auth_settings):
+ for content_type in content_types:
+ if re.search('json', content_type, re.IGNORECASE):
+ return content_type
+
+ return content_types[0]
+
+ def update_params_for_auth(
+ self,
+ headers,
+ queries,
+ auth_settings,
+ resource_path,
+ method,
+ body,
+ request_auth=None
+ ) -> None:
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
- :param querys: Query parameters tuple list to be updated.
+ :param queries: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
"""
if not auth_settings:
return
- for auth in auth_settings:
- auth_setting = self.configuration.auth_settings().get(auth)
- if auth_setting:
- if auth_setting['in'] == 'cookie':
- headers['Cookie'] = auth_setting['value']
- elif auth_setting['in'] == 'header':
- headers[auth_setting['key']] = auth_setting['value']
- elif auth_setting['in'] == 'query':
- querys.append((auth_setting['key'], auth_setting['value']))
- else:
- raise ApiValueError(
- 'Authentication token must be in `query` or `header`'
+ if request_auth:
+ self._apply_auth_params(
+ headers,
+ queries,
+ resource_path,
+ method,
+ body,
+ request_auth
+ )
+ else:
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(
+ headers,
+ queries,
+ resource_path,
+ method,
+ body,
+ auth_setting
)
+ def _apply_auth_params(
+ self,
+ headers,
+ queries,
+ resource_path,
+ method,
+ body,
+ auth_setting
+ ) -> None:
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+ elif auth_setting['in'] == 'query':
+ queries.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
def __deserialize_file(self, response):
"""Deserializes body to file
Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided.
+ handle file downloading
+ save response body into a tmp file and return the instance
+
:param response: RESTResponse.
:return: file path.
"""
@@ -565,8 +696,12 @@ def __deserialize_file(self, response):
content_disposition = response.getheader("Content-Disposition")
if content_disposition:
- filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
- content_disposition).group(1)
+ m = re.search(
+ r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition
+ )
+ assert m is not None, "Unexpected 'content-disposition' header value"
+ filename = m.group(1)
path = os.path.join(os.path.dirname(path), filename)
with open(path, "wb") as f:
@@ -585,7 +720,7 @@ def __deserialize_primitive(self, data, klass):
try:
return klass(data)
except UnicodeEncodeError:
- return six.text_type(data)
+ return str(data)
except TypeError:
return data
@@ -633,6 +768,24 @@ def __deserialize_datetime(self, string):
)
)
+ def __deserialize_enum(self, data, klass):
+ """Deserializes primitive type to enum.
+
+ :param data: primitive type.
+ :param klass: class literal.
+ :return: enum value.
+ """
+ try:
+ return klass(data)
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as `{1}`"
+ .format(data, klass)
+ )
+ )
+
def __deserialize_model(self, data, klass):
"""Deserializes list or dict to model.
@@ -640,27 +793,5 @@ def __deserialize_model(self, data, klass):
:param klass: class literal.
:return: model object.
"""
- has_discriminator = False
- if (hasattr(klass, 'get_real_child_model')
- and klass.discriminator_value_class_map):
- has_discriminator = True
-
- if not klass.openapi_types and has_discriminator is False:
- return data
- kwargs = {}
- if (data is not None and
- klass.openapi_types is not None and
- isinstance(data, (list, dict))):
- for attr, attr_type in six.iteritems(klass.openapi_types):
- if klass.attribute_map[attr] in data:
- value = data[klass.attribute_map[attr]]
- kwargs[attr] = self.__deserialize(value, attr_type)
-
- instance = klass(**kwargs)
-
- if has_discriminator:
- klass_name = instance.get_real_child_model(data)
- if klass_name:
- instance = self.__deserialize(data, klass_name)
- return instance
+ return klass.from_dict(data)
diff --git a/lilt/api_response.py b/lilt/api_response.py
new file mode 100644
index 0000000..9bc7c11
--- /dev/null
+++ b/lilt/api_response.py
@@ -0,0 +1,21 @@
+"""API response object."""
+
+from __future__ import annotations
+from typing import Optional, Generic, Mapping, TypeVar
+from pydantic import Field, StrictInt, StrictBytes, BaseModel
+
+T = TypeVar("T")
+
+class ApiResponse(BaseModel, Generic[T]):
+ """
+ API response object
+ """
+
+ status_code: StrictInt = Field(description="HTTP status code")
+ headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
+ data: T = Field(description="Deserialized data given the data type")
+ raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
+
+ model_config = {
+ "arbitrary_types_allowed": True
+ }
diff --git a/lilt/configuration.py b/lilt/configuration.py
index e3958aa..1718620 100644
--- a/lilt/configuration.py
+++ b/lilt/configuration.py
@@ -3,52 +3,167 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import copy
+import http.client as httplib
import logging
+from logging import FileHandler
import multiprocessing
import sys
+from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
+from typing_extensions import NotRequired, Self
+
import urllib3
-import six
-from six.moves import http_client as httplib
+JSON_SCHEMA_VALIDATION_KEYWORDS = {
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
+ 'minimum', 'exclusiveMinimum', 'maxLength',
+ 'minLength', 'pattern', 'maxItems', 'minItems'
+}
-class Configuration(object):
- """NOTE: This class is auto generated by OpenAPI Generator
+ServerVariablesT = Dict[str, str]
- Ref: https://openapi-generator.tech
- Do not edit the class manually.
+GenericAuthSetting = TypedDict(
+ "GenericAuthSetting",
+ {
+ "type": str,
+ "in": str,
+ "key": str,
+ "value": str,
+ },
+)
+
+
+OAuth2AuthSetting = TypedDict(
+ "OAuth2AuthSetting",
+ {
+ "type": Literal["oauth2"],
+ "in": Literal["header"],
+ "key": Literal["Authorization"],
+ "value": str,
+ },
+)
+
+
+APIKeyAuthSetting = TypedDict(
+ "APIKeyAuthSetting",
+ {
+ "type": Literal["api_key"],
+ "in": str,
+ "key": str,
+ "value": Optional[str],
+ },
+)
+
+
+BasicAuthSetting = TypedDict(
+ "BasicAuthSetting",
+ {
+ "type": Literal["basic"],
+ "in": Literal["header"],
+ "key": Literal["Authorization"],
+ "value": Optional[str],
+ },
+)
+
+
+BearerFormatAuthSetting = TypedDict(
+ "BearerFormatAuthSetting",
+ {
+ "type": Literal["bearer"],
+ "in": Literal["header"],
+ "format": Literal["JWT"],
+ "key": Literal["Authorization"],
+ "value": str,
+ },
+)
- :param host: Base url
+
+BearerAuthSetting = TypedDict(
+ "BearerAuthSetting",
+ {
+ "type": Literal["bearer"],
+ "in": Literal["header"],
+ "key": Literal["Authorization"],
+ "value": str,
+ },
+)
+
+
+HTTPSignatureAuthSetting = TypedDict(
+ "HTTPSignatureAuthSetting",
+ {
+ "type": Literal["http-signature"],
+ "in": Literal["header"],
+ "key": Literal["Authorization"],
+ "value": None,
+ },
+)
+
+
+AuthSettings = TypedDict(
+ "AuthSettings",
+ {
+ "BasicAuth": BasicAuthSetting,
+ "ApiKeyAuth": APIKeyAuthSetting,
+ },
+ total=False,
+)
+
+
+class HostSettingVariable(TypedDict):
+ description: str
+ default_value: str
+ enum_values: List[str]
+
+
+class HostSetting(TypedDict):
+ url: str
+ description: str
+ variables: NotRequired[Dict[str, HostSettingVariable]]
+
+
+class Configuration:
+ """This class contains various settings of the API client.
+
+ :param host: Base url.
+ :param ignore_operation_servers
+ Boolean to ignore operation servers for the API client.
+ Config will use `host` as the base url regardless of the operation servers.
:param api_key: Dict to store API key(s).
Each entry in the dict specifies an API key.
The dict key is the name of the security scheme in the OAS specification.
The dict value is the API key secret.
- :param api_key_prefix: Dict to store API prefix (e.g. Bearer)
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
The dict key is the name of the security scheme in the OAS specification.
The dict value is an API key prefix when generating the auth data.
- :param username: Username for HTTP basic authentication
- :param password: Password for HTTP basic authentication
- :param discard_unknown_keys: Boolean value indicating whether to discard
- unknown properties. A server may send a response that includes additional
- properties that are not known by the client in the following scenarios:
- 1. The OpenAPI document is incomplete, i.e. it does not match the server
- implementation.
- 2. The client was generated using an older version of the OpenAPI document
- and the server has been upgraded since then.
- If a schema in the OpenAPI document defines the additionalProperties attribute,
- then all undeclared properties received by the server are injected into the
- additional properties map. In that case, there are undeclared properties, and
- nothing to discard.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param access_token: Access token.
+ :param server_index: Index to servers configuration.
+ :param server_variables: Mapping with string values to replace variables in
+ templated server configuration. The validation of enums is performed for
+ variables with defined enum values before.
+ :param server_operation_index: Mapping from operation ID to an index to server
+ configuration.
+ :param server_operation_variables: Mapping from operation ID to a mapping with
+ string values to replace variables in templated server configuration.
+ The validation of enums is performed for variables with defined enum
+ values before.
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ in PEM format.
+ :param retries: Number of retries for API requests.
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
+ in PEM (str) or DER (bytes) format.
:Example:
@@ -88,18 +203,43 @@ class Configuration(object):
"""
- _default = None
-
- def __init__(self, host="https://api.lilt.com",
- api_key=None, api_key_prefix=None,
- username=None, password=None,
- discard_unknown_keys=False,
- ):
+ _default: ClassVar[Optional[Self]] = None
+
+ def __init__(
+ self,
+ host: Optional[str]=None,
+ api_key: Optional[Dict[str, str]]=None,
+ api_key_prefix: Optional[Dict[str, str]]=None,
+ username: Optional[str]=None,
+ password: Optional[str]=None,
+ access_token: Optional[str]=None,
+ server_index: Optional[int]=None,
+ server_variables: Optional[ServerVariablesT]=None,
+ server_operation_index: Optional[Dict[int, int]]=None,
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
+ ignore_operation_servers: bool=False,
+ ssl_ca_cert: Optional[str]=None,
+ retries: Optional[int] = None,
+ ca_cert_data: Optional[Union[str, bytes]] = None,
+ *,
+ debug: Optional[bool] = None,
+ ) -> None:
"""Constructor
"""
- self.host = host
+ self._base_path = "https://api.lilt.com" if host is None else host
"""Default Base url
"""
+ self.server_index = 0 if server_index is None and host is None else server_index
+ self.server_operation_index = server_operation_index or {}
+ """Default server index
+ """
+ self.server_variables = server_variables or {}
+ self.server_operation_variables = server_operation_variables or {}
+ """Default server variables
+ """
+ self.ignore_operation_servers = ignore_operation_servers
+ """Ignore operation servers
+ """
self.temp_folder_path = None
"""Temp file folder for downloading files
"""
@@ -123,7 +263,9 @@ def __init__(self, host="https://api.lilt.com",
self.password = password
"""Password for HTTP basic authentication
"""
- self.discard_unknown_keys = discard_unknown_keys
+ self.access_token = access_token
+ """Access token
+ """
self.logger = {}
"""Logging Settings
"""
@@ -135,13 +277,16 @@ def __init__(self, host="https://api.lilt.com",
self.logger_stream_handler = None
"""Log stream handler
"""
- self.logger_file_handler = None
+ self.logger_file_handler: Optional[FileHandler] = None
"""Log file handler
"""
self.logger_file = None
"""Debug file location
"""
- self.debug = False
+ if debug is not None:
+ self.debug = debug
+ else:
+ self.__debug = False
"""Debug switch
"""
@@ -150,9 +295,13 @@ def __init__(self, host="https://api.lilt.com",
Set this to false to skip verifying SSL certificate when calling API
from https server.
"""
- self.ssl_ca_cert = None
+ self.ssl_ca_cert = ssl_ca_cert
"""Set this to customize the certificate file to verify the peer.
"""
+ self.ca_cert_data = ca_cert_data
+ """Set this to verify the peer using PEM (str) or DER (bytes)
+ certificate data.
+ """
self.cert_file = None
"""client certificate file
"""
@@ -162,6 +311,10 @@ def __init__(self, host="https://api.lilt.com",
self.assert_hostname = None
"""Set this to True/False to enable/disable SSL hostname verification.
"""
+ self.tls_server_name = None
+ """SSL/TLS Server Name Indication (SNI)
+ Set this to the SNI value expected by the server.
+ """
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
"""urllib3 connection pool's maximum number of connections saved
@@ -171,7 +324,7 @@ def __init__(self, host="https://api.lilt.com",
cpu_count * 5 is used as default value to increase performance.
"""
- self.proxy = None
+ self.proxy: Optional[str] = None
"""Proxy URL
"""
self.proxy_headers = None
@@ -180,13 +333,25 @@ def __init__(self, host="https://api.lilt.com",
self.safe_chars_for_path_param = ''
"""Safe chars for path_param
"""
- self.retries = None
+ self.retries = retries
"""Adding retries to override urllib3 default value 3
"""
- # Disable client side validation
+ # Enable client side validation
self.client_side_validation = True
- def __deepcopy__(self, memo):
+ self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
+
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
+ """datetime format
+ """
+
+ self.date_format = "%Y-%m-%d"
+ """date format
+ """
+
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
cls = self.__class__
result = cls.__new__(cls)
memo[id(self)] = result
@@ -200,11 +365,11 @@ def __deepcopy__(self, memo):
result.debug = self.debug
return result
- def __setattr__(self, name, value):
+ def __setattr__(self, name: str, value: Any) -> None:
object.__setattr__(self, name, value)
@classmethod
- def set_default(cls, default):
+ def set_default(cls, default: Optional[Self]) -> None:
"""Set default instance of configuration.
It stores default configuration, which can be
@@ -212,24 +377,34 @@ def set_default(cls, default):
:param default: object of Configuration
"""
- cls._default = copy.deepcopy(default)
+ cls._default = default
@classmethod
- def get_default_copy(cls):
- """Return new instance of configuration.
+ def get_default_copy(cls) -> Self:
+ """Deprecated. Please use `get_default` instead.
+
+ Deprecated. Please use `get_default` instead.
+
+ :return: The configuration object.
+ """
+ return cls.get_default()
+
+ @classmethod
+ def get_default(cls) -> Self:
+ """Return the default configuration.
This method returns newly created, based on default constructor,
object of Configuration class or returns a copy of default
- configuration passed by the set_default method.
+ configuration.
:return: The configuration object.
"""
- if cls._default is not None:
- return copy.deepcopy(cls._default)
- return Configuration()
+ if cls._default is None:
+ cls._default = cls()
+ return cls._default
@property
- def logger_file(self):
+ def logger_file(self) -> Optional[str]:
"""The logger file.
If the logger_file is None, then add stream handler and remove file
@@ -241,7 +416,7 @@ def logger_file(self):
return self.__logger_file
@logger_file.setter
- def logger_file(self, value):
+ def logger_file(self, value: Optional[str]) -> None:
"""The logger file.
If the logger_file is None, then add stream handler and remove file
@@ -256,11 +431,11 @@ def logger_file(self, value):
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.addHandler(self.logger_file_handler)
@property
- def debug(self):
+ def debug(self) -> bool:
"""Debug status
:param value: The debug status, True or False.
@@ -269,7 +444,7 @@ def debug(self):
return self.__debug
@debug.setter
- def debug(self, value):
+ def debug(self, value: bool) -> None:
"""Debug status
:param value: The debug status, True or False.
@@ -278,20 +453,20 @@ def debug(self, value):
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
- for _, logger in six.iteritems(self.logger):
+ for _, logger in self.logger.items():
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
@property
- def logger_format(self):
+ def logger_format(self) -> str:
"""The logger format.
The logger_formatter will be updated when sets logger_format.
@@ -302,7 +477,7 @@ def logger_format(self):
return self.__logger_format
@logger_format.setter
- def logger_format(self, value):
+ def logger_format(self, value: str) -> None:
"""The logger format.
The logger_formatter will be updated when sets logger_format.
@@ -313,15 +488,16 @@ def logger_format(self, value):
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
- def get_api_key_with_prefix(self, identifier):
+ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
+ :param alias: The alternative identifier of apiKey.
:return: The token for api key authentication.
"""
if self.refresh_api_key_hook is not None:
self.refresh_api_key_hook(self)
- key = self.api_key.get(identifier)
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
if key:
prefix = self.api_key_prefix.get(identifier)
if prefix:
@@ -329,7 +505,9 @@ def get_api_key_with_prefix(self, identifier):
else:
return key
- def get_basic_auth_token(self):
+ return None
+
+ def get_basic_auth_token(self) -> Optional[str]:
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
@@ -344,19 +522,12 @@ def get_basic_auth_token(self):
basic_auth=username + ':' + password
).get('authorization')
- def auth_settings(self):
+ def auth_settings(self)-> AuthSettings:
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
- auth = {}
- if 'key' in self.api_key:
- auth['ApiKeyAuth'] = {
- 'type': 'api_key',
- 'in': 'query',
- 'key': 'key',
- 'value': self.get_api_key_with_prefix('key')
- }
+ auth: AuthSettings = {}
if self.username is not None and self.password is not None:
auth['BasicAuth'] = {
'type': 'basic',
@@ -364,9 +535,18 @@ def auth_settings(self):
'key': 'Authorization',
'value': self.get_basic_auth_token()
}
+ if 'ApiKeyAuth' in self.api_key:
+ auth['ApiKeyAuth'] = {
+ 'type': 'api_key',
+ 'in': 'query',
+ 'key': 'key',
+ 'value': self.get_api_key_with_prefix(
+ 'ApiKeyAuth',
+ ),
+ }
return auth
- def to_debug_report(self):
+ def to_debug_report(self) -> str:
"""Gets the essential information for debugging.
:return: The report for debugging.
@@ -374,11 +554,11 @@ def to_debug_report(self):
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
- "Version of the API: v3.0\n"\
- "SDK Package Version: 3.0.0".\
+ "Version of the API: v3.0.2\n"\
+ "SDK Package Version: v3.0.2".\
format(env=sys.platform, pyversion=sys.version)
- def get_host_settings(self):
+ def get_host_settings(self) -> List[HostSetting]:
"""Gets an array of host settings
:return: An array of host settings
@@ -390,14 +570,23 @@ def get_host_settings(self):
}
]
- def get_host_from_settings(self, index, variables=None):
+ def get_host_from_settings(
+ self,
+ index: Optional[int],
+ variables: Optional[ServerVariablesT]=None,
+ servers: Optional[List[HostSetting]]=None,
+ ) -> str:
"""Gets host URL based on the index and variables
:param index: array index of the host settings
:param variables: hash of variable and the corresponding value
+ :param servers: an array of host settings or None
:return: URL based on host settings
"""
+ if index is None:
+ return self._base_path
+
variables = {} if variables is None else variables
- servers = self.get_host_settings()
+ servers = self.get_host_settings() if servers is None else servers
try:
server = servers[index]
@@ -409,7 +598,7 @@ def get_host_from_settings(self, index, variables=None):
url = server['url']
# go through variables and replace placeholders
- for variable_name, variable in server['variables'].items():
+ for variable_name, variable in server.get('variables', {}).items():
used_value = variables.get(
variable_name, variable['default_value'])
@@ -424,3 +613,14 @@ def get_host_from_settings(self, index, variables=None):
url = url.replace("{" + variable_name + "}", used_value)
return url
+
+ @property
+ def host(self) -> str:
+ """Return generated host."""
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
+
+ @host.setter
+ def host(self, value: str) -> None:
+ """Fix base path."""
+ self._base_path = value
+ self.server_index = None
diff --git a/lilt/exceptions.py b/lilt/exceptions.py
index 97bdeb7..81f24d4 100644
--- a/lilt/exceptions.py
+++ b/lilt/exceptions.py
@@ -3,15 +3,16 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
-
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
-import six
+ Do not edit the class manually.
+""" # noqa: E501
+from typing import Any, Optional
+from typing_extensions import Self
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
@@ -19,7 +20,7 @@ class OpenApiException(Exception):
class ApiTypeError(OpenApiException, TypeError):
def __init__(self, msg, path_to_item=None, valid_classes=None,
- key_type=None):
+ key_type=None) -> None:
""" Raises an exception for TypeErrors
Args:
@@ -47,7 +48,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None,
class ApiValueError(OpenApiException, ValueError):
- def __init__(self, msg, path_to_item=None):
+ def __init__(self, msg, path_to_item=None) -> None:
"""
Args:
msg (str): the exception message
@@ -64,8 +65,27 @@ def __init__(self, msg, path_to_item=None):
super(ApiValueError, self).__init__(full_msg)
+class ApiAttributeError(OpenApiException, AttributeError):
+ def __init__(self, msg, path_to_item=None) -> None:
+ """
+ Raised when an attribute reference or assignment fails.
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiAttributeError, self).__init__(full_msg)
+
+
class ApiKeyError(OpenApiException, KeyError):
- def __init__(self, msg, path_to_item=None):
+ def __init__(self, msg, path_to_item=None) -> None:
"""
Args:
msg (str): the exception message
@@ -83,17 +103,63 @@ def __init__(self, msg, path_to_item=None):
class ApiException(OpenApiException):
- def __init__(self, status=None, reason=None, http_resp=None):
+ def __init__(
+ self,
+ status=None,
+ reason=None,
+ http_resp=None,
+ *,
+ body: Optional[str] = None,
+ data: Optional[Any] = None,
+ ) -> None:
+ self.status = status
+ self.reason = reason
+ self.body = body
+ self.data = data
+ self.headers = None
+
if http_resp:
- self.status = http_resp.status
- self.reason = http_resp.reason
- self.body = http_resp.data
+ if self.status is None:
+ self.status = http_resp.status
+ if self.reason is None:
+ self.reason = http_resp.reason
+ if self.body is None:
+ try:
+ self.body = http_resp.data.decode('utf-8')
+ except Exception:
+ pass
self.headers = http_resp.getheaders()
- else:
- self.status = status
- self.reason = reason
- self.body = None
- self.headers = None
+
+ @classmethod
+ def from_response(
+ cls,
+ *,
+ http_resp,
+ body: Optional[str],
+ data: Optional[Any],
+ ) -> Self:
+ if http_resp.status == 400:
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 401:
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 403:
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 404:
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
+
+ # Added new conditions for 409 and 422
+ if http_resp.status == 409:
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 422:
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
+
+ if 500 <= http_resp.status <= 599:
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
+ raise ApiException(http_resp=http_resp, body=body, data=data)
def __str__(self):
"""Custom error messages for exception"""
@@ -103,17 +169,47 @@ def __str__(self):
error_message += "HTTP response headers: {0}\n".format(
self.headers)
- if self.body:
- error_message += "HTTP response body: {0}\n".format(self.body)
+ if self.data or self.body:
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
return error_message
+class BadRequestException(ApiException):
+ pass
+
+
+class NotFoundException(ApiException):
+ pass
+
+
+class UnauthorizedException(ApiException):
+ pass
+
+
+class ForbiddenException(ApiException):
+ pass
+
+
+class ServiceException(ApiException):
+ pass
+
+
+class ConflictException(ApiException):
+ """Exception for HTTP 409 Conflict."""
+ pass
+
+
+class UnprocessableEntityException(ApiException):
+ """Exception for HTTP 422 Unprocessable Entity."""
+ pass
+
+
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
- if isinstance(pth, six.integer_types):
+ if isinstance(pth, int):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
diff --git a/lilt/models/__init__.py b/lilt/models/__init__.py
index 11a46a6..217f3ba 100644
--- a/lilt/models/__init__.py
+++ b/lilt/models/__init__.py
@@ -4,26 +4,32 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
# import models into model package
from lilt.models.add_file_label_request import AddFileLabelRequest
from lilt.models.create_converter_config_parameters import CreateConverterConfigParameters
+from lilt.models.create_webhook_options import CreateWebhookOptions
+from lilt.models.delete_lilt_create_content200_response import DeleteLiltCreateContent200Response
from lilt.models.delete_segment_from_memory_response import DeleteSegmentFromMemoryResponse
from lilt.models.document_with_segments import DocumentWithSegments
from lilt.models.document_without_segments import DocumentWithoutSegments
from lilt.models.document_without_segments_status import DocumentWithoutSegmentsStatus
+from lilt.models.domain import Domain
+from lilt.models.domain_list import DomainList
+from lilt.models.domain_metadata import DomainMetadata
+from lilt.models.domain_reference import DomainReference
from lilt.models.error import Error
from lilt.models.file_delete_response import FileDeleteResponse
+from lilt.models.filter_config import FilterConfig
from lilt.models.get_lilt_create_content_response import GetLiltCreateContentResponse
-from lilt.models.inline_response200 import InlineResponse200
from lilt.models.job import Job
from lilt.models.job_create_parameters import JobCreateParameters
from lilt.models.job_delete_response import JobDeleteResponse
@@ -42,6 +48,7 @@
from lilt.models.memory_delete_response import MemoryDeleteResponse
from lilt.models.memory_import_response import MemoryImportResponse
from lilt.models.memory_update_parameters import MemoryUpdateParameters
+from lilt.models.model import Model
from lilt.models.project import Project
from lilt.models.project_create_parameters import ProjectCreateParameters
from lilt.models.project_delete_response import ProjectDeleteResponse
@@ -56,6 +63,11 @@
from lilt.models.translation_info import TranslationInfo
from lilt.models.translation_list import TranslationList
from lilt.models.translation_memory_entry import TranslationMemoryEntry
+from lilt.models.webhook_response import WebhookResponse
+from lilt.models.webhooks_update_request import WebhooksUpdateRequest
+from lilt.models.webhooks_update_request_any_of import WebhooksUpdateRequestAnyOf
+from lilt.models.webhooks_update_request_any_of1 import WebhooksUpdateRequestAnyOf1
+from lilt.models.webhooks_update_request_any_of2 import WebhooksUpdateRequestAnyOf2
from lilt.models.workflow_stage_assignment import WorkflowStageAssignment
from lilt.models.workflow_stage_template import WorkflowStageTemplate
from lilt.models.workflow_template import WorkflowTemplate
diff --git a/lilt/models/add_file_label_request.py b/lilt/models/add_file_label_request.py
index acb6317..f1412e1 100644
--- a/lilt/models/add_file_label_request.py
+++ b/lilt/models/add_file_label_request.py
@@ -3,120 +3,85 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class AddFileLabelRequest(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
- Do not edit the class manually.
+class AddFileLabelRequest(BaseModel):
"""
+ AddFileLabelRequest
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, description="The Label name.")
+ __properties: ClassVar[List[str]] = ["name"]
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'name': 'str'
- }
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
- attribute_map = {
- 'name': 'name'
- }
- def __init__(self, name=None, local_vars_configuration=None): # noqa: E501
- """AddFileLabelRequest - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
- self._name = None
- self.discriminator = None
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
- if name is not None:
- self.name = name
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of AddFileLabelRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
- @property
- def name(self):
- """Gets the name of this AddFileLabelRequest. # noqa: E501
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
- The Label name. # noqa: E501
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
- :return: The name of this AddFileLabelRequest. # noqa: E501
- :rtype: str
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._name
+ excluded_fields: Set[str] = set([
+ ])
- @name.setter
- def name(self, name):
- """Sets the name of this AddFileLabelRequest.
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- The Label name. # noqa: E501
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of AddFileLabelRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name")
+ })
+ return _obj
- :param name: The name of this AddFileLabelRequest. # noqa: E501
- :type: str
- """
- self._name = name
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, AddFileLabelRequest):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, AddFileLabelRequest):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/create_converter_config_parameters.py b/lilt/models/create_converter_config_parameters.py
index 125e8ac..f3a0aed 100644
--- a/lilt/models/create_converter_config_parameters.py
+++ b/lilt/models/create_converter_config_parameters.py
@@ -3,121 +3,85 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
+from pydantic import BaseModel, ConfigDict, Field, StrictBool
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
-from lilt.configuration import Configuration
+class CreateConverterConfigParameters(BaseModel):
+ """
+ CreateConverterConfigParameters
+ """ # noqa: E501
+ signed_agreement: StrictBool = Field(description="Signifies that the Organization has signed the agreement or not.", alias="signedAgreement")
+ __properties: ClassVar[List[str]] = ["signedAgreement"]
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
-class CreateConverterConfigParameters(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
- Do not edit the class manually.
- """
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'signed_agreement': 'bool'
- }
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
- attribute_map = {
- 'signed_agreement': 'signedAgreement'
- }
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of CreateConverterConfigParameters from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
- def __init__(self, signed_agreement=None, local_vars_configuration=None): # noqa: E501
- """CreateConverterConfigParameters - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
- self._signed_agreement = None
- self.discriminator = None
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
- self.signed_agreement = signed_agreement
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
- @property
- def signed_agreement(self):
- """Gets the signed_agreement of this CreateConverterConfigParameters. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- Signifies that the Organization has signed the agreement or not. # noqa: E501
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of CreateConverterConfigParameters from a dict"""
+ if obj is None:
+ return None
- :return: The signed_agreement of this CreateConverterConfigParameters. # noqa: E501
- :rtype: bool
- """
- return self._signed_agreement
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @signed_agreement.setter
- def signed_agreement(self, signed_agreement):
- """Sets the signed_agreement of this CreateConverterConfigParameters.
+ _obj = cls.model_validate({
+ "signedAgreement": obj.get("signedAgreement")
+ })
+ return _obj
- Signifies that the Organization has signed the agreement or not. # noqa: E501
- :param signed_agreement: The signed_agreement of this CreateConverterConfigParameters. # noqa: E501
- :type: bool
- """
- if self.local_vars_configuration.client_side_validation and signed_agreement is None: # noqa: E501
- raise ValueError("Invalid value for `signed_agreement`, must not be `None`") # noqa: E501
-
- self._signed_agreement = signed_agreement
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, CreateConverterConfigParameters):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, CreateConverterConfigParameters):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/create_webhook_options.py b/lilt/models/create_webhook_options.py
new file mode 100644
index 0000000..c0bf716
--- /dev/null
+++ b/lilt/models/create_webhook_options.py
@@ -0,0 +1,99 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class CreateWebhookOptions(BaseModel):
+ """
+ CreateWebhookOptions
+ """ # noqa: E501
+ webhook_name: StrictStr = Field(description="The name of the webhook configuration.", alias="webhookName")
+ webhook_url: StrictStr = Field(description="The URL to which the webhook notifications will be sent.", alias="webhookUrl")
+ event_type: List[StrictStr] = Field(description="The list of event types that will trigger the webhook notification.", alias="eventType")
+ __properties: ClassVar[List[str]] = ["webhookName", "webhookUrl", "eventType"]
+
+ @field_validator('event_type')
+ def event_type_validate_enum(cls, value):
+ """Validates the enum"""
+ for i in value:
+ if i not in set(['JOB_DELIVER', 'JOB_UPDATE', 'PROJECT_DELIVER', 'PROJECT_UPDATE']):
+ raise ValueError("each list item must be one of ('JOB_DELIVER', 'JOB_UPDATE', 'PROJECT_DELIVER', 'PROJECT_UPDATE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of CreateWebhookOptions from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of CreateWebhookOptions from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "webhookName": obj.get("webhookName"),
+ "webhookUrl": obj.get("webhookUrl"),
+ "eventType": obj.get("eventType")
+ })
+ return _obj
+
+
diff --git a/lilt/models/delete_lilt_create_content200_response.py b/lilt/models/delete_lilt_create_content200_response.py
new file mode 100644
index 0000000..9d8cbf0
--- /dev/null
+++ b/lilt/models/delete_lilt_create_content200_response.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class DeleteLiltCreateContent200Response(BaseModel):
+ """
+ DeleteLiltCreateContent200Response
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="The ID of the deleted Lilt Create content.")
+ __properties: ClassVar[List[str]] = ["id"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DeleteLiltCreateContent200Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DeleteLiltCreateContent200Response from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id")
+ })
+ return _obj
+
+
diff --git a/lilt/models/delete_segment_from_memory_response.py b/lilt/models/delete_segment_from_memory_response.py
index 53f945f..d189100 100644
--- a/lilt/models/delete_segment_from_memory_response.py
+++ b/lilt/models/delete_segment_from_memory_response.py
@@ -3,118 +3,85 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class DeleteSegmentFromMemoryResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
+from pydantic import BaseModel, ConfigDict, StrictBool
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
- Do not edit the class manually.
+class DeleteSegmentFromMemoryResponse(BaseModel):
"""
+ DeleteSegmentFromMemoryResponse
+ """ # noqa: E501
+ success: Optional[StrictBool] = None
+ __properties: ClassVar[List[str]] = ["success"]
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'success': 'bool'
- }
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
- attribute_map = {
- 'success': 'success'
- }
- def __init__(self, success=None, local_vars_configuration=None): # noqa: E501
- """DeleteSegmentFromMemoryResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
- self._success = None
- self.discriminator = None
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
- if success is not None:
- self.success = success
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DeleteSegmentFromMemoryResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
- @property
- def success(self):
- """Gets the success of this DeleteSegmentFromMemoryResponse. # noqa: E501
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
- :return: The success of this DeleteSegmentFromMemoryResponse. # noqa: E501
- :rtype: bool
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._success
+ excluded_fields: Set[str] = set([
+ ])
- @success.setter
- def success(self, success):
- """Sets the success of this DeleteSegmentFromMemoryResponse.
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DeleteSegmentFromMemoryResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "success": obj.get("success")
+ })
+ return _obj
- :param success: The success of this DeleteSegmentFromMemoryResponse. # noqa: E501
- :type: bool
- """
- self._success = success
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, DeleteSegmentFromMemoryResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, DeleteSegmentFromMemoryResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/document_with_segments.py b/lilt/models/document_with_segments.py
index 068a094..0c726a1 100644
--- a/lilt/models/document_with_segments.py
+++ b/lilt/models/document_with_segments.py
@@ -3,622 +3,133 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class DocumentWithSegments(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.document_without_segments_status import DocumentWithoutSegmentsStatus
+from lilt.models.segment import Segment
+from typing import Optional, Set
+from typing_extensions import Self
+class DocumentWithSegments(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'project_id': 'int',
- 'srclang': 'str',
- 'trglang': 'str',
- 'name': 'str',
- 'import_in_progress': 'bool',
- 'import_succeeded': 'bool',
- 'import_error_message': 'str',
- 'export_in_progress': 'bool',
- 'export_succeeded': 'bool',
- 'export_error_message': 'str',
- 'is_pretranslating': 'bool',
- 'status': 'DocumentWithoutSegmentsStatus',
- 'translator_email': 'str',
- 'reviewer_email': 'str',
- 'created_at': 'int',
- 'updated_at': 'int',
- 'is_review_complete': 'bool',
- 'segments': 'list[Segment]'
- }
-
- attribute_map = {
- 'id': 'id',
- 'project_id': 'project_id',
- 'srclang': 'srclang',
- 'trglang': 'trglang',
- 'name': 'name',
- 'import_in_progress': 'import_in_progress',
- 'import_succeeded': 'import_succeeded',
- 'import_error_message': 'import_error_message',
- 'export_in_progress': 'export_in_progress',
- 'export_succeeded': 'export_succeeded',
- 'export_error_message': 'export_error_message',
- 'is_pretranslating': 'is_pretranslating',
- 'status': 'status',
- 'translator_email': 'translator_email',
- 'reviewer_email': 'reviewer_email',
- 'created_at': 'created_at',
- 'updated_at': 'updated_at',
- 'is_review_complete': 'is_review_complete',
- 'segments': 'segments'
- }
-
- def __init__(self, id=None, project_id=None, srclang=None, trglang=None, name=None, import_in_progress=None, import_succeeded=None, import_error_message=None, export_in_progress=None, export_succeeded=None, export_error_message=None, is_pretranslating=None, status=None, translator_email=None, reviewer_email=None, created_at=None, updated_at=None, is_review_complete=None, segments=None, local_vars_configuration=None): # noqa: E501
- """DocumentWithSegments - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._project_id = None
- self._srclang = None
- self._trglang = None
- self._name = None
- self._import_in_progress = None
- self._import_succeeded = None
- self._import_error_message = None
- self._export_in_progress = None
- self._export_succeeded = None
- self._export_error_message = None
- self._is_pretranslating = None
- self._status = None
- self._translator_email = None
- self._reviewer_email = None
- self._created_at = None
- self._updated_at = None
- self._is_review_complete = None
- self._segments = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if project_id is not None:
- self.project_id = project_id
- if srclang is not None:
- self.srclang = srclang
- if trglang is not None:
- self.trglang = trglang
- if name is not None:
- self.name = name
- if import_in_progress is not None:
- self.import_in_progress = import_in_progress
- if import_succeeded is not None:
- self.import_succeeded = import_succeeded
- if import_error_message is not None:
- self.import_error_message = import_error_message
- if export_in_progress is not None:
- self.export_in_progress = export_in_progress
- if export_succeeded is not None:
- self.export_succeeded = export_succeeded
- if export_error_message is not None:
- self.export_error_message = export_error_message
- if is_pretranslating is not None:
- self.is_pretranslating = is_pretranslating
- if status is not None:
- self.status = status
- if translator_email is not None:
- self.translator_email = translator_email
- if reviewer_email is not None:
- self.reviewer_email = reviewer_email
- if created_at is not None:
- self.created_at = created_at
- if updated_at is not None:
- self.updated_at = updated_at
- if is_review_complete is not None:
- self.is_review_complete = is_review_complete
- if segments is not None:
- self.segments = segments
-
- @property
- def id(self):
- """Gets the id of this DocumentWithSegments. # noqa: E501
-
- A unique number identifying the Document. # noqa: E501
-
- :return: The id of this DocumentWithSegments. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this DocumentWithSegments.
-
- A unique number identifying the Document. # noqa: E501
-
- :param id: The id of this DocumentWithSegments. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def project_id(self):
- """Gets the project_id of this DocumentWithSegments. # noqa: E501
-
- A unique number identifying the Project. # noqa: E501
-
- :return: The project_id of this DocumentWithSegments. # noqa: E501
- :rtype: int
- """
- return self._project_id
-
- @project_id.setter
- def project_id(self, project_id):
- """Sets the project_id of this DocumentWithSegments.
-
- A unique number identifying the Project. # noqa: E501
-
- :param project_id: The project_id of this DocumentWithSegments. # noqa: E501
- :type: int
- """
-
- self._project_id = project_id
-
- @property
- def srclang(self):
- """Gets the srclang of this DocumentWithSegments. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The srclang of this DocumentWithSegments. # noqa: E501
- :rtype: str
- """
- return self._srclang
-
- @srclang.setter
- def srclang(self, srclang):
- """Sets the srclang of this DocumentWithSegments.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param srclang: The srclang of this DocumentWithSegments. # noqa: E501
- :type: str
- """
-
- self._srclang = srclang
-
- @property
- def trglang(self):
- """Gets the trglang of this DocumentWithSegments. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The trglang of this DocumentWithSegments. # noqa: E501
- :rtype: str
- """
- return self._trglang
-
- @trglang.setter
- def trglang(self, trglang):
- """Sets the trglang of this DocumentWithSegments.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param trglang: The trglang of this DocumentWithSegments. # noqa: E501
- :type: str
- """
-
- self._trglang = trglang
-
- @property
- def name(self):
- """Gets the name of this DocumentWithSegments. # noqa: E501
-
- The document name. # noqa: E501
-
- :return: The name of this DocumentWithSegments. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this DocumentWithSegments.
-
- The document name. # noqa: E501
-
- :param name: The name of this DocumentWithSegments. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def import_in_progress(self):
- """Gets the import_in_progress of this DocumentWithSegments. # noqa: E501
-
- True if the document is currently being imported # noqa: E501
-
- :return: The import_in_progress of this DocumentWithSegments. # noqa: E501
- :rtype: bool
- """
- return self._import_in_progress
-
- @import_in_progress.setter
- def import_in_progress(self, import_in_progress):
- """Sets the import_in_progress of this DocumentWithSegments.
-
- True if the document is currently being imported # noqa: E501
-
- :param import_in_progress: The import_in_progress of this DocumentWithSegments. # noqa: E501
- :type: bool
- """
-
- self._import_in_progress = import_in_progress
-
- @property
- def import_succeeded(self):
- """Gets the import_succeeded of this DocumentWithSegments. # noqa: E501
-
- True if the import process succeeded. # noqa: E501
-
- :return: The import_succeeded of this DocumentWithSegments. # noqa: E501
- :rtype: bool
- """
- return self._import_succeeded
-
- @import_succeeded.setter
- def import_succeeded(self, import_succeeded):
- """Sets the import_succeeded of this DocumentWithSegments.
-
- True if the import process succeeded. # noqa: E501
-
- :param import_succeeded: The import_succeeded of this DocumentWithSegments. # noqa: E501
- :type: bool
- """
-
- self._import_succeeded = import_succeeded
-
- @property
- def import_error_message(self):
- """Gets the import_error_message of this DocumentWithSegments. # noqa: E501
-
- Error message if `import_succeeded=false` # noqa: E501
-
- :return: The import_error_message of this DocumentWithSegments. # noqa: E501
- :rtype: str
- """
- return self._import_error_message
-
- @import_error_message.setter
- def import_error_message(self, import_error_message):
- """Sets the import_error_message of this DocumentWithSegments.
-
- Error message if `import_succeeded=false` # noqa: E501
-
- :param import_error_message: The import_error_message of this DocumentWithSegments. # noqa: E501
- :type: str
- """
-
- self._import_error_message = import_error_message
-
- @property
- def export_in_progress(self):
- """Gets the export_in_progress of this DocumentWithSegments. # noqa: E501
-
- True if the document is currently being exported for download # noqa: E501
-
- :return: The export_in_progress of this DocumentWithSegments. # noqa: E501
- :rtype: bool
- """
- return self._export_in_progress
-
- @export_in_progress.setter
- def export_in_progress(self, export_in_progress):
- """Sets the export_in_progress of this DocumentWithSegments.
-
- True if the document is currently being exported for download # noqa: E501
-
- :param export_in_progress: The export_in_progress of this DocumentWithSegments. # noqa: E501
- :type: bool
- """
-
- self._export_in_progress = export_in_progress
-
- @property
- def export_succeeded(self):
- """Gets the export_succeeded of this DocumentWithSegments. # noqa: E501
-
- True if the export process succeeded. # noqa: E501
-
- :return: The export_succeeded of this DocumentWithSegments. # noqa: E501
- :rtype: bool
- """
- return self._export_succeeded
-
- @export_succeeded.setter
- def export_succeeded(self, export_succeeded):
- """Sets the export_succeeded of this DocumentWithSegments.
-
- True if the export process succeeded. # noqa: E501
-
- :param export_succeeded: The export_succeeded of this DocumentWithSegments. # noqa: E501
- :type: bool
- """
-
- self._export_succeeded = export_succeeded
-
- @property
- def export_error_message(self):
- """Gets the export_error_message of this DocumentWithSegments. # noqa: E501
-
- Error message if `export_succeeded=false` # noqa: E501
-
- :return: The export_error_message of this DocumentWithSegments. # noqa: E501
- :rtype: str
- """
- return self._export_error_message
-
- @export_error_message.setter
- def export_error_message(self, export_error_message):
- """Sets the export_error_message of this DocumentWithSegments.
-
- Error message if `export_succeeded=false` # noqa: E501
-
- :param export_error_message: The export_error_message of this DocumentWithSegments. # noqa: E501
- :type: str
- """
-
- self._export_error_message = export_error_message
-
- @property
- def is_pretranslating(self):
- """Gets the is_pretranslating of this DocumentWithSegments. # noqa: E501
-
- True if the document is currently being pretranslated. # noqa: E501
-
- :return: The is_pretranslating of this DocumentWithSegments. # noqa: E501
- :rtype: bool
- """
- return self._is_pretranslating
-
- @is_pretranslating.setter
- def is_pretranslating(self, is_pretranslating):
- """Sets the is_pretranslating of this DocumentWithSegments.
-
- True if the document is currently being pretranslated. # noqa: E501
-
- :param is_pretranslating: The is_pretranslating of this DocumentWithSegments. # noqa: E501
- :type: bool
- """
-
- self._is_pretranslating = is_pretranslating
-
- @property
- def status(self):
- """Gets the status of this DocumentWithSegments. # noqa: E501
-
-
- :return: The status of this DocumentWithSegments. # noqa: E501
- :rtype: DocumentWithoutSegmentsStatus
- """
- return self._status
-
- @status.setter
- def status(self, status):
- """Sets the status of this DocumentWithSegments.
-
-
- :param status: The status of this DocumentWithSegments. # noqa: E501
- :type: DocumentWithoutSegmentsStatus
- """
-
- self._status = status
-
- @property
- def translator_email(self):
- """Gets the translator_email of this DocumentWithSegments. # noqa: E501
-
- The email of the assigned translator. # noqa: E501
-
- :return: The translator_email of this DocumentWithSegments. # noqa: E501
- :rtype: str
- """
- return self._translator_email
-
- @translator_email.setter
- def translator_email(self, translator_email):
- """Sets the translator_email of this DocumentWithSegments.
-
- The email of the assigned translator. # noqa: E501
-
- :param translator_email: The translator_email of this DocumentWithSegments. # noqa: E501
- :type: str
- """
-
- self._translator_email = translator_email
-
- @property
- def reviewer_email(self):
- """Gets the reviewer_email of this DocumentWithSegments. # noqa: E501
-
- The email of the assigned reviewer. # noqa: E501
-
- :return: The reviewer_email of this DocumentWithSegments. # noqa: E501
- :rtype: str
- """
- return self._reviewer_email
-
- @reviewer_email.setter
- def reviewer_email(self, reviewer_email):
- """Sets the reviewer_email of this DocumentWithSegments.
-
- The email of the assigned reviewer. # noqa: E501
-
- :param reviewer_email: The reviewer_email of this DocumentWithSegments. # noqa: E501
- :type: str
- """
-
- self._reviewer_email = reviewer_email
-
- @property
- def created_at(self):
- """Gets the created_at of this DocumentWithSegments. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The created_at of this DocumentWithSegments. # noqa: E501
- :rtype: int
- """
- return self._created_at
-
- @created_at.setter
- def created_at(self, created_at):
- """Sets the created_at of this DocumentWithSegments.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param created_at: The created_at of this DocumentWithSegments. # noqa: E501
- :type: int
- """
-
- self._created_at = created_at
-
- @property
- def updated_at(self):
- """Gets the updated_at of this DocumentWithSegments. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The updated_at of this DocumentWithSegments. # noqa: E501
- :rtype: int
- """
- return self._updated_at
-
- @updated_at.setter
- def updated_at(self, updated_at):
- """Sets the updated_at of this DocumentWithSegments.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param updated_at: The updated_at of this DocumentWithSegments. # noqa: E501
- :type: int
- """
-
- self._updated_at = updated_at
-
- @property
- def is_review_complete(self):
- """Gets the is_review_complete of this DocumentWithSegments. # noqa: E501
-
- Document review status. # noqa: E501
-
- :return: The is_review_complete of this DocumentWithSegments. # noqa: E501
- :rtype: bool
- """
- return self._is_review_complete
-
- @is_review_complete.setter
- def is_review_complete(self, is_review_complete):
- """Sets the is_review_complete of this DocumentWithSegments.
-
- Document review status. # noqa: E501
-
- :param is_review_complete: The is_review_complete of this DocumentWithSegments. # noqa: E501
- :type: bool
- """
-
- self._is_review_complete = is_review_complete
-
- @property
- def segments(self):
- """Gets the segments of this DocumentWithSegments. # noqa: E501
-
- A list of Segments. # noqa: E501
-
- :return: The segments of this DocumentWithSegments. # noqa: E501
- :rtype: list[Segment]
- """
- return self._segments
-
- @segments.setter
- def segments(self, segments):
- """Sets the segments of this DocumentWithSegments.
-
- A list of Segments. # noqa: E501
-
- :param segments: The segments of this DocumentWithSegments. # noqa: E501
- :type: list[Segment]
- """
-
- self._segments = segments
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, DocumentWithSegments):
- return False
-
- return self.to_dict() == other.to_dict()
+ A Document is a collection of zero or more Segments.
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the Document.")
+ project_id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the Project.")
+ srclang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ trglang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ name: Optional[StrictStr] = Field(default=None, description="The document name.")
+ import_in_progress: Optional[StrictBool] = Field(default=None, description="True if the document is currently being imported")
+ import_succeeded: Optional[StrictBool] = Field(default=None, description="True if the import process succeeded.")
+ import_error_message: Optional[StrictStr] = Field(default=None, description="Error message if `import_succeeded=false`")
+ export_in_progress: Optional[StrictBool] = Field(default=None, description="True if the document is currently being exported for download")
+ export_succeeded: Optional[StrictBool] = Field(default=None, description="True if the export process succeeded.")
+ export_error_message: Optional[StrictStr] = Field(default=None, description="Error message if `export_succeeded=false`")
+ is_pretranslating: Optional[StrictBool] = Field(default=None, description="True if the document is currently being pretranslated.")
+ status: Optional[DocumentWithoutSegmentsStatus] = None
+ translator_email: Optional[StrictStr] = Field(default=None, description="The email of the assigned translator.")
+ reviewer_email: Optional[StrictStr] = Field(default=None, description="The email of the assigned reviewer.")
+ created_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ updated_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ is_review_complete: Optional[StrictBool] = Field(default=None, description="Document review status.")
+ segments: Optional[List[Segment]] = Field(default=None, description="A list of Segments.")
+ __properties: ClassVar[List[str]] = ["id", "project_id", "srclang", "trglang", "name", "import_in_progress", "import_succeeded", "import_error_message", "export_in_progress", "export_succeeded", "export_error_message", "is_pretranslating", "status", "translator_email", "reviewer_email", "created_at", "updated_at", "is_review_complete", "segments"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DocumentWithSegments from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of status
+ if self.status:
+ _dict['status'] = self.status.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in segments (list)
+ _items = []
+ if self.segments:
+ for _item_segments in self.segments:
+ if _item_segments:
+ _items.append(_item_segments.to_dict())
+ _dict['segments'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DocumentWithSegments from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "project_id": obj.get("project_id"),
+ "srclang": obj.get("srclang"),
+ "trglang": obj.get("trglang"),
+ "name": obj.get("name"),
+ "import_in_progress": obj.get("import_in_progress"),
+ "import_succeeded": obj.get("import_succeeded"),
+ "import_error_message": obj.get("import_error_message"),
+ "export_in_progress": obj.get("export_in_progress"),
+ "export_succeeded": obj.get("export_succeeded"),
+ "export_error_message": obj.get("export_error_message"),
+ "is_pretranslating": obj.get("is_pretranslating"),
+ "status": DocumentWithoutSegmentsStatus.from_dict(obj["status"]) if obj.get("status") is not None else None,
+ "translator_email": obj.get("translator_email"),
+ "reviewer_email": obj.get("reviewer_email"),
+ "created_at": obj.get("created_at"),
+ "updated_at": obj.get("updated_at"),
+ "is_review_complete": obj.get("is_review_complete"),
+ "segments": [Segment.from_dict(_item) for _item in obj["segments"]] if obj.get("segments") is not None else None
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, DocumentWithSegments):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/document_without_segments.py b/lilt/models/document_without_segments.py
index 9582a7e..9bb2641 100644
--- a/lilt/models/document_without_segments.py
+++ b/lilt/models/document_without_segments.py
@@ -3,622 +3,125 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class DocumentWithoutSegments(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.document_without_segments_status import DocumentWithoutSegmentsStatus
+from typing import Optional, Set
+from typing_extensions import Self
+class DocumentWithoutSegments(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'project_id': 'int',
- 'srclang': 'str',
- 'trglang': 'str',
- 'name': 'str',
- 'import_in_progress': 'bool',
- 'import_succeeded': 'bool',
- 'import_error_message': 'str',
- 'export_in_progress': 'bool',
- 'export_succeeded': 'bool',
- 'export_error_message': 'str',
- 'is_pretranslating': 'bool',
- 'status': 'DocumentWithoutSegmentsStatus',
- 'translator_email': 'str',
- 'reviewer_email': 'str',
- 'customer_reviewer_email': 'str',
- 'created_at': 'int',
- 'updated_at': 'int',
- 'is_review_complete': 'bool'
- }
-
- attribute_map = {
- 'id': 'id',
- 'project_id': 'project_id',
- 'srclang': 'srclang',
- 'trglang': 'trglang',
- 'name': 'name',
- 'import_in_progress': 'import_in_progress',
- 'import_succeeded': 'import_succeeded',
- 'import_error_message': 'import_error_message',
- 'export_in_progress': 'export_in_progress',
- 'export_succeeded': 'export_succeeded',
- 'export_error_message': 'export_error_message',
- 'is_pretranslating': 'is_pretranslating',
- 'status': 'status',
- 'translator_email': 'translator_email',
- 'reviewer_email': 'reviewer_email',
- 'customer_reviewer_email': 'customer_reviewer_email',
- 'created_at': 'created_at',
- 'updated_at': 'updated_at',
- 'is_review_complete': 'is_review_complete'
- }
-
- def __init__(self, id=None, project_id=None, srclang=None, trglang=None, name=None, import_in_progress=None, import_succeeded=None, import_error_message=None, export_in_progress=None, export_succeeded=None, export_error_message=None, is_pretranslating=None, status=None, translator_email=None, reviewer_email=None, customer_reviewer_email=None, created_at=None, updated_at=None, is_review_complete=None, local_vars_configuration=None): # noqa: E501
- """DocumentWithoutSegments - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._project_id = None
- self._srclang = None
- self._trglang = None
- self._name = None
- self._import_in_progress = None
- self._import_succeeded = None
- self._import_error_message = None
- self._export_in_progress = None
- self._export_succeeded = None
- self._export_error_message = None
- self._is_pretranslating = None
- self._status = None
- self._translator_email = None
- self._reviewer_email = None
- self._customer_reviewer_email = None
- self._created_at = None
- self._updated_at = None
- self._is_review_complete = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if project_id is not None:
- self.project_id = project_id
- if srclang is not None:
- self.srclang = srclang
- if trglang is not None:
- self.trglang = trglang
- if name is not None:
- self.name = name
- if import_in_progress is not None:
- self.import_in_progress = import_in_progress
- if import_succeeded is not None:
- self.import_succeeded = import_succeeded
- if import_error_message is not None:
- self.import_error_message = import_error_message
- if export_in_progress is not None:
- self.export_in_progress = export_in_progress
- if export_succeeded is not None:
- self.export_succeeded = export_succeeded
- if export_error_message is not None:
- self.export_error_message = export_error_message
- if is_pretranslating is not None:
- self.is_pretranslating = is_pretranslating
- if status is not None:
- self.status = status
- if translator_email is not None:
- self.translator_email = translator_email
- if reviewer_email is not None:
- self.reviewer_email = reviewer_email
- if customer_reviewer_email is not None:
- self.customer_reviewer_email = customer_reviewer_email
- if created_at is not None:
- self.created_at = created_at
- if updated_at is not None:
- self.updated_at = updated_at
- if is_review_complete is not None:
- self.is_review_complete = is_review_complete
-
- @property
- def id(self):
- """Gets the id of this DocumentWithoutSegments. # noqa: E501
-
- A unique number identifying the Document. # noqa: E501
-
- :return: The id of this DocumentWithoutSegments. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this DocumentWithoutSegments.
-
- A unique number identifying the Document. # noqa: E501
-
- :param id: The id of this DocumentWithoutSegments. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def project_id(self):
- """Gets the project_id of this DocumentWithoutSegments. # noqa: E501
-
- A unique number identifying the Project. # noqa: E501
-
- :return: The project_id of this DocumentWithoutSegments. # noqa: E501
- :rtype: int
- """
- return self._project_id
-
- @project_id.setter
- def project_id(self, project_id):
- """Sets the project_id of this DocumentWithoutSegments.
-
- A unique number identifying the Project. # noqa: E501
-
- :param project_id: The project_id of this DocumentWithoutSegments. # noqa: E501
- :type: int
- """
-
- self._project_id = project_id
-
- @property
- def srclang(self):
- """Gets the srclang of this DocumentWithoutSegments. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The srclang of this DocumentWithoutSegments. # noqa: E501
- :rtype: str
- """
- return self._srclang
-
- @srclang.setter
- def srclang(self, srclang):
- """Sets the srclang of this DocumentWithoutSegments.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param srclang: The srclang of this DocumentWithoutSegments. # noqa: E501
- :type: str
- """
-
- self._srclang = srclang
-
- @property
- def trglang(self):
- """Gets the trglang of this DocumentWithoutSegments. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The trglang of this DocumentWithoutSegments. # noqa: E501
- :rtype: str
- """
- return self._trglang
-
- @trglang.setter
- def trglang(self, trglang):
- """Sets the trglang of this DocumentWithoutSegments.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param trglang: The trglang of this DocumentWithoutSegments. # noqa: E501
- :type: str
- """
-
- self._trglang = trglang
-
- @property
- def name(self):
- """Gets the name of this DocumentWithoutSegments. # noqa: E501
-
- The document name. # noqa: E501
-
- :return: The name of this DocumentWithoutSegments. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this DocumentWithoutSegments.
-
- The document name. # noqa: E501
-
- :param name: The name of this DocumentWithoutSegments. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def import_in_progress(self):
- """Gets the import_in_progress of this DocumentWithoutSegments. # noqa: E501
-
- True if the document is currently being imported # noqa: E501
-
- :return: The import_in_progress of this DocumentWithoutSegments. # noqa: E501
- :rtype: bool
- """
- return self._import_in_progress
-
- @import_in_progress.setter
- def import_in_progress(self, import_in_progress):
- """Sets the import_in_progress of this DocumentWithoutSegments.
-
- True if the document is currently being imported # noqa: E501
-
- :param import_in_progress: The import_in_progress of this DocumentWithoutSegments. # noqa: E501
- :type: bool
- """
-
- self._import_in_progress = import_in_progress
-
- @property
- def import_succeeded(self):
- """Gets the import_succeeded of this DocumentWithoutSegments. # noqa: E501
-
- True if the import process succeeded. # noqa: E501
-
- :return: The import_succeeded of this DocumentWithoutSegments. # noqa: E501
- :rtype: bool
- """
- return self._import_succeeded
-
- @import_succeeded.setter
- def import_succeeded(self, import_succeeded):
- """Sets the import_succeeded of this DocumentWithoutSegments.
-
- True if the import process succeeded. # noqa: E501
-
- :param import_succeeded: The import_succeeded of this DocumentWithoutSegments. # noqa: E501
- :type: bool
- """
-
- self._import_succeeded = import_succeeded
-
- @property
- def import_error_message(self):
- """Gets the import_error_message of this DocumentWithoutSegments. # noqa: E501
-
- Error message if `import_succeeded=false` # noqa: E501
-
- :return: The import_error_message of this DocumentWithoutSegments. # noqa: E501
- :rtype: str
- """
- return self._import_error_message
-
- @import_error_message.setter
- def import_error_message(self, import_error_message):
- """Sets the import_error_message of this DocumentWithoutSegments.
-
- Error message if `import_succeeded=false` # noqa: E501
-
- :param import_error_message: The import_error_message of this DocumentWithoutSegments. # noqa: E501
- :type: str
- """
-
- self._import_error_message = import_error_message
-
- @property
- def export_in_progress(self):
- """Gets the export_in_progress of this DocumentWithoutSegments. # noqa: E501
-
- True if the document is currently being exported for download # noqa: E501
-
- :return: The export_in_progress of this DocumentWithoutSegments. # noqa: E501
- :rtype: bool
- """
- return self._export_in_progress
-
- @export_in_progress.setter
- def export_in_progress(self, export_in_progress):
- """Sets the export_in_progress of this DocumentWithoutSegments.
-
- True if the document is currently being exported for download # noqa: E501
-
- :param export_in_progress: The export_in_progress of this DocumentWithoutSegments. # noqa: E501
- :type: bool
- """
-
- self._export_in_progress = export_in_progress
-
- @property
- def export_succeeded(self):
- """Gets the export_succeeded of this DocumentWithoutSegments. # noqa: E501
-
- True if the export process succeeded. # noqa: E501
-
- :return: The export_succeeded of this DocumentWithoutSegments. # noqa: E501
- :rtype: bool
- """
- return self._export_succeeded
-
- @export_succeeded.setter
- def export_succeeded(self, export_succeeded):
- """Sets the export_succeeded of this DocumentWithoutSegments.
-
- True if the export process succeeded. # noqa: E501
-
- :param export_succeeded: The export_succeeded of this DocumentWithoutSegments. # noqa: E501
- :type: bool
- """
-
- self._export_succeeded = export_succeeded
-
- @property
- def export_error_message(self):
- """Gets the export_error_message of this DocumentWithoutSegments. # noqa: E501
-
- Error message if `export_succeeded=false` # noqa: E501
-
- :return: The export_error_message of this DocumentWithoutSegments. # noqa: E501
- :rtype: str
- """
- return self._export_error_message
-
- @export_error_message.setter
- def export_error_message(self, export_error_message):
- """Sets the export_error_message of this DocumentWithoutSegments.
-
- Error message if `export_succeeded=false` # noqa: E501
-
- :param export_error_message: The export_error_message of this DocumentWithoutSegments. # noqa: E501
- :type: str
- """
-
- self._export_error_message = export_error_message
-
- @property
- def is_pretranslating(self):
- """Gets the is_pretranslating of this DocumentWithoutSegments. # noqa: E501
-
- True if the document is currently being pretranslated. # noqa: E501
-
- :return: The is_pretranslating of this DocumentWithoutSegments. # noqa: E501
- :rtype: bool
- """
- return self._is_pretranslating
-
- @is_pretranslating.setter
- def is_pretranslating(self, is_pretranslating):
- """Sets the is_pretranslating of this DocumentWithoutSegments.
-
- True if the document is currently being pretranslated. # noqa: E501
-
- :param is_pretranslating: The is_pretranslating of this DocumentWithoutSegments. # noqa: E501
- :type: bool
- """
-
- self._is_pretranslating = is_pretranslating
-
- @property
- def status(self):
- """Gets the status of this DocumentWithoutSegments. # noqa: E501
-
-
- :return: The status of this DocumentWithoutSegments. # noqa: E501
- :rtype: DocumentWithoutSegmentsStatus
- """
- return self._status
-
- @status.setter
- def status(self, status):
- """Sets the status of this DocumentWithoutSegments.
-
-
- :param status: The status of this DocumentWithoutSegments. # noqa: E501
- :type: DocumentWithoutSegmentsStatus
- """
-
- self._status = status
-
- @property
- def translator_email(self):
- """Gets the translator_email of this DocumentWithoutSegments. # noqa: E501
-
- The email of the assigned translator. # noqa: E501
-
- :return: The translator_email of this DocumentWithoutSegments. # noqa: E501
- :rtype: str
- """
- return self._translator_email
-
- @translator_email.setter
- def translator_email(self, translator_email):
- """Sets the translator_email of this DocumentWithoutSegments.
-
- The email of the assigned translator. # noqa: E501
-
- :param translator_email: The translator_email of this DocumentWithoutSegments. # noqa: E501
- :type: str
- """
-
- self._translator_email = translator_email
-
- @property
- def reviewer_email(self):
- """Gets the reviewer_email of this DocumentWithoutSegments. # noqa: E501
-
- The email of the assigned reviewer. # noqa: E501
-
- :return: The reviewer_email of this DocumentWithoutSegments. # noqa: E501
- :rtype: str
- """
- return self._reviewer_email
-
- @reviewer_email.setter
- def reviewer_email(self, reviewer_email):
- """Sets the reviewer_email of this DocumentWithoutSegments.
-
- The email of the assigned reviewer. # noqa: E501
-
- :param reviewer_email: The reviewer_email of this DocumentWithoutSegments. # noqa: E501
- :type: str
- """
-
- self._reviewer_email = reviewer_email
-
- @property
- def customer_reviewer_email(self):
- """Gets the customer_reviewer_email of this DocumentWithoutSegments. # noqa: E501
-
- The email of the assigned customer reviewer. Only present if the project was request by id. # noqa: E501
-
- :return: The customer_reviewer_email of this DocumentWithoutSegments. # noqa: E501
- :rtype: str
- """
- return self._customer_reviewer_email
-
- @customer_reviewer_email.setter
- def customer_reviewer_email(self, customer_reviewer_email):
- """Sets the customer_reviewer_email of this DocumentWithoutSegments.
-
- The email of the assigned customer reviewer. Only present if the project was request by id. # noqa: E501
-
- :param customer_reviewer_email: The customer_reviewer_email of this DocumentWithoutSegments. # noqa: E501
- :type: str
- """
-
- self._customer_reviewer_email = customer_reviewer_email
-
- @property
- def created_at(self):
- """Gets the created_at of this DocumentWithoutSegments. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The created_at of this DocumentWithoutSegments. # noqa: E501
- :rtype: int
- """
- return self._created_at
-
- @created_at.setter
- def created_at(self, created_at):
- """Sets the created_at of this DocumentWithoutSegments.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param created_at: The created_at of this DocumentWithoutSegments. # noqa: E501
- :type: int
- """
-
- self._created_at = created_at
-
- @property
- def updated_at(self):
- """Gets the updated_at of this DocumentWithoutSegments. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The updated_at of this DocumentWithoutSegments. # noqa: E501
- :rtype: int
- """
- return self._updated_at
-
- @updated_at.setter
- def updated_at(self, updated_at):
- """Sets the updated_at of this DocumentWithoutSegments.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param updated_at: The updated_at of this DocumentWithoutSegments. # noqa: E501
- :type: int
- """
-
- self._updated_at = updated_at
-
- @property
- def is_review_complete(self):
- """Gets the is_review_complete of this DocumentWithoutSegments. # noqa: E501
-
- Document review status. # noqa: E501
-
- :return: The is_review_complete of this DocumentWithoutSegments. # noqa: E501
- :rtype: bool
- """
- return self._is_review_complete
-
- @is_review_complete.setter
- def is_review_complete(self, is_review_complete):
- """Sets the is_review_complete of this DocumentWithoutSegments.
-
- Document review status. # noqa: E501
-
- :param is_review_complete: The is_review_complete of this DocumentWithoutSegments. # noqa: E501
- :type: bool
- """
-
- self._is_review_complete = is_review_complete
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, DocumentWithoutSegments):
- return False
-
- return self.to_dict() == other.to_dict()
+ A Document is a collection of zero or more Segments.
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the Document.")
+ project_id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the Project.")
+ srclang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ trglang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ name: Optional[StrictStr] = Field(default=None, description="The document name.")
+ import_in_progress: Optional[StrictBool] = Field(default=None, description="True if the document is currently being imported")
+ import_succeeded: Optional[StrictBool] = Field(default=None, description="True if the import process succeeded.")
+ import_error_message: Optional[StrictStr] = Field(default=None, description="Error message if `import_succeeded=false`")
+ export_in_progress: Optional[StrictBool] = Field(default=None, description="True if the document is currently being exported for download")
+ export_succeeded: Optional[StrictBool] = Field(default=None, description="True if the export process succeeded.")
+ export_error_message: Optional[StrictStr] = Field(default=None, description="Error message if `export_succeeded=false`")
+ is_pretranslating: Optional[StrictBool] = Field(default=None, description="True if the document is currently being pretranslated.")
+ status: Optional[DocumentWithoutSegmentsStatus] = None
+ translator_email: Optional[StrictStr] = Field(default=None, description="The email of the assigned translator.")
+ reviewer_email: Optional[StrictStr] = Field(default=None, description="The email of the assigned reviewer.")
+ customer_reviewer_email: Optional[StrictStr] = Field(default=None, description="The email of the assigned customer reviewer. Only present if the project was request by id.")
+ created_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ updated_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ is_review_complete: Optional[StrictBool] = Field(default=None, description="Document review status.")
+ __properties: ClassVar[List[str]] = ["id", "project_id", "srclang", "trglang", "name", "import_in_progress", "import_succeeded", "import_error_message", "export_in_progress", "export_succeeded", "export_error_message", "is_pretranslating", "status", "translator_email", "reviewer_email", "customer_reviewer_email", "created_at", "updated_at", "is_review_complete"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DocumentWithoutSegments from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of status
+ if self.status:
+ _dict['status'] = self.status.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DocumentWithoutSegments from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "project_id": obj.get("project_id"),
+ "srclang": obj.get("srclang"),
+ "trglang": obj.get("trglang"),
+ "name": obj.get("name"),
+ "import_in_progress": obj.get("import_in_progress"),
+ "import_succeeded": obj.get("import_succeeded"),
+ "import_error_message": obj.get("import_error_message"),
+ "export_in_progress": obj.get("export_in_progress"),
+ "export_succeeded": obj.get("export_succeeded"),
+ "export_error_message": obj.get("export_error_message"),
+ "is_pretranslating": obj.get("is_pretranslating"),
+ "status": DocumentWithoutSegmentsStatus.from_dict(obj["status"]) if obj.get("status") is not None else None,
+ "translator_email": obj.get("translator_email"),
+ "reviewer_email": obj.get("reviewer_email"),
+ "customer_reviewer_email": obj.get("customer_reviewer_email"),
+ "created_at": obj.get("created_at"),
+ "updated_at": obj.get("updated_at"),
+ "is_review_complete": obj.get("is_review_complete")
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, DocumentWithoutSegments):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/document_without_segments_status.py b/lilt/models/document_without_segments_status.py
index a28a664..edf91ec 100644
--- a/lilt/models/document_without_segments_status.py
+++ b/lilt/models/document_without_segments_status.py
@@ -3,124 +3,95 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class DocumentWithoutSegmentsStatus(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class DocumentWithoutSegmentsStatus(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'pretranslation': 'str'
- }
-
- attribute_map = {
- 'pretranslation': 'pretranslation'
- }
-
- def __init__(self, pretranslation=None, local_vars_configuration=None): # noqa: E501
- """DocumentWithoutSegmentsStatus - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._pretranslation = None
- self.discriminator = None
-
- if pretranslation is not None:
- self.pretranslation = pretranslation
+ A list of translations for the query term.
+ """ # noqa: E501
+ pretranslation: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["pretranslation"]
+
+ @field_validator('pretranslation')
+ def pretranslation_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['idle', 'pending', 'running']):
+ raise ValueError("must be one of enum values ('idle', 'pending', 'running')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DocumentWithoutSegmentsStatus from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
- @property
- def pretranslation(self):
- """Gets the pretranslation of this DocumentWithoutSegmentsStatus. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DocumentWithoutSegmentsStatus from a dict"""
+ if obj is None:
+ return None
- :return: The pretranslation of this DocumentWithoutSegmentsStatus. # noqa: E501
- :rtype: str
- """
- return self._pretranslation
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @pretranslation.setter
- def pretranslation(self, pretranslation):
- """Sets the pretranslation of this DocumentWithoutSegmentsStatus.
+ _obj = cls.model_validate({
+ "pretranslation": obj.get("pretranslation")
+ })
+ return _obj
- :param pretranslation: The pretranslation of this DocumentWithoutSegmentsStatus. # noqa: E501
- :type: str
- """
- allowed_values = ["idle", "pending", "running"] # noqa: E501
- if self.local_vars_configuration.client_side_validation and pretranslation not in allowed_values: # noqa: E501
- raise ValueError(
- "Invalid value for `pretranslation` ({0}), must be one of {1}" # noqa: E501
- .format(pretranslation, allowed_values)
- )
-
- self._pretranslation = pretranslation
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, DocumentWithoutSegmentsStatus):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, DocumentWithoutSegmentsStatus):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/domain.py b/lilt/models/domain.py
new file mode 100644
index 0000000..1dd67a3
--- /dev/null
+++ b/lilt/models/domain.py
@@ -0,0 +1,119 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List
+from lilt.models.domain_metadata import DomainMetadata
+from lilt.models.filter_config import FilterConfig
+from lilt.models.model import Model
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Domain(BaseModel):
+ """
+ Domain
+ """ # noqa: E501
+ domain_id: StrictInt = Field(description="The unique identifier for the domain.", alias="domainId")
+ domain_name: StrictStr = Field(description="The name of the domain.", alias="domainName")
+ models: List[Model] = Field(description="The models associated with the domain.")
+ filter_configs: List[FilterConfig] = Field(description="The filter configurations associated with the domain.", alias="filterConfigs")
+ domain_metadata: List[DomainMetadata] = Field(description="Metadata associated with the domain.", alias="domainMetadata")
+ __properties: ClassVar[List[str]] = ["domainId", "domainName", "models", "filterConfigs", "domainMetadata"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Domain from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in models (list)
+ _items = []
+ if self.models:
+ for _item_models in self.models:
+ if _item_models:
+ _items.append(_item_models.to_dict())
+ _dict['models'] = _items
+ # override the default output from pydantic by calling `to_dict()` of each item in filter_configs (list)
+ _items = []
+ if self.filter_configs:
+ for _item_filter_configs in self.filter_configs:
+ if _item_filter_configs:
+ _items.append(_item_filter_configs.to_dict())
+ _dict['filterConfigs'] = _items
+ # override the default output from pydantic by calling `to_dict()` of each item in domain_metadata (list)
+ _items = []
+ if self.domain_metadata:
+ for _item_domain_metadata in self.domain_metadata:
+ if _item_domain_metadata:
+ _items.append(_item_domain_metadata.to_dict())
+ _dict['domainMetadata'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Domain from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "domainId": obj.get("domainId"),
+ "domainName": obj.get("domainName"),
+ "models": [Model.from_dict(_item) for _item in obj["models"]] if obj.get("models") is not None else None,
+ "filterConfigs": [FilterConfig.from_dict(_item) for _item in obj["filterConfigs"]] if obj.get("filterConfigs") is not None else None,
+ "domainMetadata": [DomainMetadata.from_dict(_item) for _item in obj["domainMetadata"]] if obj.get("domainMetadata") is not None else None
+ })
+ return _obj
+
+
diff --git a/lilt/models/domain_list.py b/lilt/models/domain_list.py
new file mode 100644
index 0000000..63628a1
--- /dev/null
+++ b/lilt/models/domain_list.py
@@ -0,0 +1,97 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List
+from lilt.models.domain import Domain
+from typing import Optional, Set
+from typing_extensions import Self
+
+class DomainList(BaseModel):
+ """
+ DomainList
+ """ # noqa: E501
+ items: List[Domain] = Field(description="The list of domains in the response.")
+ size: StrictInt = Field(description="The total number of domains in the list.")
+ __properties: ClassVar[List[str]] = ["items", "size"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DomainList from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
+ _items = []
+ if self.items:
+ for _item_items in self.items:
+ if _item_items:
+ _items.append(_item_items.to_dict())
+ _dict['items'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DomainList from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "items": [Domain.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
+ "size": obj.get("size")
+ })
+ return _obj
+
+
diff --git a/lilt/models/domain_metadata.py b/lilt/models/domain_metadata.py
new file mode 100644
index 0000000..5168420
--- /dev/null
+++ b/lilt/models/domain_metadata.py
@@ -0,0 +1,91 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class DomainMetadata(BaseModel):
+ """
+ DomainMetadata
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="The unique identifier for the metadata.")
+ key: Optional[StrictStr] = Field(default=None, description="The key of the metadata.")
+ value: Optional[StrictStr] = Field(default=None, description="The value of the metadata.")
+ __properties: ClassVar[List[str]] = ["id", "key", "value"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DomainMetadata from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DomainMetadata from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "key": obj.get("key"),
+ "value": obj.get("value")
+ })
+ return _obj
+
+
diff --git a/lilt/models/domain_reference.py b/lilt/models/domain_reference.py
new file mode 100644
index 0000000..1beb97f
--- /dev/null
+++ b/lilt/models/domain_reference.py
@@ -0,0 +1,89 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class DomainReference(BaseModel):
+ """
+ DomainReference
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="The unique identifier for the domain.")
+ name: Optional[StrictStr] = Field(default=None, description="The name of the domain.")
+ __properties: ClassVar[List[str]] = ["id", "name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DomainReference from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DomainReference from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "name": obj.get("name")
+ })
+ return _obj
+
+
diff --git a/lilt/models/error.py b/lilt/models/error.py
index 126dd96..0756a28 100644
--- a/lilt/models/error.py
+++ b/lilt/models/error.py
@@ -3,120 +3,85 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class Error(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
- Do not edit the class manually.
+class Error(BaseModel):
"""
+ Response in the event of an unexpected error.
+ """ # noqa: E501
+ message: Optional[StrictStr] = Field(default=None, description="A human-readable message describing the error.")
+ __properties: ClassVar[List[str]] = ["message"]
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'message': 'str'
- }
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
- attribute_map = {
- 'message': 'message'
- }
- def __init__(self, message=None, local_vars_configuration=None): # noqa: E501
- """Error - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
- self._message = None
- self.discriminator = None
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
- if message is not None:
- self.message = message
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Error from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
- @property
- def message(self):
- """Gets the message of this Error. # noqa: E501
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
- A human-readable message describing the error. # noqa: E501
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
- :return: The message of this Error. # noqa: E501
- :rtype: str
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._message
+ excluded_fields: Set[str] = set([
+ ])
- @message.setter
- def message(self, message):
- """Sets the message of this Error.
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- A human-readable message describing the error. # noqa: E501
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Error from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "message": obj.get("message")
+ })
+ return _obj
- :param message: The message of this Error. # noqa: E501
- :type: str
- """
- self._message = message
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, Error):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, Error):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/file_delete_response.py b/lilt/models/file_delete_response.py
index 3633dce..ff8795f 100644
--- a/lilt/models/file_delete_response.py
+++ b/lilt/models/file_delete_response.py
@@ -3,148 +3,87 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class FileDeleteResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class FileDeleteResponse(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'deleted': 'bool'
- }
-
- attribute_map = {
- 'id': 'id',
- 'deleted': 'deleted'
- }
-
- def __init__(self, id=None, deleted=None, local_vars_configuration=None): # noqa: E501
- """FileDeleteResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._deleted = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if deleted is not None:
- self.deleted = deleted
-
- @property
- def id(self):
- """Gets the id of this FileDeleteResponse. # noqa: E501
-
- A unique File identifier. # noqa: E501
-
- :return: The id of this FileDeleteResponse. # noqa: E501
- :rtype: int
+ FileDeleteResponse
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique File identifier.")
+ deleted: Optional[StrictBool] = Field(default=None, description="If the operation succeeded, then `true`. Otherwise, `false`.")
+ __properties: ClassVar[List[str]] = ["id", "deleted"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of FileDeleteResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this FileDeleteResponse.
+ excluded_fields: Set[str] = set([
+ ])
- A unique File identifier. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- :param id: The id of this FileDeleteResponse. # noqa: E501
- :type: int
- """
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of FileDeleteResponse from a dict"""
+ if obj is None:
+ return None
- self._id = id
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @property
- def deleted(self):
- """Gets the deleted of this FileDeleteResponse. # noqa: E501
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "deleted": obj.get("deleted")
+ })
+ return _obj
- If the operation succeeded, then `true`. Otherwise, `false`. # noqa: E501
-
- :return: The deleted of this FileDeleteResponse. # noqa: E501
- :rtype: bool
- """
- return self._deleted
-
- @deleted.setter
- def deleted(self, deleted):
- """Sets the deleted of this FileDeleteResponse.
-
- If the operation succeeded, then `true`. Otherwise, `false`. # noqa: E501
-
- :param deleted: The deleted of this FileDeleteResponse. # noqa: E501
- :type: bool
- """
- self._deleted = deleted
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, FileDeleteResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, FileDeleteResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/filter_config.py b/lilt/models/filter_config.py
new file mode 100644
index 0000000..1c0bf56
--- /dev/null
+++ b/lilt/models/filter_config.py
@@ -0,0 +1,132 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.domain_reference import DomainReference
+from typing import Optional, Set
+from typing_extensions import Self
+
+class FilterConfig(BaseModel):
+ """
+ FilterConfig
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="The unique identifier for the filter configuration.")
+ is_default: Optional[StrictBool] = Field(default=None, description="Indicates if the filter configuration is the default.", alias="isDefault")
+ filter_config: Optional[StrictStr] = Field(default=None, description="The filter configuration.", alias="filterConfig")
+ filter_name: Optional[StrictStr] = Field(default=None, description="The name of the filter.", alias="filterName")
+ config_name: Optional[StrictStr] = Field(default=None, description="The name of the configuration.", alias="configName")
+ config_description: Optional[StrictStr] = Field(default=None, description="The description of the configuration.", alias="configDescription")
+ subfilters: Optional[StrictStr] = Field(default=None, description="The subfilters.")
+ segmentation_config_setting: Optional[StrictStr] = Field(default=None, description="The segmentation configuration setting.", alias="segmentationConfigSetting")
+ srx: Optional[StrictStr] = Field(default=None, description="The SRX (Segmentation Rules eXchange) data.")
+ segmentation_config_name: Optional[StrictStr] = Field(default=None, description="The name of the segmentation configuration.", alias="segmentationConfigName")
+ domains: Optional[List[DomainReference]] = Field(default=None, description="The domains associated with the filter configuration.")
+ created_at: Optional[datetime] = Field(default=None, description="The creation timestamp.", alias="createdAt")
+ updated_at: Optional[datetime] = Field(default=None, description="The last update timestamp.", alias="updatedAt")
+ default: Optional[StrictBool] = Field(default=None, description="Indicates if the filter configuration is the default.")
+ __properties: ClassVar[List[str]] = ["id", "isDefault", "filterConfig", "filterName", "configName", "configDescription", "subfilters", "segmentationConfigSetting", "srx", "segmentationConfigName", "domains", "createdAt", "updatedAt", "default"]
+
+ @field_validator('segmentation_config_setting')
+ def segmentation_config_setting_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['SENTENCE']):
+ raise ValueError("must be one of enum values ('SENTENCE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of FilterConfig from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in domains (list)
+ _items = []
+ if self.domains:
+ for _item_domains in self.domains:
+ if _item_domains:
+ _items.append(_item_domains.to_dict())
+ _dict['domains'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of FilterConfig from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "isDefault": obj.get("isDefault"),
+ "filterConfig": obj.get("filterConfig"),
+ "filterName": obj.get("filterName"),
+ "configName": obj.get("configName"),
+ "configDescription": obj.get("configDescription"),
+ "subfilters": obj.get("subfilters"),
+ "segmentationConfigSetting": obj.get("segmentationConfigSetting"),
+ "srx": obj.get("srx"),
+ "segmentationConfigName": obj.get("segmentationConfigName"),
+ "domains": [DomainReference.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None,
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "default": obj.get("default")
+ })
+ return _obj
+
+
diff --git a/lilt/models/get_lilt_create_content_response.py b/lilt/models/get_lilt_create_content_response.py
index d7dc7fd..574aa4f 100644
--- a/lilt/models/get_lilt_create_content_response.py
+++ b/lilt/models/get_lilt_create_content_response.py
@@ -3,120 +3,93 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class GetLiltCreateContentResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.lilt_create_content import LiltCreateContent
+from typing import Optional, Set
+from typing_extensions import Self
- Do not edit the class manually.
+class GetLiltCreateContentResponse(BaseModel):
"""
+ GetLiltCreateContentResponse
+ """ # noqa: E501
+ contents: Optional[List[LiltCreateContent]] = Field(default=None, description="List of LiltCreateContent objects")
+ __properties: ClassVar[List[str]] = ["contents"]
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'contents': 'list[LiltCreateContent]'
- }
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
- attribute_map = {
- 'contents': 'contents'
- }
- def __init__(self, contents=None, local_vars_configuration=None): # noqa: E501
- """GetLiltCreateContentResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
- self._contents = None
- self.discriminator = None
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
- if contents is not None:
- self.contents = contents
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of GetLiltCreateContentResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
- @property
- def contents(self):
- """Gets the contents of this GetLiltCreateContentResponse. # noqa: E501
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
- List of LiltCreateContent objects # noqa: E501
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
- :return: The contents of this GetLiltCreateContentResponse. # noqa: E501
- :rtype: list[LiltCreateContent]
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._contents
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in contents (list)
+ _items = []
+ if self.contents:
+ for _item_contents in self.contents:
+ if _item_contents:
+ _items.append(_item_contents.to_dict())
+ _dict['contents'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of GetLiltCreateContentResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "contents": [LiltCreateContent.from_dict(_item) for _item in obj["contents"]] if obj.get("contents") is not None else None
+ })
+ return _obj
- @contents.setter
- def contents(self, contents):
- """Sets the contents of this GetLiltCreateContentResponse.
-
- List of LiltCreateContent objects # noqa: E501
-
- :param contents: The contents of this GetLiltCreateContentResponse. # noqa: E501
- :type: list[LiltCreateContent]
- """
- self._contents = contents
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, GetLiltCreateContentResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, GetLiltCreateContentResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/job.py b/lilt/models/job.py
index 4aecb69..fdedefb 100644
--- a/lilt/models/job.py
+++ b/lilt/models/job.py
@@ -3,312 +3,104 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class Job(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.job_stats import JobStats
+from typing import Optional, Set
+from typing_extensions import Self
+class Job(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'name': 'str',
- 'creation_status': 'str',
- 'delivered_at': 'datetime',
- 'status': 'str',
- 'due': 'datetime',
- 'id': 'int',
- 'is_processing': 'int',
- 'stats': 'JobStats'
- }
-
- attribute_map = {
- 'name': 'name',
- 'creation_status': 'creationStatus',
- 'delivered_at': 'deliveredAt',
- 'status': 'status',
- 'due': 'due',
- 'id': 'id',
- 'is_processing': 'isProcessing',
- 'stats': 'stats'
- }
-
- def __init__(self, name=None, creation_status=None, delivered_at=None, status=None, due=None, id=None, is_processing=None, stats=None, local_vars_configuration=None): # noqa: E501
- """Job - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._name = None
- self._creation_status = None
- self._delivered_at = None
- self._status = None
- self._due = None
- self._id = None
- self._is_processing = None
- self._stats = None
- self.discriminator = None
-
- if name is not None:
- self.name = name
- if creation_status is not None:
- self.creation_status = creation_status
- if delivered_at is not None:
- self.delivered_at = delivered_at
- if status is not None:
- self.status = status
- if due is not None:
- self.due = due
- if id is not None:
- self.id = id
- if is_processing is not None:
- self.is_processing = is_processing
- if stats is not None:
- self.stats = stats
-
- @property
- def name(self):
- """Gets the name of this Job. # noqa: E501
-
- A name for the job. # noqa: E501
-
- :return: The name of this Job. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this Job.
-
- A name for the job. # noqa: E501
-
- :param name: The name of this Job. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def creation_status(self):
- """Gets the creation_status of this Job. # noqa: E501
-
- Status of job creation process that includes PENDING, COMPLETE, and FAILED. # noqa: E501
-
- :return: The creation_status of this Job. # noqa: E501
- :rtype: str
- """
- return self._creation_status
-
- @creation_status.setter
- def creation_status(self, creation_status):
- """Sets the creation_status of this Job.
-
- Status of job creation process that includes PENDING, COMPLETE, and FAILED. # noqa: E501
-
- :param creation_status: The creation_status of this Job. # noqa: E501
- :type: str
- """
-
- self._creation_status = creation_status
-
- @property
- def delivered_at(self):
- """Gets the delivered_at of this Job. # noqa: E501
-
-
- :return: The delivered_at of this Job. # noqa: E501
- :rtype: datetime
- """
- return self._delivered_at
-
- @delivered_at.setter
- def delivered_at(self, delivered_at):
- """Sets the delivered_at of this Job.
-
-
- :param delivered_at: The delivered_at of this Job. # noqa: E501
- :type: datetime
- """
-
- self._delivered_at = delivered_at
-
- @property
- def status(self):
- """Gets the status of this Job. # noqa: E501
-
- Current status of job that includes archived, delivered, and active. # noqa: E501
-
- :return: The status of this Job. # noqa: E501
- :rtype: str
- """
- return self._status
-
- @status.setter
- def status(self, status):
- """Sets the status of this Job.
-
- Current status of job that includes archived, delivered, and active. # noqa: E501
-
- :param status: The status of this Job. # noqa: E501
- :type: str
- """
-
- self._status = status
-
- @property
- def due(self):
- """Gets the due of this Job. # noqa: E501
-
- An ISO string date. # noqa: E501
-
- :return: The due of this Job. # noqa: E501
- :rtype: datetime
- """
- return self._due
-
- @due.setter
- def due(self, due):
- """Sets the due of this Job.
-
- An ISO string date. # noqa: E501
-
- :param due: The due of this Job. # noqa: E501
- :type: datetime
- """
-
- self._due = due
-
- @property
- def id(self):
- """Gets the id of this Job. # noqa: E501
-
- An id for the job. # noqa: E501
-
- :return: The id of this Job. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this Job.
-
- An id for the job. # noqa: E501
-
- :param id: The id of this Job. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def is_processing(self):
- """Gets the is_processing of this Job. # noqa: E501
-
- Values include `1` while in progress, `0` when idle and `-2` when processing failed. # noqa: E501
-
- :return: The is_processing of this Job. # noqa: E501
- :rtype: int
- """
- return self._is_processing
-
- @is_processing.setter
- def is_processing(self, is_processing):
- """Sets the is_processing of this Job.
-
- Values include `1` while in progress, `0` when idle and `-2` when processing failed. # noqa: E501
-
- :param is_processing: The is_processing of this Job. # noqa: E501
- :type: int
- """
-
- self._is_processing = is_processing
-
- @property
- def stats(self):
- """Gets the stats of this Job. # noqa: E501
-
-
- :return: The stats of this Job. # noqa: E501
- :rtype: JobStats
- """
- return self._stats
-
- @stats.setter
- def stats(self, stats):
- """Sets the stats of this Job.
-
-
- :param stats: The stats of this Job. # noqa: E501
- :type: JobStats
- """
-
- self._stats = stats
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, Job):
- return False
-
- return self.to_dict() == other.to_dict()
+ A Job is a collection of multiple Projects. Each project is specific to a language pair, and is associated with exactly one Memory for that language pair. The Memory association cannot be changed after the Project is created.
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, description="A name for the job.")
+ creation_status: Optional[StrictStr] = Field(default=None, description="Status of job creation process that includes PENDING, COMPLETE, and FAILED.", alias="creationStatus")
+ delivered_at: Optional[datetime] = Field(default=None, alias="deliveredAt")
+ status: Optional[StrictStr] = Field(default=None, description="Current status of job that includes archived, delivered, and active.")
+ due: Optional[datetime] = Field(default=None, description="An ISO string date.")
+ id: Optional[StrictInt] = Field(default=None, description="An id for the job.")
+ is_processing: Optional[StrictInt] = Field(default=None, description="Values include `1` while in progress, `0` when idle and `-2` when processing failed.", alias="isProcessing")
+ stats: Optional[JobStats] = None
+ __properties: ClassVar[List[str]] = ["name", "creationStatus", "deliveredAt", "status", "due", "id", "isProcessing", "stats"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Job from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of stats
+ if self.stats:
+ _dict['stats'] = self.stats.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Job from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "creationStatus": obj.get("creationStatus"),
+ "deliveredAt": obj.get("deliveredAt"),
+ "status": obj.get("status"),
+ "due": obj.get("due"),
+ "id": obj.get("id"),
+ "isProcessing": obj.get("isProcessing"),
+ "stats": JobStats.from_dict(obj["stats"]) if obj.get("stats") is not None else None
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, Job):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/job_create_parameters.py b/lilt/models/job_create_parameters.py
index cf190ef..22218fe 100644
--- a/lilt/models/job_create_parameters.py
+++ b/lilt/models/job_create_parameters.py
@@ -3,321 +3,109 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class JobCreateParameters(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.language_pair import LanguagePair
+from typing import Optional, Set
+from typing_extensions import Self
+class JobCreateParameters(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'name': 'str',
- 'language_pairs': 'list[LanguagePair]',
- 'file_ids': 'list[int]',
- 'due': 'str',
- 'src_lang': 'str',
- 'src_locale': 'str',
- 'is_plural': 'bool',
- 'workflow_template_id': 'int'
- }
-
- attribute_map = {
- 'name': 'name',
- 'language_pairs': 'languagePairs',
- 'file_ids': 'fileIds',
- 'due': 'due',
- 'src_lang': 'srcLang',
- 'src_locale': 'srcLocale',
- 'is_plural': 'isPlural',
- 'workflow_template_id': 'workflowTemplateId'
- }
-
- def __init__(self, name=None, language_pairs=None, file_ids=None, due=None, src_lang=None, src_locale=None, is_plural=None, workflow_template_id=None, local_vars_configuration=None): # noqa: E501
- """JobCreateParameters - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._name = None
- self._language_pairs = None
- self._file_ids = None
- self._due = None
- self._src_lang = None
- self._src_locale = None
- self._is_plural = None
- self._workflow_template_id = None
- self.discriminator = None
-
- self.name = name
- self.language_pairs = language_pairs
- self.file_ids = file_ids
- if due is not None:
- self.due = due
- self.src_lang = src_lang
- self.src_locale = src_locale
- if is_plural is not None:
- self.is_plural = is_plural
- if workflow_template_id is not None:
- self.workflow_template_id = workflow_template_id
-
- @property
- def name(self):
- """Gets the name of this JobCreateParameters. # noqa: E501
-
- A name for the Job. # noqa: E501
-
- :return: The name of this JobCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this JobCreateParameters.
-
- A name for the Job. # noqa: E501
-
- :param name: The name of this JobCreateParameters. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
- raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
-
- self._name = name
-
- @property
- def language_pairs(self):
- """Gets the language_pairs of this JobCreateParameters. # noqa: E501
-
- Language pairs is a set of one or more pairs that includes source language, source locale(optional), target language, target locale(optional), and memoryId. # noqa: E501
-
- :return: The language_pairs of this JobCreateParameters. # noqa: E501
- :rtype: list[LanguagePair]
- """
- return self._language_pairs
-
- @language_pairs.setter
- def language_pairs(self, language_pairs):
- """Sets the language_pairs of this JobCreateParameters.
-
- Language pairs is a set of one or more pairs that includes source language, source locale(optional), target language, target locale(optional), and memoryId. # noqa: E501
-
- :param language_pairs: The language_pairs of this JobCreateParameters. # noqa: E501
- :type: list[LanguagePair]
- """
- if self.local_vars_configuration.client_side_validation and language_pairs is None: # noqa: E501
- raise ValueError("Invalid value for `language_pairs`, must not be `None`") # noqa: E501
-
- self._language_pairs = language_pairs
-
- @property
- def file_ids(self):
- """Gets the file_ids of this JobCreateParameters. # noqa: E501
-
- A list of file ids to upload to job creation. # noqa: E501
-
- :return: The file_ids of this JobCreateParameters. # noqa: E501
- :rtype: list[int]
- """
- return self._file_ids
-
- @file_ids.setter
- def file_ids(self, file_ids):
- """Sets the file_ids of this JobCreateParameters.
-
- A list of file ids to upload to job creation. # noqa: E501
-
- :param file_ids: The file_ids of this JobCreateParameters. # noqa: E501
- :type: list[int]
- """
- if self.local_vars_configuration.client_side_validation and file_ids is None: # noqa: E501
- raise ValueError("Invalid value for `file_ids`, must not be `None`") # noqa: E501
-
- self._file_ids = file_ids
-
- @property
- def due(self):
- """Gets the due of this JobCreateParameters. # noqa: E501
-
- An ISO string date representing job due date. # noqa: E501
-
- :return: The due of this JobCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._due
-
- @due.setter
- def due(self, due):
- """Sets the due of this JobCreateParameters.
-
- An ISO string date representing job due date. # noqa: E501
-
- :param due: The due of this JobCreateParameters. # noqa: E501
- :type: str
- """
-
- self._due = due
-
- @property
- def src_lang(self):
- """Gets the src_lang of this JobCreateParameters. # noqa: E501
-
- 2-letter ISO source language code # noqa: E501
-
- :return: The src_lang of this JobCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._src_lang
-
- @src_lang.setter
- def src_lang(self, src_lang):
- """Sets the src_lang of this JobCreateParameters.
-
- 2-letter ISO source language code # noqa: E501
-
- :param src_lang: The src_lang of this JobCreateParameters. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and src_lang is None: # noqa: E501
- raise ValueError("Invalid value for `src_lang`, must not be `None`") # noqa: E501
-
- self._src_lang = src_lang
-
- @property
- def src_locale(self):
- """Gets the src_locale of this JobCreateParameters. # noqa: E501
-
- 2-letter source language code # noqa: E501
-
- :return: The src_locale of this JobCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._src_locale
-
- @src_locale.setter
- def src_locale(self, src_locale):
- """Sets the src_locale of this JobCreateParameters.
-
- 2-letter source language code # noqa: E501
-
- :param src_locale: The src_locale of this JobCreateParameters. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and src_locale is None: # noqa: E501
- raise ValueError("Invalid value for `src_locale`, must not be `None`") # noqa: E501
-
- self._src_locale = src_locale
-
- @property
- def is_plural(self):
- """Gets the is_plural of this JobCreateParameters. # noqa: E501
-
- A boolean value representing if the files have plurals. # noqa: E501
-
- :return: The is_plural of this JobCreateParameters. # noqa: E501
- :rtype: bool
- """
- return self._is_plural
-
- @is_plural.setter
- def is_plural(self, is_plural):
- """Sets the is_plural of this JobCreateParameters.
-
- A boolean value representing if the files have plurals. # noqa: E501
-
- :param is_plural: The is_plural of this JobCreateParameters. # noqa: E501
- :type: bool
- """
-
- self._is_plural = is_plural
-
- @property
- def workflow_template_id(self):
- """Gets the workflow_template_id of this JobCreateParameters. # noqa: E501
-
- ID of the workflow template to be used. Use the [workflows templates endpoint](#tag/Workflows/operation/getWorkflowTemplates) to get the list of available workflows. # noqa: E501
-
- :return: The workflow_template_id of this JobCreateParameters. # noqa: E501
- :rtype: int
- """
- return self._workflow_template_id
-
- @workflow_template_id.setter
- def workflow_template_id(self, workflow_template_id):
- """Sets the workflow_template_id of this JobCreateParameters.
-
- ID of the workflow template to be used. Use the [workflows templates endpoint](#tag/Workflows/operation/getWorkflowTemplates) to get the list of available workflows. # noqa: E501
-
- :param workflow_template_id: The workflow_template_id of this JobCreateParameters. # noqa: E501
- :type: int
- """
-
- self._workflow_template_id = workflow_template_id
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, JobCreateParameters):
- return False
-
- return self.to_dict() == other.to_dict()
+ JobCreateParameters
+ """ # noqa: E501
+ name: StrictStr = Field(description="A name for the Job.")
+ language_pairs: List[LanguagePair] = Field(description="Language pairs is a set of one or more pairs that includes source language, source locale(optional), target language, target locale(optional), and memoryId.", alias="languagePairs")
+ file_ids: List[StrictInt] = Field(description="A list of file ids to upload to job creation.", alias="fileIds")
+ due: Optional[StrictStr] = Field(default=None, description="An ISO string date representing job due date.")
+ src_lang: StrictStr = Field(description="2-letter ISO source language code", alias="srcLang")
+ src_locale: Optional[StrictStr] = Field(default=None, description="2-letter source language code", alias="srcLocale")
+ is_plural: Optional[StrictBool] = Field(default=None, description="A boolean value representing if the files have plurals.", alias="isPlural")
+ workflow_template_id: Optional[StrictInt] = Field(default=None, description="ID of the workflow template to be used. Use the [workflows templates endpoint](#tag/Workflows/operation/getWorkflowTemplates) to get the list of available workflows.", alias="workflowTemplateId")
+ domain_id: Optional[StrictInt] = Field(default=None, description="ID of the domain to be used. Use the [domains endpoint](#tag/Domains/operation/getDomains) to get the list of available domains.", alias="domainId")
+ __properties: ClassVar[List[str]] = ["name", "languagePairs", "fileIds", "due", "srcLang", "srcLocale", "isPlural", "workflowTemplateId", "domainId"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of JobCreateParameters from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in language_pairs (list)
+ _items = []
+ if self.language_pairs:
+ for _item_language_pairs in self.language_pairs:
+ if _item_language_pairs:
+ _items.append(_item_language_pairs.to_dict())
+ _dict['languagePairs'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of JobCreateParameters from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "languagePairs": [LanguagePair.from_dict(_item) for _item in obj["languagePairs"]] if obj.get("languagePairs") is not None else None,
+ "fileIds": obj.get("fileIds"),
+ "due": obj.get("due"),
+ "srcLang": obj.get("srcLang"),
+ "srcLocale": obj.get("srcLocale"),
+ "isPlural": obj.get("isPlural"),
+ "workflowTemplateId": obj.get("workflowTemplateId"),
+ "domainId": obj.get("domainId")
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, JobCreateParameters):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/job_delete_response.py b/lilt/models/job_delete_response.py
index 08923e1..7f14fe8 100644
--- a/lilt/models/job_delete_response.py
+++ b/lilt/models/job_delete_response.py
@@ -3,120 +3,85 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class JobDeleteResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
- Do not edit the class manually.
+class JobDeleteResponse(BaseModel):
"""
+ JobDeleteResponse
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique Project identifier.")
+ __properties: ClassVar[List[str]] = ["id"]
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int'
- }
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
- attribute_map = {
- 'id': 'id'
- }
- def __init__(self, id=None, local_vars_configuration=None): # noqa: E501
- """JobDeleteResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
- self._id = None
- self.discriminator = None
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
- if id is not None:
- self.id = id
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of JobDeleteResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
- @property
- def id(self):
- """Gets the id of this JobDeleteResponse. # noqa: E501
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
- A unique Project identifier. # noqa: E501
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
- :return: The id of this JobDeleteResponse. # noqa: E501
- :rtype: int
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._id
+ excluded_fields: Set[str] = set([
+ ])
- @id.setter
- def id(self, id):
- """Sets the id of this JobDeleteResponse.
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- A unique Project identifier. # noqa: E501
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of JobDeleteResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id")
+ })
+ return _obj
- :param id: The id of this JobDeleteResponse. # noqa: E501
- :type: int
- """
- self._id = id
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, JobDeleteResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, JobDeleteResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/job_leverage_stats.py b/lilt/models/job_leverage_stats.py
index 39189ea..ee660be 100644
--- a/lilt/models/job_leverage_stats.py
+++ b/lilt/models/job_leverage_stats.py
@@ -3,230 +3,101 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.project_stats import ProjectStats
+from typing import Optional, Set
+from typing_extensions import Self
-
-class JobLeverageStats(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class JobLeverageStats(BaseModel):
"""
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'source_words': 'int',
- 'exact_words': 'int',
- 'fuzzy_words': 'int',
- 'new_words': 'int',
- 'projects': 'list[ProjectStats]'
- }
-
- attribute_map = {
- 'source_words': 'sourceWords',
- 'exact_words': 'exactWords',
- 'fuzzy_words': 'fuzzyWords',
- 'new_words': 'newWords',
- 'projects': 'projects'
- }
-
- def __init__(self, source_words=None, exact_words=None, fuzzy_words=None, new_words=None, projects=None, local_vars_configuration=None): # noqa: E501
- """JobLeverageStats - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._source_words = None
- self._exact_words = None
- self._fuzzy_words = None
- self._new_words = None
- self._projects = None
- self.discriminator = None
-
- if source_words is not None:
- self.source_words = source_words
- if exact_words is not None:
- self.exact_words = exact_words
- if fuzzy_words is not None:
- self.fuzzy_words = fuzzy_words
- if new_words is not None:
- self.new_words = new_words
- if projects is not None:
- self.projects = projects
-
- @property
- def source_words(self):
- """Gets the source_words of this JobLeverageStats. # noqa: E501
-
- Total number of source words. # noqa: E501
-
- :return: The source_words of this JobLeverageStats. # noqa: E501
- :rtype: int
+ A job leverage stats object shows an overview of job's statistical data including total number of exact words, fuzzy words, and exact words for the job in total and for each project.
+ """ # noqa: E501
+ source_words: Optional[StrictInt] = Field(default=None, description="Total number of source words.", alias="sourceWords")
+ exact_words: Optional[StrictInt] = Field(default=None, description="Total number of exact words.", alias="exactWords")
+ fuzzy_words: Optional[StrictInt] = Field(default=None, description="Total number of fuzzy words.", alias="fuzzyWords")
+ new_words: Optional[StrictInt] = Field(default=None, description="Total number of new words.", alias="newWords")
+ projects: Optional[List[ProjectStats]] = None
+ __properties: ClassVar[List[str]] = ["sourceWords", "exactWords", "fuzzyWords", "newWords", "projects"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of JobLeverageStats from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._source_words
-
- @source_words.setter
- def source_words(self, source_words):
- """Sets the source_words of this JobLeverageStats.
-
- Total number of source words. # noqa: E501
-
- :param source_words: The source_words of this JobLeverageStats. # noqa: E501
- :type: int
- """
-
- self._source_words = source_words
-
- @property
- def exact_words(self):
- """Gets the exact_words of this JobLeverageStats. # noqa: E501
-
- Total number of exact words. # noqa: E501
-
- :return: The exact_words of this JobLeverageStats. # noqa: E501
- :rtype: int
- """
- return self._exact_words
-
- @exact_words.setter
- def exact_words(self, exact_words):
- """Sets the exact_words of this JobLeverageStats.
-
- Total number of exact words. # noqa: E501
-
- :param exact_words: The exact_words of this JobLeverageStats. # noqa: E501
- :type: int
- """
-
- self._exact_words = exact_words
-
- @property
- def fuzzy_words(self):
- """Gets the fuzzy_words of this JobLeverageStats. # noqa: E501
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in projects (list)
+ _items = []
+ if self.projects:
+ for _item_projects in self.projects:
+ if _item_projects:
+ _items.append(_item_projects.to_dict())
+ _dict['projects'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of JobLeverageStats from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "sourceWords": obj.get("sourceWords"),
+ "exactWords": obj.get("exactWords"),
+ "fuzzyWords": obj.get("fuzzyWords"),
+ "newWords": obj.get("newWords"),
+ "projects": [ProjectStats.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None
+ })
+ return _obj
- Total number of fuzzy words. # noqa: E501
-
- :return: The fuzzy_words of this JobLeverageStats. # noqa: E501
- :rtype: int
- """
- return self._fuzzy_words
-
- @fuzzy_words.setter
- def fuzzy_words(self, fuzzy_words):
- """Sets the fuzzy_words of this JobLeverageStats.
-
- Total number of fuzzy words. # noqa: E501
-
- :param fuzzy_words: The fuzzy_words of this JobLeverageStats. # noqa: E501
- :type: int
- """
-
- self._fuzzy_words = fuzzy_words
-
- @property
- def new_words(self):
- """Gets the new_words of this JobLeverageStats. # noqa: E501
-
- Total number of new words. # noqa: E501
-
- :return: The new_words of this JobLeverageStats. # noqa: E501
- :rtype: int
- """
- return self._new_words
-
- @new_words.setter
- def new_words(self, new_words):
- """Sets the new_words of this JobLeverageStats.
-
- Total number of new words. # noqa: E501
-
- :param new_words: The new_words of this JobLeverageStats. # noqa: E501
- :type: int
- """
-
- self._new_words = new_words
-
- @property
- def projects(self):
- """Gets the projects of this JobLeverageStats. # noqa: E501
-
-
- :return: The projects of this JobLeverageStats. # noqa: E501
- :rtype: list[ProjectStats]
- """
- return self._projects
-
- @projects.setter
- def projects(self, projects):
- """Sets the projects of this JobLeverageStats.
-
-
- :param projects: The projects of this JobLeverageStats. # noqa: E501
- :type: list[ProjectStats]
- """
- self._projects = projects
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, JobLeverageStats):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, JobLeverageStats):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/job_project.py b/lilt/models/job_project.py
index ddaf14f..253a0ea 100644
--- a/lilt/models/job_project.py
+++ b/lilt/models/job_project.py
@@ -3,574 +3,127 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class JobProject(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class JobProject(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'src_lang': 'str',
- 'src_locale': 'str',
- 'trg_lang': 'str',
- 'trg_locale': 'str',
- 'name': 'str',
- 'due': 'str',
- 'is_complete': 'bool',
- 'is_archived': 'bool',
- 'state': 'str',
- 'num_source_tokens': 'int',
- 'created_at': 'str',
- 'updated_at': 'str',
- 'is_deleted': 'bool',
- 'memory_id': 'int',
- 'workflow_status': 'str',
- 'workflow_name': 'str'
- }
-
- attribute_map = {
- 'id': 'id',
- 'src_lang': 'srcLang',
- 'src_locale': 'srcLocale',
- 'trg_lang': 'trgLang',
- 'trg_locale': 'trgLocale',
- 'name': 'name',
- 'due': 'due',
- 'is_complete': 'isComplete',
- 'is_archived': 'isArchived',
- 'state': 'state',
- 'num_source_tokens': 'numSourceTokens',
- 'created_at': 'createdAt',
- 'updated_at': 'updatedAt',
- 'is_deleted': 'isDeleted',
- 'memory_id': 'memoryId',
- 'workflow_status': 'workflowStatus',
- 'workflow_name': 'workflowName'
- }
-
- def __init__(self, id=None, src_lang=None, src_locale=None, trg_lang=None, trg_locale=None, name=None, due=None, is_complete=None, is_archived=None, state=None, num_source_tokens=None, created_at=None, updated_at=None, is_deleted=None, memory_id=None, workflow_status=None, workflow_name=None, local_vars_configuration=None): # noqa: E501
- """JobProject - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._src_lang = None
- self._src_locale = None
- self._trg_lang = None
- self._trg_locale = None
- self._name = None
- self._due = None
- self._is_complete = None
- self._is_archived = None
- self._state = None
- self._num_source_tokens = None
- self._created_at = None
- self._updated_at = None
- self._is_deleted = None
- self._memory_id = None
- self._workflow_status = None
- self._workflow_name = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if src_lang is not None:
- self.src_lang = src_lang
- if src_locale is not None:
- self.src_locale = src_locale
- if trg_lang is not None:
- self.trg_lang = trg_lang
- if trg_locale is not None:
- self.trg_locale = trg_locale
- if name is not None:
- self.name = name
- if due is not None:
- self.due = due
- if is_complete is not None:
- self.is_complete = is_complete
- if is_archived is not None:
- self.is_archived = is_archived
- if state is not None:
- self.state = state
- if num_source_tokens is not None:
- self.num_source_tokens = num_source_tokens
- if created_at is not None:
- self.created_at = created_at
- if updated_at is not None:
- self.updated_at = updated_at
- if is_deleted is not None:
- self.is_deleted = is_deleted
- if memory_id is not None:
- self.memory_id = memory_id
- if workflow_status is not None:
- self.workflow_status = workflow_status
- if workflow_name is not None:
- self.workflow_name = workflow_name
-
- @property
- def id(self):
- """Gets the id of this JobProject. # noqa: E501
-
- An id for the project. # noqa: E501
-
- :return: The id of this JobProject. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this JobProject.
-
- An id for the project. # noqa: E501
-
- :param id: The id of this JobProject. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def src_lang(self):
- """Gets the src_lang of this JobProject. # noqa: E501
-
- Source language, an ISO 639-1 language identifier. # noqa: E501
-
- :return: The src_lang of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._src_lang
-
- @src_lang.setter
- def src_lang(self, src_lang):
- """Sets the src_lang of this JobProject.
-
- Source language, an ISO 639-1 language identifier. # noqa: E501
-
- :param src_lang: The src_lang of this JobProject. # noqa: E501
- :type: str
- """
-
- self._src_lang = src_lang
-
- @property
- def src_locale(self):
- """Gets the src_locale of this JobProject. # noqa: E501
-
- A locale identifier, supported for source language. # noqa: E501
-
- :return: The src_locale of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._src_locale
-
- @src_locale.setter
- def src_locale(self, src_locale):
- """Sets the src_locale of this JobProject.
-
- A locale identifier, supported for source language. # noqa: E501
-
- :param src_locale: The src_locale of this JobProject. # noqa: E501
- :type: str
- """
-
- self._src_locale = src_locale
-
- @property
- def trg_lang(self):
- """Gets the trg_lang of this JobProject. # noqa: E501
-
- Target language, an ISO 639-1 language identifier. # noqa: E501
-
- :return: The trg_lang of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._trg_lang
-
- @trg_lang.setter
- def trg_lang(self, trg_lang):
- """Sets the trg_lang of this JobProject.
-
- Target language, an ISO 639-1 language identifier. # noqa: E501
-
- :param trg_lang: The trg_lang of this JobProject. # noqa: E501
- :type: str
- """
-
- self._trg_lang = trg_lang
-
- @property
- def trg_locale(self):
- """Gets the trg_locale of this JobProject. # noqa: E501
-
- A locale identifier, supported for target language. # noqa: E501
-
- :return: The trg_locale of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._trg_locale
-
- @trg_locale.setter
- def trg_locale(self, trg_locale):
- """Sets the trg_locale of this JobProject.
-
- A locale identifier, supported for target language. # noqa: E501
-
- :param trg_locale: The trg_locale of this JobProject. # noqa: E501
- :type: str
- """
-
- self._trg_locale = trg_locale
-
- @property
- def name(self):
- """Gets the name of this JobProject. # noqa: E501
-
- A name for the project. # noqa: E501
-
- :return: The name of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this JobProject.
-
- A name for the project. # noqa: E501
-
- :param name: The name of this JobProject. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def due(self):
- """Gets the due of this JobProject. # noqa: E501
-
- An ISO date. # noqa: E501
-
- :return: The due of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._due
-
- @due.setter
- def due(self, due):
- """Sets the due of this JobProject.
-
- An ISO date. # noqa: E501
-
- :param due: The due of this JobProject. # noqa: E501
- :type: str
- """
-
- self._due = due
-
- @property
- def is_complete(self):
- """Gets the is_complete of this JobProject. # noqa: E501
-
- A state that checks project was completed. # noqa: E501
-
- :return: The is_complete of this JobProject. # noqa: E501
- :rtype: bool
- """
- return self._is_complete
-
- @is_complete.setter
- def is_complete(self, is_complete):
- """Sets the is_complete of this JobProject.
-
- A state that checks project was completed. # noqa: E501
-
- :param is_complete: The is_complete of this JobProject. # noqa: E501
- :type: bool
- """
-
- self._is_complete = is_complete
-
- @property
- def is_archived(self):
- """Gets the is_archived of this JobProject. # noqa: E501
-
- The archived state of the project. # noqa: E501
-
- :return: The is_archived of this JobProject. # noqa: E501
- :rtype: bool
- """
- return self._is_archived
-
- @is_archived.setter
- def is_archived(self, is_archived):
- """Sets the is_archived of this JobProject.
-
- The archived state of the project. # noqa: E501
-
- :param is_archived: The is_archived of this JobProject. # noqa: E501
- :type: bool
- """
-
- self._is_archived = is_archived
-
- @property
- def state(self):
- """Gets the state of this JobProject. # noqa: E501
-
- Current state of the project. Example, backlog, inProgress, inReview, done. # noqa: E501
-
- :return: The state of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._state
-
- @state.setter
- def state(self, state):
- """Sets the state of this JobProject.
-
- Current state of the project. Example, backlog, inProgress, inReview, done. # noqa: E501
-
- :param state: The state of this JobProject. # noqa: E501
- :type: str
- """
-
- self._state = state
-
- @property
- def num_source_tokens(self):
- """Gets the num_source_tokens of this JobProject. # noqa: E501
-
- Total number of source tokens. # noqa: E501
-
- :return: The num_source_tokens of this JobProject. # noqa: E501
- :rtype: int
- """
- return self._num_source_tokens
-
- @num_source_tokens.setter
- def num_source_tokens(self, num_source_tokens):
- """Sets the num_source_tokens of this JobProject.
-
- Total number of source tokens. # noqa: E501
-
- :param num_source_tokens: The num_source_tokens of this JobProject. # noqa: E501
- :type: int
- """
-
- self._num_source_tokens = num_source_tokens
-
- @property
- def created_at(self):
- """Gets the created_at of this JobProject. # noqa: E501
-
- Time at which the object was created. # noqa: E501
-
- :return: The created_at of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._created_at
-
- @created_at.setter
- def created_at(self, created_at):
- """Sets the created_at of this JobProject.
-
- Time at which the object was created. # noqa: E501
-
- :param created_at: The created_at of this JobProject. # noqa: E501
- :type: str
- """
-
- self._created_at = created_at
-
- @property
- def updated_at(self):
- """Gets the updated_at of this JobProject. # noqa: E501
-
- Time at which the object was updated. # noqa: E501
-
- :return: The updated_at of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._updated_at
-
- @updated_at.setter
- def updated_at(self, updated_at):
- """Sets the updated_at of this JobProject.
-
- Time at which the object was updated. # noqa: E501
-
- :param updated_at: The updated_at of this JobProject. # noqa: E501
- :type: str
- """
-
- self._updated_at = updated_at
-
- @property
- def is_deleted(self):
- """Gets the is_deleted of this JobProject. # noqa: E501
-
- A state that checks project was deleted. # noqa: E501
-
- :return: The is_deleted of this JobProject. # noqa: E501
- :rtype: bool
- """
- return self._is_deleted
-
- @is_deleted.setter
- def is_deleted(self, is_deleted):
- """Sets the is_deleted of this JobProject.
-
- A state that checks project was deleted. # noqa: E501
-
- :param is_deleted: The is_deleted of this JobProject. # noqa: E501
- :type: bool
- """
-
- self._is_deleted = is_deleted
-
- @property
- def memory_id(self):
- """Gets the memory_id of this JobProject. # noqa: E501
-
- A unique number identifying the associated Memory. # noqa: E501
-
- :return: The memory_id of this JobProject. # noqa: E501
- :rtype: int
- """
- return self._memory_id
-
- @memory_id.setter
- def memory_id(self, memory_id):
- """Sets the memory_id of this JobProject.
-
- A unique number identifying the associated Memory. # noqa: E501
-
- :param memory_id: The memory_id of this JobProject. # noqa: E501
- :type: int
- """
-
- self._memory_id = memory_id
-
- @property
- def workflow_status(self):
- """Gets the workflow_status of this JobProject. # noqa: E501
-
- The status of the Workflow for the current project. # noqa: E501
-
- :return: The workflow_status of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._workflow_status
-
- @workflow_status.setter
- def workflow_status(self, workflow_status):
- """Sets the workflow_status of this JobProject.
-
- The status of the Workflow for the current project. # noqa: E501
-
- :param workflow_status: The workflow_status of this JobProject. # noqa: E501
- :type: str
- """
- allowed_values = ["READY_TO_START", "IN_PROGRESS", "DONE"] # noqa: E501
- if self.local_vars_configuration.client_side_validation and workflow_status not in allowed_values: # noqa: E501
- raise ValueError(
- "Invalid value for `workflow_status` ({0}), must be one of {1}" # noqa: E501
- .format(workflow_status, allowed_values)
- )
-
- self._workflow_status = workflow_status
-
- @property
- def workflow_name(self):
- """Gets the workflow_name of this JobProject. # noqa: E501
-
- Human readable name of the workflow associated with the current project. # noqa: E501
-
- :return: The workflow_name of this JobProject. # noqa: E501
- :rtype: str
- """
- return self._workflow_name
-
- @workflow_name.setter
- def workflow_name(self, workflow_name):
- """Sets the workflow_name of this JobProject.
-
- Human readable name of the workflow associated with the current project. # noqa: E501
-
- :param workflow_name: The workflow_name of this JobProject. # noqa: E501
- :type: str
- """
-
- self._workflow_name = workflow_name
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, JobProject):
- return False
-
- return self.to_dict() == other.to_dict()
+ A job project contains project statistical data that belongs to a specific job.
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="An id for the project.")
+ src_lang: Optional[StrictStr] = Field(default=None, description="Source language, an ISO 639-1 language identifier.", alias="srcLang")
+ src_locale: Optional[StrictStr] = Field(default=None, description="A locale identifier, supported for source language.", alias="srcLocale")
+ trg_lang: Optional[StrictStr] = Field(default=None, description="Target language, an ISO 639-1 language identifier.", alias="trgLang")
+ trg_locale: Optional[StrictStr] = Field(default=None, description="A locale identifier, supported for target language.", alias="trgLocale")
+ name: Optional[StrictStr] = Field(default=None, description="A name for the project.")
+ due: Optional[StrictStr] = Field(default=None, description="An ISO date.")
+ is_complete: Optional[StrictBool] = Field(default=None, description="A state that checks project was completed.", alias="isComplete")
+ is_archived: Optional[StrictBool] = Field(default=None, description="The archived state of the project.", alias="isArchived")
+ state: Optional[StrictStr] = Field(default=None, description="Current state of the project. Example, backlog, inProgress, inReview, done.")
+ num_source_tokens: Optional[StrictInt] = Field(default=None, description="Total number of source tokens.", alias="numSourceTokens")
+ created_at: Optional[StrictStr] = Field(default=None, description="Time at which the object was created.", alias="createdAt")
+ updated_at: Optional[StrictStr] = Field(default=None, description="Time at which the object was updated.", alias="updatedAt")
+ is_deleted: Optional[StrictBool] = Field(default=None, description="A state that checks project was deleted.", alias="isDeleted")
+ memory_id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the associated Memory.", alias="memoryId")
+ workflow_status: Optional[StrictStr] = Field(default=None, description="The status of the Workflow for the current project.", alias="workflowStatus")
+ workflow_name: Optional[StrictStr] = Field(default=None, description="Human readable name of the workflow associated with the current project.", alias="workflowName")
+ __properties: ClassVar[List[str]] = ["id", "srcLang", "srcLocale", "trgLang", "trgLocale", "name", "due", "isComplete", "isArchived", "state", "numSourceTokens", "createdAt", "updatedAt", "isDeleted", "memoryId", "workflowStatus", "workflowName"]
+
+ @field_validator('workflow_status')
+ def workflow_status_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['READY_TO_START', 'IN_PROGRESS', 'DONE']):
+ raise ValueError("must be one of enum values ('READY_TO_START', 'IN_PROGRESS', 'DONE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of JobProject from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of JobProject from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "srcLang": obj.get("srcLang"),
+ "srcLocale": obj.get("srcLocale"),
+ "trgLang": obj.get("trgLang"),
+ "trgLocale": obj.get("trgLocale"),
+ "name": obj.get("name"),
+ "due": obj.get("due"),
+ "isComplete": obj.get("isComplete"),
+ "isArchived": obj.get("isArchived"),
+ "state": obj.get("state"),
+ "numSourceTokens": obj.get("numSourceTokens"),
+ "createdAt": obj.get("createdAt"),
+ "updatedAt": obj.get("updatedAt"),
+ "isDeleted": obj.get("isDeleted"),
+ "memoryId": obj.get("memoryId"),
+ "workflowStatus": obj.get("workflowStatus"),
+ "workflowName": obj.get("workflowName")
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, JobProject):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/job_stats.py b/lilt/models/job_stats.py
index 6abf77a..c97fa59 100644
--- a/lilt/models/job_stats.py
+++ b/lilt/models/job_stats.py
@@ -3,460 +3,127 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class JobStats(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.job_project import JobProject
+from typing import Optional, Set
+from typing_extensions import Self
+class JobStats(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'exact_words': 'int',
- 'fuzzy_words': 'int',
- 'new_words': 'int',
- 'num_delivered_projects': 'int',
- 'num_language_pairs': 'int',
- 'num_projects': 'int',
- 'percent_reviewed': 'int',
- 'percent_translated': 'int',
- 'projects': 'list[JobProject]',
- 'source_words': 'int',
- 'unique_language_pairs': 'int',
- 'unique_linguists': 'int',
- 'workflow_status': 'str'
- }
-
- attribute_map = {
- 'exact_words': 'exactWords',
- 'fuzzy_words': 'fuzzyWords',
- 'new_words': 'newWords',
- 'num_delivered_projects': 'numDeliveredProjects',
- 'num_language_pairs': 'numLanguagePairs',
- 'num_projects': 'numProjects',
- 'percent_reviewed': 'percentReviewed',
- 'percent_translated': 'percentTranslated',
- 'projects': 'projects',
- 'source_words': 'sourceWords',
- 'unique_language_pairs': 'uniqueLanguagePairs',
- 'unique_linguists': 'uniqueLinguists',
- 'workflow_status': 'workflowStatus'
- }
-
- def __init__(self, exact_words=None, fuzzy_words=None, new_words=None, num_delivered_projects=None, num_language_pairs=None, num_projects=None, percent_reviewed=None, percent_translated=None, projects=None, source_words=None, unique_language_pairs=None, unique_linguists=None, workflow_status=None, local_vars_configuration=None): # noqa: E501
- """JobStats - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._exact_words = None
- self._fuzzy_words = None
- self._new_words = None
- self._num_delivered_projects = None
- self._num_language_pairs = None
- self._num_projects = None
- self._percent_reviewed = None
- self._percent_translated = None
- self._projects = None
- self._source_words = None
- self._unique_language_pairs = None
- self._unique_linguists = None
- self._workflow_status = None
- self.discriminator = None
-
- if exact_words is not None:
- self.exact_words = exact_words
- if fuzzy_words is not None:
- self.fuzzy_words = fuzzy_words
- if new_words is not None:
- self.new_words = new_words
- if num_delivered_projects is not None:
- self.num_delivered_projects = num_delivered_projects
- if num_language_pairs is not None:
- self.num_language_pairs = num_language_pairs
- if num_projects is not None:
- self.num_projects = num_projects
- if percent_reviewed is not None:
- self.percent_reviewed = percent_reviewed
- if percent_translated is not None:
- self.percent_translated = percent_translated
- if projects is not None:
- self.projects = projects
- if source_words is not None:
- self.source_words = source_words
- if unique_language_pairs is not None:
- self.unique_language_pairs = unique_language_pairs
- if unique_linguists is not None:
- self.unique_linguists = unique_linguists
- if workflow_status is not None:
- self.workflow_status = workflow_status
-
- @property
- def exact_words(self):
- """Gets the exact_words of this JobStats. # noqa: E501
-
- Total number of exact words. # noqa: E501
-
- :return: The exact_words of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._exact_words
-
- @exact_words.setter
- def exact_words(self, exact_words):
- """Sets the exact_words of this JobStats.
-
- Total number of exact words. # noqa: E501
-
- :param exact_words: The exact_words of this JobStats. # noqa: E501
- :type: int
- """
-
- self._exact_words = exact_words
-
- @property
- def fuzzy_words(self):
- """Gets the fuzzy_words of this JobStats. # noqa: E501
-
- Total number of fuzzy words. # noqa: E501
-
- :return: The fuzzy_words of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._fuzzy_words
-
- @fuzzy_words.setter
- def fuzzy_words(self, fuzzy_words):
- """Sets the fuzzy_words of this JobStats.
-
- Total number of fuzzy words. # noqa: E501
-
- :param fuzzy_words: The fuzzy_words of this JobStats. # noqa: E501
- :type: int
- """
-
- self._fuzzy_words = fuzzy_words
-
- @property
- def new_words(self):
- """Gets the new_words of this JobStats. # noqa: E501
-
- Total number of fuzzy words. # noqa: E501
-
- :return: The new_words of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._new_words
-
- @new_words.setter
- def new_words(self, new_words):
- """Sets the new_words of this JobStats.
-
- Total number of fuzzy words. # noqa: E501
-
- :param new_words: The new_words of this JobStats. # noqa: E501
- :type: int
- """
-
- self._new_words = new_words
-
- @property
- def num_delivered_projects(self):
- """Gets the num_delivered_projects of this JobStats. # noqa: E501
-
- Total number of delivered projects. # noqa: E501
-
- :return: The num_delivered_projects of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._num_delivered_projects
-
- @num_delivered_projects.setter
- def num_delivered_projects(self, num_delivered_projects):
- """Sets the num_delivered_projects of this JobStats.
-
- Total number of delivered projects. # noqa: E501
-
- :param num_delivered_projects: The num_delivered_projects of this JobStats. # noqa: E501
- :type: int
- """
-
- self._num_delivered_projects = num_delivered_projects
-
- @property
- def num_language_pairs(self):
- """Gets the num_language_pairs of this JobStats. # noqa: E501
-
- Total number of delivered projects. # noqa: E501
-
- :return: The num_language_pairs of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._num_language_pairs
-
- @num_language_pairs.setter
- def num_language_pairs(self, num_language_pairs):
- """Sets the num_language_pairs of this JobStats.
-
- Total number of delivered projects. # noqa: E501
-
- :param num_language_pairs: The num_language_pairs of this JobStats. # noqa: E501
- :type: int
- """
-
- self._num_language_pairs = num_language_pairs
-
- @property
- def num_projects(self):
- """Gets the num_projects of this JobStats. # noqa: E501
-
- Total number of projects. # noqa: E501
-
- :return: The num_projects of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._num_projects
-
- @num_projects.setter
- def num_projects(self, num_projects):
- """Sets the num_projects of this JobStats.
-
- Total number of projects. # noqa: E501
-
- :param num_projects: The num_projects of this JobStats. # noqa: E501
- :type: int
- """
-
- self._num_projects = num_projects
-
- @property
- def percent_reviewed(self):
- """Gets the percent_reviewed of this JobStats. # noqa: E501
-
- Overall percentage of documents reviewed. # noqa: E501
-
- :return: The percent_reviewed of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._percent_reviewed
-
- @percent_reviewed.setter
- def percent_reviewed(self, percent_reviewed):
- """Sets the percent_reviewed of this JobStats.
-
- Overall percentage of documents reviewed. # noqa: E501
-
- :param percent_reviewed: The percent_reviewed of this JobStats. # noqa: E501
- :type: int
- """
-
- self._percent_reviewed = percent_reviewed
-
- @property
- def percent_translated(self):
- """Gets the percent_translated of this JobStats. # noqa: E501
-
- Overall percentage of documents translated. # noqa: E501
-
- :return: The percent_translated of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._percent_translated
-
- @percent_translated.setter
- def percent_translated(self, percent_translated):
- """Sets the percent_translated of this JobStats.
-
- Overall percentage of documents translated. # noqa: E501
-
- :param percent_translated: The percent_translated of this JobStats. # noqa: E501
- :type: int
- """
-
- self._percent_translated = percent_translated
-
- @property
- def projects(self):
- """Gets the projects of this JobStats. # noqa: E501
-
-
- :return: The projects of this JobStats. # noqa: E501
- :rtype: list[JobProject]
- """
- return self._projects
-
- @projects.setter
- def projects(self, projects):
- """Sets the projects of this JobStats.
-
-
- :param projects: The projects of this JobStats. # noqa: E501
- :type: list[JobProject]
- """
-
- self._projects = projects
-
- @property
- def source_words(self):
- """Gets the source_words of this JobStats. # noqa: E501
-
- Total number of source words. # noqa: E501
-
- :return: The source_words of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._source_words
-
- @source_words.setter
- def source_words(self, source_words):
- """Sets the source_words of this JobStats.
-
- Total number of source words. # noqa: E501
-
- :param source_words: The source_words of this JobStats. # noqa: E501
- :type: int
- """
-
- self._source_words = source_words
-
- @property
- def unique_language_pairs(self):
- """Gets the unique_language_pairs of this JobStats. # noqa: E501
-
- Number of unique language pairs. # noqa: E501
-
- :return: The unique_language_pairs of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._unique_language_pairs
-
- @unique_language_pairs.setter
- def unique_language_pairs(self, unique_language_pairs):
- """Sets the unique_language_pairs of this JobStats.
-
- Number of unique language pairs. # noqa: E501
-
- :param unique_language_pairs: The unique_language_pairs of this JobStats. # noqa: E501
- :type: int
- """
-
- self._unique_language_pairs = unique_language_pairs
-
- @property
- def unique_linguists(self):
- """Gets the unique_linguists of this JobStats. # noqa: E501
-
- Number of unique linguists. # noqa: E501
-
- :return: The unique_linguists of this JobStats. # noqa: E501
- :rtype: int
- """
- return self._unique_linguists
-
- @unique_linguists.setter
- def unique_linguists(self, unique_linguists):
- """Sets the unique_linguists of this JobStats.
-
- Number of unique linguists. # noqa: E501
-
- :param unique_linguists: The unique_linguists of this JobStats. # noqa: E501
- :type: int
- """
-
- self._unique_linguists = unique_linguists
-
- @property
- def workflow_status(self):
- """Gets the workflow_status of this JobStats. # noqa: E501
-
- The status of the Workflow for the current job. # noqa: E501
-
- :return: The workflow_status of this JobStats. # noqa: E501
- :rtype: str
- """
- return self._workflow_status
-
- @workflow_status.setter
- def workflow_status(self, workflow_status):
- """Sets the workflow_status of this JobStats.
-
- The status of the Workflow for the current job. # noqa: E501
-
- :param workflow_status: The workflow_status of this JobStats. # noqa: E501
- :type: str
- """
- allowed_values = ["READY_TO_START", "IN_PROGRESS", "DONE"] # noqa: E501
- if self.local_vars_configuration.client_side_validation and workflow_status not in allowed_values: # noqa: E501
- raise ValueError(
- "Invalid value for `workflow_status` ({0}), must be one of {1}" # noqa: E501
- .format(workflow_status, allowed_values)
- )
-
- self._workflow_status = workflow_status
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, JobStats):
- return False
-
- return self.to_dict() == other.to_dict()
+ A job stats shows an overview of job's statistical data including total number of exact words, fuzzy words, language pairs, projects, etc.
+ """ # noqa: E501
+ exact_words: Optional[StrictInt] = Field(default=None, description="Total number of exact words.", alias="exactWords")
+ fuzzy_words: Optional[StrictInt] = Field(default=None, description="Total number of fuzzy words.", alias="fuzzyWords")
+ new_words: Optional[StrictInt] = Field(default=None, description="Total number of fuzzy words.", alias="newWords")
+ num_delivered_projects: Optional[StrictInt] = Field(default=None, description="Total number of delivered projects.", alias="numDeliveredProjects")
+ num_language_pairs: Optional[StrictInt] = Field(default=None, description="Total number of delivered projects.", alias="numLanguagePairs")
+ num_projects: Optional[StrictInt] = Field(default=None, description="Total number of projects.", alias="numProjects")
+ percent_reviewed: Optional[StrictInt] = Field(default=None, description="Overall percentage of documents reviewed.", alias="percentReviewed")
+ percent_translated: Optional[StrictInt] = Field(default=None, description="Overall percentage of documents translated.", alias="percentTranslated")
+ projects: Optional[List[JobProject]] = None
+ source_words: Optional[StrictInt] = Field(default=None, description="Total number of source words.", alias="sourceWords")
+ unique_language_pairs: Optional[StrictInt] = Field(default=None, description="Number of unique language pairs.", alias="uniqueLanguagePairs")
+ unique_linguists: Optional[StrictInt] = Field(default=None, description="Number of unique linguists.", alias="uniqueLinguists")
+ workflow_status: Optional[StrictStr] = Field(default=None, description="The status of the Workflow for the current job.", alias="workflowStatus")
+ __properties: ClassVar[List[str]] = ["exactWords", "fuzzyWords", "newWords", "numDeliveredProjects", "numLanguagePairs", "numProjects", "percentReviewed", "percentTranslated", "projects", "sourceWords", "uniqueLanguagePairs", "uniqueLinguists", "workflowStatus"]
+
+ @field_validator('workflow_status')
+ def workflow_status_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['READY_TO_START', 'IN_PROGRESS', 'DONE']):
+ raise ValueError("must be one of enum values ('READY_TO_START', 'IN_PROGRESS', 'DONE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of JobStats from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in projects (list)
+ _items = []
+ if self.projects:
+ for _item_projects in self.projects:
+ if _item_projects:
+ _items.append(_item_projects.to_dict())
+ _dict['projects'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of JobStats from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "exactWords": obj.get("exactWords"),
+ "fuzzyWords": obj.get("fuzzyWords"),
+ "newWords": obj.get("newWords"),
+ "numDeliveredProjects": obj.get("numDeliveredProjects"),
+ "numLanguagePairs": obj.get("numLanguagePairs"),
+ "numProjects": obj.get("numProjects"),
+ "percentReviewed": obj.get("percentReviewed"),
+ "percentTranslated": obj.get("percentTranslated"),
+ "projects": [JobProject.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None,
+ "sourceWords": obj.get("sourceWords"),
+ "uniqueLanguagePairs": obj.get("uniqueLanguagePairs"),
+ "uniqueLinguists": obj.get("uniqueLinguists"),
+ "workflowStatus": obj.get("workflowStatus")
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, JobStats):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/job_update_parameters.py b/lilt/models/job_update_parameters.py
index 5968cda..a37a2ba 100644
--- a/lilt/models/job_update_parameters.py
+++ b/lilt/models/job_update_parameters.py
@@ -3,210 +3,101 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-class JobUpdateParameters(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
+class JobUpdateParameters(BaseModel):
"""
- openapi_types = {
- 'name': 'str',
- 'due_date': 'int',
- 'is_processing': 'str',
- 'processing_error_msg': 'str'
- }
-
- attribute_map = {
- 'name': 'name',
- 'due_date': 'dueDate',
- 'is_processing': 'isProcessing',
- 'processing_error_msg': 'processingErrorMsg'
- }
-
- def __init__(self, name=None, due_date=None, is_processing=None, processing_error_msg=None, local_vars_configuration=None): # noqa: E501
- """JobUpdateParameters - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._name = None
- self._due_date = None
- self._is_processing = None
- self._processing_error_msg = None
- self.discriminator = None
-
- if name is not None:
- self.name = name
- if due_date is not None:
- self.due_date = due_date
- if is_processing is not None:
- self.is_processing = is_processing
- if processing_error_msg is not None:
- self.processing_error_msg = processing_error_msg
-
- @property
- def name(self):
- """Gets the name of this JobUpdateParameters. # noqa: E501
-
- A name for the Job. # noqa: E501
-
- :return: The name of this JobUpdateParameters. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this JobUpdateParameters.
-
- A name for the Job. # noqa: E501
-
- :param name: The name of this JobUpdateParameters. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def due_date(self):
- """Gets the due_date of this JobUpdateParameters. # noqa: E501
-
- An ISO string date. # noqa: E501
-
- :return: The due_date of this JobUpdateParameters. # noqa: E501
- :rtype: int
- """
- return self._due_date
-
- @due_date.setter
- def due_date(self, due_date):
- """Sets the due_date of this JobUpdateParameters.
-
- An ISO string date. # noqa: E501
-
- :param due_date: The due_date of this JobUpdateParameters. # noqa: E501
- :type: int
- """
-
- self._due_date = due_date
-
- @property
- def is_processing(self):
- """Gets the is_processing of this JobUpdateParameters. # noqa: E501
-
- The processing status of the job. Provide one of the following integers to indicate the status. Ok = 0 Started = 1 ExportError = -2 # noqa: E501
-
- :return: The is_processing of this JobUpdateParameters. # noqa: E501
- :rtype: str
- """
- return self._is_processing
-
- @is_processing.setter
- def is_processing(self, is_processing):
- """Sets the is_processing of this JobUpdateParameters.
-
- The processing status of the job. Provide one of the following integers to indicate the status. Ok = 0 Started = 1 ExportError = -2 # noqa: E501
-
- :param is_processing: The is_processing of this JobUpdateParameters. # noqa: E501
- :type: str
- """
- allowed_values = ["0", "1", "-2"] # noqa: E501
- if self.local_vars_configuration.client_side_validation and is_processing not in allowed_values: # noqa: E501
- raise ValueError(
- "Invalid value for `is_processing` ({0}), must be one of {1}" # noqa: E501
- .format(is_processing, allowed_values)
- )
-
- self._is_processing = is_processing
-
- @property
- def processing_error_msg(self):
- """Gets the processing_error_msg of this JobUpdateParameters. # noqa: E501
-
- The processing error message. # noqa: E501
-
- :return: The processing_error_msg of this JobUpdateParameters. # noqa: E501
- :rtype: str
+ JobUpdateParameters
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, description="A name for the Job.")
+ due_date: Optional[StrictInt] = Field(default=None, description="An ISO string date.", alias="dueDate")
+ is_processing: Optional[StrictStr] = Field(default=None, description="The processing status of the job. Provide one of the following integers to indicate the status. Ok = 0 Started = 1 ExportError = -2 ", alias="isProcessing")
+ processing_error_msg: Optional[StrictStr] = Field(default=None, description="The processing error message.", alias="processingErrorMsg")
+ __properties: ClassVar[List[str]] = ["name", "dueDate", "isProcessing", "processingErrorMsg"]
+
+ @field_validator('is_processing')
+ def is_processing_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['0', '1', '-2']):
+ raise ValueError("must be one of enum values ('0', '1', '-2')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of JobUpdateParameters from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._processing_error_msg
-
- @processing_error_msg.setter
- def processing_error_msg(self, processing_error_msg):
- """Sets the processing_error_msg of this JobUpdateParameters.
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of JobUpdateParameters from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "dueDate": obj.get("dueDate"),
+ "isProcessing": obj.get("isProcessing"),
+ "processingErrorMsg": obj.get("processingErrorMsg")
+ })
+ return _obj
- The processing error message. # noqa: E501
-
- :param processing_error_msg: The processing_error_msg of this JobUpdateParameters. # noqa: E501
- :type: str
- """
- self._processing_error_msg = processing_error_msg
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, JobUpdateParameters):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, JobUpdateParameters):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/language_pair.py b/lilt/models/language_pair.py
index 0298bc4..1412df5 100644
--- a/lilt/models/language_pair.py
+++ b/lilt/models/language_pair.py
@@ -3,456 +3,117 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class LanguagePair(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.workflow_stage_assignment import WorkflowStageAssignment
+from typing import Optional, Set
+from typing_extensions import Self
+class LanguagePair(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'trg_lang': 'str',
- 'trg_locale': 'str',
- 'due_date': 'str',
- 'memory_id': 'int',
- 'external_model_id': 'int',
- 'pretranslate': 'bool',
- 'auto_accept': 'bool',
- 'case_sensitive': 'bool',
- 'take_match_attribution': 'bool',
- 'config_id': 'int',
- 'workflow_template_id': 'int',
- 'workflow_template_name': 'int',
- 'workflow_stage_assignments': 'list[WorkflowStageAssignment]'
- }
-
- attribute_map = {
- 'trg_lang': 'trgLang',
- 'trg_locale': 'trgLocale',
- 'due_date': 'dueDate',
- 'memory_id': 'memoryId',
- 'external_model_id': 'externalModelId',
- 'pretranslate': 'pretranslate',
- 'auto_accept': 'autoAccept',
- 'case_sensitive': 'caseSensitive',
- 'take_match_attribution': 'takeMatchAttribution',
- 'config_id': 'configId',
- 'workflow_template_id': 'workflowTemplateId',
- 'workflow_template_name': 'workflowTemplateName',
- 'workflow_stage_assignments': 'workflowStageAssignments'
- }
-
- 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
- """LanguagePair - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._trg_lang = None
- self._trg_locale = None
- self._due_date = None
- self._memory_id = None
- self._external_model_id = None
- self._pretranslate = None
- self._auto_accept = None
- self._case_sensitive = None
- self._take_match_attribution = None
- self._config_id = None
- self._workflow_template_id = None
- self._workflow_template_name = None
- self._workflow_stage_assignments = None
- self.discriminator = None
-
- self.trg_lang = trg_lang
- if trg_locale is not None:
- self.trg_locale = trg_locale
- if due_date is not None:
- self.due_date = due_date
- self.memory_id = memory_id
- if external_model_id is not None:
- self.external_model_id = external_model_id
- if pretranslate is not None:
- self.pretranslate = pretranslate
- if auto_accept is not None:
- self.auto_accept = auto_accept
- if case_sensitive is not None:
- self.case_sensitive = case_sensitive
- if take_match_attribution is not None:
- self.take_match_attribution = take_match_attribution
- if config_id is not None:
- self.config_id = config_id
- if workflow_template_id is not None:
- self.workflow_template_id = workflow_template_id
- if workflow_template_name is not None:
- self.workflow_template_name = workflow_template_name
- if workflow_stage_assignments is not None:
- self.workflow_stage_assignments = workflow_stage_assignments
-
- @property
- def trg_lang(self):
- """Gets the trg_lang of this LanguagePair. # noqa: E501
-
- Target language, an ISO 639-1 language identifier. # noqa: E501
-
- :return: The trg_lang of this LanguagePair. # noqa: E501
- :rtype: str
- """
- return self._trg_lang
-
- @trg_lang.setter
- def trg_lang(self, trg_lang):
- """Sets the trg_lang of this LanguagePair.
-
- Target language, an ISO 639-1 language identifier. # noqa: E501
-
- :param trg_lang: The trg_lang of this LanguagePair. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and trg_lang is None: # noqa: E501
- raise ValueError("Invalid value for `trg_lang`, must not be `None`") # noqa: E501
-
- self._trg_lang = trg_lang
-
- @property
- def trg_locale(self):
- """Gets the trg_locale of this LanguagePair. # noqa: E501
-
- A locale identifier, supported for target language. # noqa: E501
-
- :return: The trg_locale of this LanguagePair. # noqa: E501
- :rtype: str
- """
- return self._trg_locale
-
- @trg_locale.setter
- def trg_locale(self, trg_locale):
- """Sets the trg_locale of this LanguagePair.
-
- A locale identifier, supported for target language. # noqa: E501
-
- :param trg_locale: The trg_locale of this LanguagePair. # noqa: E501
- :type: str
- """
-
- self._trg_locale = trg_locale
-
- @property
- def due_date(self):
- """Gets the due_date of this LanguagePair. # noqa: E501
-
- An ISO date. # noqa: E501
-
- :return: The due_date of this LanguagePair. # noqa: E501
- :rtype: str
- """
- return self._due_date
-
- @due_date.setter
- def due_date(self, due_date):
- """Sets the due_date of this LanguagePair.
-
- An ISO date. # noqa: E501
-
- :param due_date: The due_date of this LanguagePair. # noqa: E501
- :type: str
- """
-
- self._due_date = due_date
-
- @property
- def memory_id(self):
- """Gets the memory_id of this LanguagePair. # noqa: E501
-
- A unique number identifying the associated Memory. # noqa: E501
-
- :return: The memory_id of this LanguagePair. # noqa: E501
- :rtype: int
- """
- return self._memory_id
-
- @memory_id.setter
- def memory_id(self, memory_id):
- """Sets the memory_id of this LanguagePair.
-
- A unique number identifying the associated Memory. # noqa: E501
-
- :param memory_id: The memory_id of this LanguagePair. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and memory_id is None: # noqa: E501
- raise ValueError("Invalid value for `memory_id`, must not be `None`") # noqa: E501
-
- self._memory_id = memory_id
-
- @property
- def external_model_id(self):
- """Gets the external_model_id of this LanguagePair. # noqa: E501
-
- A unique identifier for working with a third party model in the Lilt Platform # noqa: E501
-
- :return: The external_model_id of this LanguagePair. # noqa: E501
- :rtype: int
- """
- return self._external_model_id
-
- @external_model_id.setter
- def external_model_id(self, external_model_id):
- """Sets the external_model_id of this LanguagePair.
-
- A unique identifier for working with a third party model in the Lilt Platform # noqa: E501
-
- :param external_model_id: The external_model_id of this LanguagePair. # noqa: E501
- :type: int
- """
-
- self._external_model_id = external_model_id
-
- @property
- def pretranslate(self):
- """Gets the pretranslate of this LanguagePair. # noqa: E501
-
- Attribute translation authorship of exact matches to the creator of the document being pretranslated. # noqa: E501
-
- :return: The pretranslate of this LanguagePair. # noqa: E501
- :rtype: bool
- """
- return self._pretranslate
-
- @pretranslate.setter
- def pretranslate(self, pretranslate):
- """Sets the pretranslate of this LanguagePair.
-
- Attribute translation authorship of exact matches to the creator of the document being pretranslated. # noqa: E501
-
- :param pretranslate: The pretranslate of this LanguagePair. # noqa: E501
- :type: bool
- """
-
- self._pretranslate = pretranslate
-
- @property
- def auto_accept(self):
- """Gets the auto_accept of this LanguagePair. # noqa: E501
-
- Accept and lock exact matches. # noqa: E501
-
- :return: The auto_accept of this LanguagePair. # noqa: E501
- :rtype: bool
- """
- return self._auto_accept
-
- @auto_accept.setter
- def auto_accept(self, auto_accept):
- """Sets the auto_accept of this LanguagePair.
-
- Accept and lock exact matches. # noqa: E501
-
- :param auto_accept: The auto_accept of this LanguagePair. # noqa: E501
- :type: bool
- """
-
- self._auto_accept = auto_accept
-
- @property
- def case_sensitive(self):
- """Gets the case_sensitive of this LanguagePair. # noqa: E501
-
- Use case sensitive translation memory matching. # noqa: E501
-
- :return: The case_sensitive of this LanguagePair. # noqa: E501
- :rtype: bool
- """
- return self._case_sensitive
-
- @case_sensitive.setter
- def case_sensitive(self, case_sensitive):
- """Sets the case_sensitive of this LanguagePair.
-
- Use case sensitive translation memory matching. # noqa: E501
-
- :param case_sensitive: The case_sensitive of this LanguagePair. # noqa: E501
- :type: bool
- """
-
- self._case_sensitive = case_sensitive
-
- @property
- def take_match_attribution(self):
- """Gets the take_match_attribution of this LanguagePair. # noqa: E501
-
- Use MT for unmatched segments. # noqa: E501
-
- :return: The take_match_attribution of this LanguagePair. # noqa: E501
- :rtype: bool
- """
- return self._take_match_attribution
-
- @take_match_attribution.setter
- def take_match_attribution(self, take_match_attribution):
- """Sets the take_match_attribution of this LanguagePair.
-
- Use MT for unmatched segments. # noqa: E501
-
- :param take_match_attribution: The take_match_attribution of this LanguagePair. # noqa: E501
- :type: bool
- """
-
- self._take_match_attribution = take_match_attribution
-
- @property
- def config_id(self):
- """Gets the config_id of this LanguagePair. # noqa: E501
-
- Configuration id # noqa: E501
-
- :return: The config_id of this LanguagePair. # noqa: E501
- :rtype: int
- """
- return self._config_id
-
- @config_id.setter
- def config_id(self, config_id):
- """Sets the config_id of this LanguagePair.
-
- Configuration id # noqa: E501
-
- :param config_id: The config_id of this LanguagePair. # noqa: E501
- :type: int
- """
-
- self._config_id = config_id
-
- @property
- def workflow_template_id(self):
- """Gets the workflow_template_id of this LanguagePair. # noqa: E501
-
- Workflow Template id, to assign a specific Workflow to the project created out of this Language Pair. WorkflowTemplateIds can be retrieved via the /workflows/templates endpoint. If not specified then the Job level workflowTemplateId will be used. # noqa: E501
-
- :return: The workflow_template_id of this LanguagePair. # noqa: E501
- :rtype: int
- """
- return self._workflow_template_id
-
- @workflow_template_id.setter
- def workflow_template_id(self, workflow_template_id):
- """Sets the workflow_template_id of this LanguagePair.
-
- Workflow Template id, to assign a specific Workflow to the project created out of this Language Pair. WorkflowTemplateIds can be retrieved via the /workflows/templates endpoint. If not specified then the Job level workflowTemplateId will be used. # noqa: E501
-
- :param workflow_template_id: The workflow_template_id of this LanguagePair. # noqa: E501
- :type: int
- """
-
- self._workflow_template_id = workflow_template_id
-
- @property
- def workflow_template_name(self):
- """Gets the workflow_template_name of this LanguagePair. # noqa: E501
-
- Workflow Template Name, when passed with TeamId it allows for an on the fly look up of the correct WorkflowTemplate to use. If workflowTemplateId is passed the workflowTemplateId supercedes other lookups. # noqa: E501
-
- :return: The workflow_template_name of this LanguagePair. # noqa: E501
- :rtype: int
- """
- return self._workflow_template_name
-
- @workflow_template_name.setter
- def workflow_template_name(self, workflow_template_name):
- """Sets the workflow_template_name of this LanguagePair.
-
- Workflow Template Name, when passed with TeamId it allows for an on the fly look up of the correct WorkflowTemplate to use. If workflowTemplateId is passed the workflowTemplateId supercedes other lookups. # noqa: E501
-
- :param workflow_template_name: The workflow_template_name of this LanguagePair. # noqa: E501
- :type: int
- """
-
- self._workflow_template_name = workflow_template_name
-
- @property
- def workflow_stage_assignments(self):
- """Gets the workflow_stage_assignments of this LanguagePair. # noqa: E501
-
-
- :return: The workflow_stage_assignments of this LanguagePair. # noqa: E501
- :rtype: list[WorkflowStageAssignment]
- """
- return self._workflow_stage_assignments
-
- @workflow_stage_assignments.setter
- def workflow_stage_assignments(self, workflow_stage_assignments):
- """Sets the workflow_stage_assignments of this LanguagePair.
-
-
- :param workflow_stage_assignments: The workflow_stage_assignments of this LanguagePair. # noqa: E501
- :type: list[WorkflowStageAssignment]
- """
-
- self._workflow_stage_assignments = workflow_stage_assignments
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, LanguagePair):
- return False
-
- return self.to_dict() == other.to_dict()
+ A language pair couples the source and target language along with memory and pre-translations settings associated to a project.
+ """ # noqa: E501
+ trg_lang: StrictStr = Field(description="Target language, an ISO 639-1 language identifier.", alias="trgLang")
+ trg_locale: Optional[StrictStr] = Field(default=None, description="A locale identifier, supported for target language.", alias="trgLocale")
+ due_date: Optional[StrictStr] = Field(default=None, description="An ISO date.", alias="dueDate")
+ memory_id: StrictInt = Field(description="A unique number identifying the associated Memory.", alias="memoryId")
+ external_model_id: Optional[StrictInt] = Field(default=None, description="A unique identifier for working with a third party model in the Lilt Platform", alias="externalModelId")
+ pretranslate: Optional[StrictBool] = Field(default=None, description="Attribute translation authorship of exact matches to the creator of the document being pretranslated.")
+ auto_accept: Optional[StrictBool] = Field(default=None, description="Accept and lock exact matches.", alias="autoAccept")
+ case_sensitive: Optional[StrictBool] = Field(default=None, description="Use case sensitive translation memory matching.", alias="caseSensitive")
+ take_match_attribution: Optional[StrictBool] = Field(default=None, description="Use MT for unmatched segments.", alias="takeMatchAttribution")
+ config_id: Optional[StrictInt] = Field(default=None, description="Configuration id", alias="configId")
+ workflow_template_id: Optional[StrictInt] = Field(default=None, description="Workflow Template id, to assign a specific Workflow to the project created out of this Language Pair. WorkflowTemplateIds can be retrieved via the /workflows/templates endpoint. If not specified then the Job level workflowTemplateId will be used.", alias="workflowTemplateId")
+ workflow_template_name: Optional[StrictInt] = Field(default=None, description="Workflow Template Name, when passed with TeamId it allows for an on the fly look up of the correct WorkflowTemplate to use. If workflowTemplateId is passed the workflowTemplateId supercedes other lookups.", alias="workflowTemplateName")
+ workflow_stage_assignments: Optional[List[WorkflowStageAssignment]] = Field(default=None, alias="workflowStageAssignments")
+ __properties: ClassVar[List[str]] = ["trgLang", "trgLocale", "dueDate", "memoryId", "externalModelId", "pretranslate", "autoAccept", "caseSensitive", "takeMatchAttribution", "configId", "workflowTemplateId", "workflowTemplateName", "workflowStageAssignments"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of LanguagePair from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in workflow_stage_assignments (list)
+ _items = []
+ if self.workflow_stage_assignments:
+ for _item_workflow_stage_assignments in self.workflow_stage_assignments:
+ if _item_workflow_stage_assignments:
+ _items.append(_item_workflow_stage_assignments.to_dict())
+ _dict['workflowStageAssignments'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of LanguagePair from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "trgLang": obj.get("trgLang"),
+ "trgLocale": obj.get("trgLocale"),
+ "dueDate": obj.get("dueDate"),
+ "memoryId": obj.get("memoryId"),
+ "externalModelId": obj.get("externalModelId"),
+ "pretranslate": obj.get("pretranslate"),
+ "autoAccept": obj.get("autoAccept"),
+ "caseSensitive": obj.get("caseSensitive"),
+ "takeMatchAttribution": obj.get("takeMatchAttribution"),
+ "configId": obj.get("configId"),
+ "workflowTemplateId": obj.get("workflowTemplateId"),
+ "workflowTemplateName": obj.get("workflowTemplateName"),
+ "workflowStageAssignments": [WorkflowStageAssignment.from_dict(_item) for _item in obj["workflowStageAssignments"]] if obj.get("workflowStageAssignments") is not None else None
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, LanguagePair):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/languages_response.py b/lilt/models/languages_response.py
index c3bb45b..9f32454 100644
--- a/lilt/models/languages_response.py
+++ b/lilt/models/languages_response.py
@@ -3,148 +3,87 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class LanguagesResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class LanguagesResponse(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'source_to_target': 'object',
- 'code_to_name': 'object'
- }
-
- attribute_map = {
- 'source_to_target': 'source_to_target',
- 'code_to_name': 'code_to_name'
- }
-
- def __init__(self, source_to_target=None, code_to_name=None, local_vars_configuration=None): # noqa: E501
- """LanguagesResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._source_to_target = None
- self._code_to_name = None
- self.discriminator = None
-
- if source_to_target is not None:
- self.source_to_target = source_to_target
- if code_to_name is not None:
- self.code_to_name = code_to_name
-
- @property
- def source_to_target(self):
- """Gets the source_to_target of this LanguagesResponse. # noqa: E501
-
- A two-dimensional object in which the first key is an ISO 639-1 language code indicating the source, and the second key is an ISO 639-1 language code indicating the target. # noqa: E501
-
- :return: The source_to_target of this LanguagesResponse. # noqa: E501
- :rtype: object
+ LanguagesResponse
+ """ # noqa: E501
+ source_to_target: Optional[Dict[str, Any]] = Field(default=None, description="A two-dimensional object in which the first key is an ISO 639-1 language code indicating the source, and the second key is an ISO 639-1 language code indicating the target.")
+ code_to_name: Optional[Dict[str, Any]] = Field(default=None, description="An object in which the key is an ISO 639-1 language code, and the value is the language name.")
+ __properties: ClassVar[List[str]] = ["source_to_target", "code_to_name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of LanguagesResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._source_to_target
-
- @source_to_target.setter
- def source_to_target(self, source_to_target):
- """Sets the source_to_target of this LanguagesResponse.
+ excluded_fields: Set[str] = set([
+ ])
- A two-dimensional object in which the first key is an ISO 639-1 language code indicating the source, and the second key is an ISO 639-1 language code indicating the target. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- :param source_to_target: The source_to_target of this LanguagesResponse. # noqa: E501
- :type: object
- """
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of LanguagesResponse from a dict"""
+ if obj is None:
+ return None
- self._source_to_target = source_to_target
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @property
- def code_to_name(self):
- """Gets the code_to_name of this LanguagesResponse. # noqa: E501
+ _obj = cls.model_validate({
+ "source_to_target": obj.get("source_to_target"),
+ "code_to_name": obj.get("code_to_name")
+ })
+ return _obj
- An object in which the key is an ISO 639-1 language code, and the value is the language name. # noqa: E501
-
- :return: The code_to_name of this LanguagesResponse. # noqa: E501
- :rtype: object
- """
- return self._code_to_name
-
- @code_to_name.setter
- def code_to_name(self, code_to_name):
- """Sets the code_to_name of this LanguagesResponse.
-
- An object in which the key is an ISO 639-1 language code, and the value is the language name. # noqa: E501
-
- :param code_to_name: The code_to_name of this LanguagesResponse. # noqa: E501
- :type: object
- """
- self._code_to_name = code_to_name
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, LanguagesResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, LanguagesResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/lilt_create_content.py b/lilt/models/lilt_create_content.py
index 4ad3841..7082b19 100644
--- a/lilt/models/lilt_create_content.py
+++ b/lilt/models/lilt_create_content.py
@@ -3,259 +3,103 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.lilt_create_content_preferences import LiltCreateContentPreferences
+from lilt.models.lilt_create_content_template_params import LiltCreateContentTemplateParams
+from typing import Optional, Set
+from typing_extensions import Self
-class LiltCreateContent(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
+class LiltCreateContent(BaseModel):
"""
- openapi_types = {
- 'name': 'str',
- 'id': 'int',
- 'language': 'str',
- 'template': 'str',
- 'template_params': 'LiltCreateContentTemplateParams',
- 'preferences': 'LiltCreateContentPreferences'
- }
-
- attribute_map = {
- 'name': 'name',
- 'id': 'id',
- 'language': 'language',
- 'template': 'template',
- 'template_params': 'templateParams',
- 'preferences': 'preferences'
- }
-
- def __init__(self, name=None, id=None, language=None, template=None, template_params=None, preferences=None, local_vars_configuration=None): # noqa: E501
- """LiltCreateContent - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._name = None
- self._id = None
- self._language = None
- self._template = None
- self._template_params = None
- self._preferences = None
- self.discriminator = None
-
- if name is not None:
- self.name = name
- if id is not None:
- self.id = id
- self.language = language
- self.template = template
- self.template_params = template_params
- if preferences is not None:
- self.preferences = preferences
-
- @property
- def name(self):
- """Gets the name of this LiltCreateContent. # noqa: E501
-
- A name for the request content. # noqa: E501
-
- :return: The name of this LiltCreateContent. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this LiltCreateContent.
-
- A name for the request content. # noqa: E501
-
- :param name: The name of this LiltCreateContent. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def id(self):
- """Gets the id of this LiltCreateContent. # noqa: E501
-
- A unique identifier for the generated content. # noqa: E501
-
- :return: The id of this LiltCreateContent. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this LiltCreateContent.
-
- A unique identifier for the generated content. # noqa: E501
-
- :param id: The id of this LiltCreateContent. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def language(self):
- """Gets the language of this LiltCreateContent. # noqa: E501
-
- The language of the content. # noqa: E501
-
- :return: The language of this LiltCreateContent. # noqa: E501
- :rtype: str
- """
- return self._language
-
- @language.setter
- def language(self, language):
- """Sets the language of this LiltCreateContent.
-
- The language of the content. # noqa: E501
-
- :param language: The language of this LiltCreateContent. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501
- raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501
-
- self._language = language
-
- @property
- def template(self):
- """Gets the template of this LiltCreateContent. # noqa: E501
-
- The template of the content. # noqa: E501
-
- :return: The template of this LiltCreateContent. # noqa: E501
- :rtype: str
+ Content Parameters for LiltCreate.
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, description="A name for the request content.")
+ id: Optional[StrictInt] = Field(default=None, description="A unique identifier for the generated content.")
+ language: StrictStr = Field(description="The language of the content.")
+ template: StrictStr = Field(description="The template of the content.")
+ template_params: LiltCreateContentTemplateParams = Field(alias="templateParams")
+ preferences: Optional[LiltCreateContentPreferences] = None
+ __properties: ClassVar[List[str]] = ["name", "id", "language", "template", "templateParams", "preferences"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of LiltCreateContent from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._template
-
- @template.setter
- def template(self, template):
- """Sets the template of this LiltCreateContent.
-
- The template of the content. # noqa: E501
-
- :param template: The template of this LiltCreateContent. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and template is None: # noqa: E501
- raise ValueError("Invalid value for `template`, must not be `None`") # noqa: E501
-
- self._template = template
-
- @property
- def template_params(self):
- """Gets the template_params of this LiltCreateContent. # noqa: E501
-
-
- :return: The template_params of this LiltCreateContent. # noqa: E501
- :rtype: LiltCreateContentTemplateParams
- """
- return self._template_params
-
- @template_params.setter
- def template_params(self, template_params):
- """Sets the template_params of this LiltCreateContent.
-
-
- :param template_params: The template_params of this LiltCreateContent. # noqa: E501
- :type: LiltCreateContentTemplateParams
- """
- if self.local_vars_configuration.client_side_validation and template_params is None: # noqa: E501
- raise ValueError("Invalid value for `template_params`, must not be `None`") # noqa: E501
-
- self._template_params = template_params
-
- @property
- def preferences(self):
- """Gets the preferences of this LiltCreateContent. # noqa: E501
-
-
- :return: The preferences of this LiltCreateContent. # noqa: E501
- :rtype: LiltCreateContentPreferences
- """
- return self._preferences
-
- @preferences.setter
- def preferences(self, preferences):
- """Sets the preferences of this LiltCreateContent.
-
-
- :param preferences: The preferences of this LiltCreateContent. # noqa: E501
- :type: LiltCreateContentPreferences
- """
-
- self._preferences = preferences
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, LiltCreateContent):
- return False
-
- return self.to_dict() == other.to_dict()
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of template_params
+ if self.template_params:
+ _dict['templateParams'] = self.template_params.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of preferences
+ if self.preferences:
+ _dict['preferences'] = self.preferences.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of LiltCreateContent from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "id": obj.get("id"),
+ "language": obj.get("language"),
+ "template": obj.get("template"),
+ "templateParams": LiltCreateContentTemplateParams.from_dict(obj["templateParams"]) if obj.get("templateParams") is not None else None,
+ "preferences": LiltCreateContentPreferences.from_dict(obj["preferences"]) if obj.get("preferences") is not None else None
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, LiltCreateContent):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/lilt_create_content_preferences.py b/lilt/models/lilt_create_content_preferences.py
index 6cae370..8d74f21 100644
--- a/lilt/models/lilt_create_content_preferences.py
+++ b/lilt/models/lilt_create_content_preferences.py
@@ -3,148 +3,87 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class LiltCreateContentPreferences(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class LiltCreateContentPreferences(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'tone': 'str',
- 'styleguide': 'str'
- }
-
- attribute_map = {
- 'tone': 'tone',
- 'styleguide': 'styleguide'
- }
-
- def __init__(self, tone=None, styleguide=None, local_vars_configuration=None): # noqa: E501
- """LiltCreateContentPreferences - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._tone = None
- self._styleguide = None
- self.discriminator = None
-
- if tone is not None:
- self.tone = tone
- if styleguide is not None:
- self.styleguide = styleguide
-
- @property
- def tone(self):
- """Gets the tone of this LiltCreateContentPreferences. # noqa: E501
-
- The tone of the content. # noqa: E501
-
- :return: The tone of this LiltCreateContentPreferences. # noqa: E501
- :rtype: str
+ The preferences of the content.
+ """ # noqa: E501
+ tone: Optional[StrictStr] = Field(default=None, description="The tone of the content.")
+ styleguide: Optional[StrictStr] = Field(default=None, description="The styleguide of the content.")
+ __properties: ClassVar[List[str]] = ["tone", "styleguide"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of LiltCreateContentPreferences from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._tone
-
- @tone.setter
- def tone(self, tone):
- """Sets the tone of this LiltCreateContentPreferences.
+ excluded_fields: Set[str] = set([
+ ])
- The tone of the content. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- :param tone: The tone of this LiltCreateContentPreferences. # noqa: E501
- :type: str
- """
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of LiltCreateContentPreferences from a dict"""
+ if obj is None:
+ return None
- self._tone = tone
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @property
- def styleguide(self):
- """Gets the styleguide of this LiltCreateContentPreferences. # noqa: E501
+ _obj = cls.model_validate({
+ "tone": obj.get("tone"),
+ "styleguide": obj.get("styleguide")
+ })
+ return _obj
- The styleguide of the content. # noqa: E501
-
- :return: The styleguide of this LiltCreateContentPreferences. # noqa: E501
- :rtype: str
- """
- return self._styleguide
-
- @styleguide.setter
- def styleguide(self, styleguide):
- """Sets the styleguide of this LiltCreateContentPreferences.
-
- The styleguide of the content. # noqa: E501
-
- :param styleguide: The styleguide of this LiltCreateContentPreferences. # noqa: E501
- :type: str
- """
- self._styleguide = styleguide
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, LiltCreateContentPreferences):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, LiltCreateContentPreferences):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/lilt_create_content_request.py b/lilt/models/lilt_create_content_request.py
index 10ea827..30d2861 100644
--- a/lilt/models/lilt_create_content_request.py
+++ b/lilt/models/lilt_create_content_request.py
@@ -3,231 +3,101 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.lilt_create_content_preferences import LiltCreateContentPreferences
+from lilt.models.lilt_create_content_template_params import LiltCreateContentTemplateParams
+from typing import Optional, Set
+from typing_extensions import Self
-
-class LiltCreateContentRequest(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class LiltCreateContentRequest(BaseModel):
"""
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'name': 'str',
- 'language': 'str',
- 'template': 'str',
- 'template_params': 'LiltCreateContentTemplateParams',
- 'preferences': 'LiltCreateContentPreferences'
- }
-
- attribute_map = {
- 'name': 'name',
- 'language': 'language',
- 'template': 'template',
- 'template_params': 'templateParams',
- 'preferences': 'preferences'
- }
-
- def __init__(self, name=None, language=None, template=None, template_params=None, preferences=None, local_vars_configuration=None): # noqa: E501
- """LiltCreateContentRequest - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._name = None
- self._language = None
- self._template = None
- self._template_params = None
- self._preferences = None
- self.discriminator = None
-
- if name is not None:
- self.name = name
- self.language = language
- self.template = template
- self.template_params = template_params
- if preferences is not None:
- self.preferences = preferences
-
- @property
- def name(self):
- """Gets the name of this LiltCreateContentRequest. # noqa: E501
-
- A name for the request content. # noqa: E501
-
- :return: The name of this LiltCreateContentRequest. # noqa: E501
- :rtype: str
+ Content Parameters for LiltCreate.
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, description="A name for the request content.")
+ language: StrictStr = Field(description="The language of the content.")
+ template: StrictStr = Field(description="The template of the content.")
+ template_params: LiltCreateContentTemplateParams = Field(alias="templateParams")
+ preferences: Optional[LiltCreateContentPreferences] = None
+ __properties: ClassVar[List[str]] = ["name", "language", "template", "templateParams", "preferences"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of LiltCreateContentRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this LiltCreateContentRequest.
-
- A name for the request content. # noqa: E501
-
- :param name: The name of this LiltCreateContentRequest. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def language(self):
- """Gets the language of this LiltCreateContentRequest. # noqa: E501
-
- The language of the content. # noqa: E501
-
- :return: The language of this LiltCreateContentRequest. # noqa: E501
- :rtype: str
- """
- return self._language
-
- @language.setter
- def language(self, language):
- """Sets the language of this LiltCreateContentRequest.
-
- The language of the content. # noqa: E501
-
- :param language: The language of this LiltCreateContentRequest. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501
- raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501
-
- self._language = language
-
- @property
- def template(self):
- """Gets the template of this LiltCreateContentRequest. # noqa: E501
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of template_params
+ if self.template_params:
+ _dict['templateParams'] = self.template_params.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of preferences
+ if self.preferences:
+ _dict['preferences'] = self.preferences.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of LiltCreateContentRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "language": obj.get("language"),
+ "template": obj.get("template"),
+ "templateParams": LiltCreateContentTemplateParams.from_dict(obj["templateParams"]) if obj.get("templateParams") is not None else None,
+ "preferences": LiltCreateContentPreferences.from_dict(obj["preferences"]) if obj.get("preferences") is not None else None
+ })
+ return _obj
- The template of the content. # noqa: E501
-
- :return: The template of this LiltCreateContentRequest. # noqa: E501
- :rtype: str
- """
- return self._template
-
- @template.setter
- def template(self, template):
- """Sets the template of this LiltCreateContentRequest.
-
- The template of the content. # noqa: E501
-
- :param template: The template of this LiltCreateContentRequest. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and template is None: # noqa: E501
- raise ValueError("Invalid value for `template`, must not be `None`") # noqa: E501
-
- self._template = template
-
- @property
- def template_params(self):
- """Gets the template_params of this LiltCreateContentRequest. # noqa: E501
-
-
- :return: The template_params of this LiltCreateContentRequest. # noqa: E501
- :rtype: LiltCreateContentTemplateParams
- """
- return self._template_params
-
- @template_params.setter
- def template_params(self, template_params):
- """Sets the template_params of this LiltCreateContentRequest.
-
-
- :param template_params: The template_params of this LiltCreateContentRequest. # noqa: E501
- :type: LiltCreateContentTemplateParams
- """
- if self.local_vars_configuration.client_side_validation and template_params is None: # noqa: E501
- raise ValueError("Invalid value for `template_params`, must not be `None`") # noqa: E501
-
- self._template_params = template_params
-
- @property
- def preferences(self):
- """Gets the preferences of this LiltCreateContentRequest. # noqa: E501
-
-
- :return: The preferences of this LiltCreateContentRequest. # noqa: E501
- :rtype: LiltCreateContentPreferences
- """
- return self._preferences
-
- @preferences.setter
- def preferences(self, preferences):
- """Sets the preferences of this LiltCreateContentRequest.
-
-
- :param preferences: The preferences of this LiltCreateContentRequest. # noqa: E501
- :type: LiltCreateContentPreferences
- """
- self._preferences = preferences
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, LiltCreateContentRequest):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, LiltCreateContentRequest):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/lilt_create_content_template_params.py b/lilt/models/lilt_create_content_template_params.py
index 56c062e..c173e52 100644
--- a/lilt/models/lilt_create_content_template_params.py
+++ b/lilt/models/lilt_create_content_template_params.py
@@ -3,233 +3,93 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-
-class LiltCreateContentTemplateParams(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class LiltCreateContentTemplateParams(BaseModel):
"""
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'content_length': 'int',
- 'memory_id': 'int',
- 'language': 'str',
- 'sections': 'list[str]',
- 'summary': 'str'
- }
-
- attribute_map = {
- 'content_length': 'contentLength',
- 'memory_id': 'memoryId',
- 'language': 'language',
- 'sections': 'sections',
- 'summary': 'summary'
- }
-
- def __init__(self, content_length=None, memory_id=None, language=None, sections=None, summary=None, local_vars_configuration=None): # noqa: E501
- """LiltCreateContentTemplateParams - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._content_length = None
- self._memory_id = None
- self._language = None
- self._sections = None
- self._summary = None
- self.discriminator = None
-
- if content_length is not None:
- self.content_length = content_length
- if memory_id is not None:
- self.memory_id = memory_id
- self.language = language
- if sections is not None:
- self.sections = sections
- if summary is not None:
- self.summary = summary
-
- @property
- def content_length(self):
- """Gets the content_length of this LiltCreateContentTemplateParams. # noqa: E501
-
- The length of the content. # noqa: E501
-
- :return: The content_length of this LiltCreateContentTemplateParams. # noqa: E501
- :rtype: int
+ The template parameters of the content.
+ """ # noqa: E501
+ content_length: Optional[StrictInt] = Field(default=None, description="The length of the content.", alias="contentLength")
+ memory_id: Optional[StrictInt] = Field(default=None, description="The ID referencing a Data Source.", alias="memoryId")
+ language: StrictStr = Field(description="The language of the content.")
+ sections: Optional[List[StrictStr]] = Field(default=None, description="The sections of the content.")
+ summary: Optional[StrictStr] = Field(default=None, description="The summary of the content.")
+ __properties: ClassVar[List[str]] = ["contentLength", "memoryId", "language", "sections", "summary"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of LiltCreateContentTemplateParams from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._content_length
-
- @content_length.setter
- def content_length(self, content_length):
- """Sets the content_length of this LiltCreateContentTemplateParams.
-
- The length of the content. # noqa: E501
-
- :param content_length: The content_length of this LiltCreateContentTemplateParams. # noqa: E501
- :type: int
- """
-
- self._content_length = content_length
-
- @property
- def memory_id(self):
- """Gets the memory_id of this LiltCreateContentTemplateParams. # noqa: E501
-
- The ID referencing a Data Source. # noqa: E501
-
- :return: The memory_id of this LiltCreateContentTemplateParams. # noqa: E501
- :rtype: int
- """
- return self._memory_id
-
- @memory_id.setter
- def memory_id(self, memory_id):
- """Sets the memory_id of this LiltCreateContentTemplateParams.
-
- The ID referencing a Data Source. # noqa: E501
-
- :param memory_id: The memory_id of this LiltCreateContentTemplateParams. # noqa: E501
- :type: int
- """
-
- self._memory_id = memory_id
-
- @property
- def language(self):
- """Gets the language of this LiltCreateContentTemplateParams. # noqa: E501
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of LiltCreateContentTemplateParams from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "contentLength": obj.get("contentLength"),
+ "memoryId": obj.get("memoryId"),
+ "language": obj.get("language"),
+ "sections": obj.get("sections"),
+ "summary": obj.get("summary")
+ })
+ return _obj
- The language of the content. # noqa: E501
-
- :return: The language of this LiltCreateContentTemplateParams. # noqa: E501
- :rtype: str
- """
- return self._language
-
- @language.setter
- def language(self, language):
- """Sets the language of this LiltCreateContentTemplateParams.
-
- The language of the content. # noqa: E501
-
- :param language: The language of this LiltCreateContentTemplateParams. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and language is None: # noqa: E501
- raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501
-
- self._language = language
-
- @property
- def sections(self):
- """Gets the sections of this LiltCreateContentTemplateParams. # noqa: E501
-
- The sections of the content. # noqa: E501
-
- :return: The sections of this LiltCreateContentTemplateParams. # noqa: E501
- :rtype: list[str]
- """
- return self._sections
-
- @sections.setter
- def sections(self, sections):
- """Sets the sections of this LiltCreateContentTemplateParams.
-
- The sections of the content. # noqa: E501
-
- :param sections: The sections of this LiltCreateContentTemplateParams. # noqa: E501
- :type: list[str]
- """
-
- self._sections = sections
-
- @property
- def summary(self):
- """Gets the summary of this LiltCreateContentTemplateParams. # noqa: E501
-
- The summary of the content. # noqa: E501
-
- :return: The summary of this LiltCreateContentTemplateParams. # noqa: E501
- :rtype: str
- """
- return self._summary
-
- @summary.setter
- def summary(self, summary):
- """Sets the summary of this LiltCreateContentTemplateParams.
-
- The summary of the content. # noqa: E501
-
- :param summary: The summary of this LiltCreateContentTemplateParams. # noqa: E501
- :type: str
- """
- self._summary = summary
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, LiltCreateContentTemplateParams):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, LiltCreateContentTemplateParams):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/memory.py b/lilt/models/memory.py
index aa7f1c7..786a1be 100644
--- a/lilt/models/memory.py
+++ b/lilt/models/memory.py
@@ -3,400 +3,105 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-
-class Memory(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class Memory(BaseModel):
"""
+ A Memory is a collection of parallel (source/target) segments from which a MT/TM model is trained. When a translator confirms a segment in the Interface, a parallel segment is added to the Memory. Parallel segments from existing translation memories and bitexts can also be added to the Memory via the REST API.
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the Memory.")
+ srclang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ trglang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ srclocale: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ trglocale: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ name: Optional[StrictStr] = Field(default=None, description="A name for the Memory.")
+ is_processing: Optional[StrictBool] = Field(default=None, description="Indicates the memory is being processed.")
+ version: Optional[StrictInt] = Field(default=None, description="The current version of the Memory, which is the number of updates since the memory was created.")
+ created_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ updated_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ resources: Optional[List[StrictStr]] = Field(default=None, description="The resource files (translation memories and termbases) associated with this Memory.")
+ __properties: ClassVar[List[str]] = ["id", "srclang", "trglang", "srclocale", "trglocale", "name", "is_processing", "version", "created_at", "updated_at", "resources"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Memory from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Memory from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "srclang": obj.get("srclang"),
+ "trglang": obj.get("trglang"),
+ "srclocale": obj.get("srclocale"),
+ "trglocale": obj.get("trglocale"),
+ "name": obj.get("name"),
+ "is_processing": obj.get("is_processing"),
+ "version": obj.get("version"),
+ "created_at": obj.get("created_at"),
+ "updated_at": obj.get("updated_at"),
+ "resources": obj.get("resources")
+ })
+ return _obj
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'srclang': 'str',
- 'trglang': 'str',
- 'srclocale': 'str',
- 'trglocale': 'str',
- 'name': 'str',
- 'is_processing': 'bool',
- 'version': 'int',
- 'created_at': 'int',
- 'updated_at': 'int',
- 'resources': 'list[str]'
- }
-
- attribute_map = {
- 'id': 'id',
- 'srclang': 'srclang',
- 'trglang': 'trglang',
- 'srclocale': 'srclocale',
- 'trglocale': 'trglocale',
- 'name': 'name',
- 'is_processing': 'is_processing',
- 'version': 'version',
- 'created_at': 'created_at',
- 'updated_at': 'updated_at',
- 'resources': 'resources'
- }
-
- def __init__(self, id=None, srclang=None, trglang=None, srclocale=None, trglocale=None, name=None, is_processing=None, version=None, created_at=None, updated_at=None, resources=None, local_vars_configuration=None): # noqa: E501
- """Memory - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._srclang = None
- self._trglang = None
- self._srclocale = None
- self._trglocale = None
- self._name = None
- self._is_processing = None
- self._version = None
- self._created_at = None
- self._updated_at = None
- self._resources = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if srclang is not None:
- self.srclang = srclang
- if trglang is not None:
- self.trglang = trglang
- if srclocale is not None:
- self.srclocale = srclocale
- if trglocale is not None:
- self.trglocale = trglocale
- if name is not None:
- self.name = name
- if is_processing is not None:
- self.is_processing = is_processing
- if version is not None:
- self.version = version
- if created_at is not None:
- self.created_at = created_at
- if updated_at is not None:
- self.updated_at = updated_at
- if resources is not None:
- self.resources = resources
-
- @property
- def id(self):
- """Gets the id of this Memory. # noqa: E501
-
- A unique number identifying the Memory. # noqa: E501
-
- :return: The id of this Memory. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this Memory.
-
- A unique number identifying the Memory. # noqa: E501
-
- :param id: The id of this Memory. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def srclang(self):
- """Gets the srclang of this Memory. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The srclang of this Memory. # noqa: E501
- :rtype: str
- """
- return self._srclang
-
- @srclang.setter
- def srclang(self, srclang):
- """Sets the srclang of this Memory.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param srclang: The srclang of this Memory. # noqa: E501
- :type: str
- """
-
- self._srclang = srclang
-
- @property
- def trglang(self):
- """Gets the trglang of this Memory. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The trglang of this Memory. # noqa: E501
- :rtype: str
- """
- return self._trglang
-
- @trglang.setter
- def trglang(self, trglang):
- """Sets the trglang of this Memory.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param trglang: The trglang of this Memory. # noqa: E501
- :type: str
- """
-
- self._trglang = trglang
-
- @property
- def srclocale(self):
- """Gets the srclocale of this Memory. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The srclocale of this Memory. # noqa: E501
- :rtype: str
- """
- return self._srclocale
-
- @srclocale.setter
- def srclocale(self, srclocale):
- """Sets the srclocale of this Memory.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param srclocale: The srclocale of this Memory. # noqa: E501
- :type: str
- """
-
- self._srclocale = srclocale
-
- @property
- def trglocale(self):
- """Gets the trglocale of this Memory. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The trglocale of this Memory. # noqa: E501
- :rtype: str
- """
- return self._trglocale
-
- @trglocale.setter
- def trglocale(self, trglocale):
- """Sets the trglocale of this Memory.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param trglocale: The trglocale of this Memory. # noqa: E501
- :type: str
- """
-
- self._trglocale = trglocale
-
- @property
- def name(self):
- """Gets the name of this Memory. # noqa: E501
-
- A name for the Memory. # noqa: E501
-
- :return: The name of this Memory. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this Memory.
-
- A name for the Memory. # noqa: E501
-
- :param name: The name of this Memory. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def is_processing(self):
- """Gets the is_processing of this Memory. # noqa: E501
-
- Indicates the memory is being processed. # noqa: E501
-
- :return: The is_processing of this Memory. # noqa: E501
- :rtype: bool
- """
- return self._is_processing
-
- @is_processing.setter
- def is_processing(self, is_processing):
- """Sets the is_processing of this Memory.
-
- Indicates the memory is being processed. # noqa: E501
-
- :param is_processing: The is_processing of this Memory. # noqa: E501
- :type: bool
- """
-
- self._is_processing = is_processing
-
- @property
- def version(self):
- """Gets the version of this Memory. # noqa: E501
-
- The current version of the Memory, which is the number of updates since the memory was created. # noqa: E501
-
- :return: The version of this Memory. # noqa: E501
- :rtype: int
- """
- return self._version
-
- @version.setter
- def version(self, version):
- """Sets the version of this Memory.
-
- The current version of the Memory, which is the number of updates since the memory was created. # noqa: E501
-
- :param version: The version of this Memory. # noqa: E501
- :type: int
- """
-
- self._version = version
-
- @property
- def created_at(self):
- """Gets the created_at of this Memory. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The created_at of this Memory. # noqa: E501
- :rtype: int
- """
- return self._created_at
-
- @created_at.setter
- def created_at(self, created_at):
- """Sets the created_at of this Memory.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param created_at: The created_at of this Memory. # noqa: E501
- :type: int
- """
-
- self._created_at = created_at
-
- @property
- def updated_at(self):
- """Gets the updated_at of this Memory. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The updated_at of this Memory. # noqa: E501
- :rtype: int
- """
- return self._updated_at
-
- @updated_at.setter
- def updated_at(self, updated_at):
- """Sets the updated_at of this Memory.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param updated_at: The updated_at of this Memory. # noqa: E501
- :type: int
- """
-
- self._updated_at = updated_at
-
- @property
- def resources(self):
- """Gets the resources of this Memory. # noqa: E501
-
- The resource files (translation memories and termbases) associated with this Memory. # noqa: E501
-
- :return: The resources of this Memory. # noqa: E501
- :rtype: list[str]
- """
- return self._resources
-
- @resources.setter
- def resources(self, resources):
- """Sets the resources of this Memory.
-
- The resource files (translation memories and termbases) associated with this Memory. # noqa: E501
-
- :param resources: The resources of this Memory. # noqa: E501
- :type: list[str]
- """
-
- self._resources = resources
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, Memory):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, Memory):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/memory_create_parameters.py b/lilt/models/memory_create_parameters.py
index d0063f9..6448efc 100644
--- a/lilt/models/memory_create_parameters.py
+++ b/lilt/models/memory_create_parameters.py
@@ -3,235 +3,93 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-
-class MemoryCreateParameters(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class MemoryCreateParameters(BaseModel):
"""
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'name': 'str',
- 'srclang': 'str',
- 'trglang': 'str',
- 'srclocale': 'str',
- 'trglocale': 'str'
- }
-
- attribute_map = {
- 'name': 'name',
- 'srclang': 'srclang',
- 'trglang': 'trglang',
- 'srclocale': 'srclocale',
- 'trglocale': 'trglocale'
- }
-
- def __init__(self, name=None, srclang=None, trglang=None, srclocale=None, trglocale=None, local_vars_configuration=None): # noqa: E501
- """MemoryCreateParameters - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._name = None
- self._srclang = None
- self._trglang = None
- self._srclocale = None
- self._trglocale = None
- self.discriminator = None
-
- self.name = name
- self.srclang = srclang
- self.trglang = trglang
- if srclocale is not None:
- self.srclocale = srclocale
- if trglocale is not None:
- self.trglocale = trglocale
-
- @property
- def name(self):
- """Gets the name of this MemoryCreateParameters. # noqa: E501
-
- A name for the Memory. # noqa: E501
-
- :return: The name of this MemoryCreateParameters. # noqa: E501
- :rtype: str
+ MemoryCreateParameters
+ """ # noqa: E501
+ name: StrictStr = Field(description="A name for the Memory.")
+ srclang: StrictStr = Field(description="An ISO 639-1 language identifier.")
+ trglang: StrictStr = Field(description="An ISO 639-1 language identifier.")
+ srclocale: Optional[StrictStr] = Field(default=None, description="An ISO 3166-1 region name for language locales")
+ trglocale: Optional[StrictStr] = Field(default=None, description="An ISO 3166-1 region name for language locales")
+ __properties: ClassVar[List[str]] = ["name", "srclang", "trglang", "srclocale", "trglocale"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of MemoryCreateParameters from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this MemoryCreateParameters.
-
- A name for the Memory. # noqa: E501
-
- :param name: The name of this MemoryCreateParameters. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
- raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
-
- self._name = name
-
- @property
- def srclang(self):
- """Gets the srclang of this MemoryCreateParameters. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The srclang of this MemoryCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._srclang
-
- @srclang.setter
- def srclang(self, srclang):
- """Sets the srclang of this MemoryCreateParameters.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param srclang: The srclang of this MemoryCreateParameters. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and srclang is None: # noqa: E501
- raise ValueError("Invalid value for `srclang`, must not be `None`") # noqa: E501
-
- self._srclang = srclang
-
- @property
- def trglang(self):
- """Gets the trglang of this MemoryCreateParameters. # noqa: E501
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of MemoryCreateParameters from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "srclang": obj.get("srclang"),
+ "trglang": obj.get("trglang"),
+ "srclocale": obj.get("srclocale"),
+ "trglocale": obj.get("trglocale")
+ })
+ return _obj
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The trglang of this MemoryCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._trglang
-
- @trglang.setter
- def trglang(self, trglang):
- """Sets the trglang of this MemoryCreateParameters.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param trglang: The trglang of this MemoryCreateParameters. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and trglang is None: # noqa: E501
- raise ValueError("Invalid value for `trglang`, must not be `None`") # noqa: E501
-
- self._trglang = trglang
-
- @property
- def srclocale(self):
- """Gets the srclocale of this MemoryCreateParameters. # noqa: E501
-
- An ISO 3166-1 region name for language locales # noqa: E501
-
- :return: The srclocale of this MemoryCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._srclocale
-
- @srclocale.setter
- def srclocale(self, srclocale):
- """Sets the srclocale of this MemoryCreateParameters.
-
- An ISO 3166-1 region name for language locales # noqa: E501
-
- :param srclocale: The srclocale of this MemoryCreateParameters. # noqa: E501
- :type: str
- """
-
- self._srclocale = srclocale
-
- @property
- def trglocale(self):
- """Gets the trglocale of this MemoryCreateParameters. # noqa: E501
-
- An ISO 3166-1 region name for language locales # noqa: E501
-
- :return: The trglocale of this MemoryCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._trglocale
-
- @trglocale.setter
- def trglocale(self, trglocale):
- """Sets the trglocale of this MemoryCreateParameters.
-
- An ISO 3166-1 region name for language locales # noqa: E501
-
- :param trglocale: The trglocale of this MemoryCreateParameters. # noqa: E501
- :type: str
- """
- self._trglocale = trglocale
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, MemoryCreateParameters):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, MemoryCreateParameters):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/memory_delete_response.py b/lilt/models/memory_delete_response.py
index 7fcf8b7..95e965c 100644
--- a/lilt/models/memory_delete_response.py
+++ b/lilt/models/memory_delete_response.py
@@ -3,148 +3,87 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class MemoryDeleteResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class MemoryDeleteResponse(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'deleted': 'bool'
- }
-
- attribute_map = {
- 'id': 'id',
- 'deleted': 'deleted'
- }
-
- def __init__(self, id=None, deleted=None, local_vars_configuration=None): # noqa: E501
- """MemoryDeleteResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._deleted = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if deleted is not None:
- self.deleted = deleted
-
- @property
- def id(self):
- """Gets the id of this MemoryDeleteResponse. # noqa: E501
-
- A unique Memory identifier. # noqa: E501
-
- :return: The id of this MemoryDeleteResponse. # noqa: E501
- :rtype: int
+ MemoryDeleteResponse
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique Memory identifier.")
+ deleted: Optional[StrictBool] = Field(default=None, description="If the operation succeeded, then `true`. Otherwise, `false`.")
+ __properties: ClassVar[List[str]] = ["id", "deleted"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of MemoryDeleteResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this MemoryDeleteResponse.
+ excluded_fields: Set[str] = set([
+ ])
- A unique Memory identifier. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- :param id: The id of this MemoryDeleteResponse. # noqa: E501
- :type: int
- """
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of MemoryDeleteResponse from a dict"""
+ if obj is None:
+ return None
- self._id = id
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @property
- def deleted(self):
- """Gets the deleted of this MemoryDeleteResponse. # noqa: E501
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "deleted": obj.get("deleted")
+ })
+ return _obj
- If the operation succeeded, then `true`. Otherwise, `false`. # noqa: E501
-
- :return: The deleted of this MemoryDeleteResponse. # noqa: E501
- :rtype: bool
- """
- return self._deleted
-
- @deleted.setter
- def deleted(self, deleted):
- """Sets the deleted of this MemoryDeleteResponse.
-
- If the operation succeeded, then `true`. Otherwise, `false`. # noqa: E501
-
- :param deleted: The deleted of this MemoryDeleteResponse. # noqa: E501
- :type: bool
- """
- self._deleted = deleted
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, MemoryDeleteResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, MemoryDeleteResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/memory_import_response.py b/lilt/models/memory_import_response.py
index d3f28c2..c1fe244 100644
--- a/lilt/models/memory_import_response.py
+++ b/lilt/models/memory_import_response.py
@@ -3,148 +3,87 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class MemoryImportResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class MemoryImportResponse(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'is_processing': 'int'
- }
-
- attribute_map = {
- 'id': 'id',
- 'is_processing': 'isProcessing'
- }
-
- def __init__(self, id=None, is_processing=None, local_vars_configuration=None): # noqa: E501
- """MemoryImportResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._is_processing = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if is_processing is not None:
- self.is_processing = is_processing
-
- @property
- def id(self):
- """Gets the id of this MemoryImportResponse. # noqa: E501
-
- A unique Memory identifier. # noqa: E501
-
- :return: The id of this MemoryImportResponse. # noqa: E501
- :rtype: int
+ MemoryImportResponse
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique Memory identifier.")
+ is_processing: Optional[StrictInt] = Field(default=None, description="The current state of the import.", alias="isProcessing")
+ __properties: ClassVar[List[str]] = ["id", "isProcessing"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of MemoryImportResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this MemoryImportResponse.
+ excluded_fields: Set[str] = set([
+ ])
- A unique Memory identifier. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- :param id: The id of this MemoryImportResponse. # noqa: E501
- :type: int
- """
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of MemoryImportResponse from a dict"""
+ if obj is None:
+ return None
- self._id = id
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @property
- def is_processing(self):
- """Gets the is_processing of this MemoryImportResponse. # noqa: E501
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "isProcessing": obj.get("isProcessing")
+ })
+ return _obj
- The current state of the import. # noqa: E501
-
- :return: The is_processing of this MemoryImportResponse. # noqa: E501
- :rtype: int
- """
- return self._is_processing
-
- @is_processing.setter
- def is_processing(self, is_processing):
- """Sets the is_processing of this MemoryImportResponse.
-
- The current state of the import. # noqa: E501
-
- :param is_processing: The is_processing of this MemoryImportResponse. # noqa: E501
- :type: int
- """
- self._is_processing = is_processing
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, MemoryImportResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, MemoryImportResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/memory_update_parameters.py b/lilt/models/memory_update_parameters.py
index c9f92a2..617c61e 100644
--- a/lilt/models/memory_update_parameters.py
+++ b/lilt/models/memory_update_parameters.py
@@ -3,150 +3,87 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class MemoryUpdateParameters(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+class MemoryUpdateParameters(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'name': 'str'
- }
-
- attribute_map = {
- 'id': 'id',
- 'name': 'name'
- }
-
- def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501
- """MemoryUpdateParameters - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._name = None
- self.discriminator = None
-
- self.id = id
- self.name = name
-
- @property
- def id(self):
- """Gets the id of this MemoryUpdateParameters. # noqa: E501
-
- A unique Memory identifier. # noqa: E501
-
- :return: The id of this MemoryUpdateParameters. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this MemoryUpdateParameters.
-
- A unique Memory identifier. # noqa: E501
-
- :param id: The id of this MemoryUpdateParameters. # noqa: E501
- :type: int
+ MemoryUpdateParameters
+ """ # noqa: E501
+ id: StrictInt = Field(description="A unique Memory identifier.")
+ name: StrictStr = Field(description="The Memory name.")
+ __properties: ClassVar[List[str]] = ["id", "name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of MemoryUpdateParameters from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
- raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
+ excluded_fields: Set[str] = set([
+ ])
- self._id = id
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- @property
- def name(self):
- """Gets the name of this MemoryUpdateParameters. # noqa: E501
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of MemoryUpdateParameters from a dict"""
+ if obj is None:
+ return None
- The Memory name. # noqa: E501
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- :return: The name of this MemoryUpdateParameters. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this MemoryUpdateParameters.
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "name": obj.get("name")
+ })
+ return _obj
- The Memory name. # noqa: E501
- :param name: The name of this MemoryUpdateParameters. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
- raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
-
- self._name = name
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, MemoryUpdateParameters):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, MemoryUpdateParameters):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/model.py b/lilt/models/model.py
new file mode 100644
index 0000000..1354efc
--- /dev/null
+++ b/lilt/models/model.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Model(BaseModel):
+ """
+ Model
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="The unique identifier for the model.")
+ name: Optional[StrictStr] = Field(default=None, description="The name of the model.")
+ provider: Optional[StrictStr] = Field(default=None, description="The provider of the model.")
+ status: Optional[StrictStr] = Field(default=None, description="The status of the model.")
+ src_lang: Optional[StrictStr] = Field(default=None, description="The source language of the model.", alias="srcLang")
+ trg_lang: Optional[StrictStr] = Field(default=None, description="The target language of the model.", alias="trgLang")
+ src_locale: Optional[StrictStr] = Field(default=None, description="The source locale of the model.", alias="srcLocale")
+ trg_locale: Optional[StrictStr] = Field(default=None, description="The target locale of the model.", alias="trgLocale")
+ __properties: ClassVar[List[str]] = ["id", "name", "provider", "status", "srcLang", "trgLang", "srcLocale", "trgLocale"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Model from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Model from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "provider": obj.get("provider"),
+ "status": obj.get("status"),
+ "srcLang": obj.get("srcLang"),
+ "trgLang": obj.get("trgLang"),
+ "srcLocale": obj.get("srcLocale"),
+ "trgLocale": obj.get("trgLocale")
+ })
+ return _obj
+
+
diff --git a/lilt/models/project.py b/lilt/models/project.py
index 9a25684..963bd6f 100644
--- a/lilt/models/project.py
+++ b/lilt/models/project.py
@@ -3,574 +3,135 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class Project(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.document_without_segments import DocumentWithoutSegments
+from typing import Optional, Set
+from typing_extensions import Self
+class Project(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'memory_id': 'int',
- 'job_id': 'int',
- 'srclang': 'str',
- 'trglang': 'str',
- 'srclocale': 'str',
- 'trglocale': 'str',
- 'name': 'str',
- 'state': 'str',
- 'due_date': 'int',
- 'archived': 'bool',
- 'metadata': 'object',
- 'sample_review_percentage': 'int',
- 'created_at': 'int',
- 'updated_at': 'int',
- 'workflow_status': 'str',
- 'document': 'list[DocumentWithoutSegments]'
- }
-
- attribute_map = {
- 'id': 'id',
- 'memory_id': 'memory_id',
- 'job_id': 'job_id',
- 'srclang': 'srclang',
- 'trglang': 'trglang',
- 'srclocale': 'srclocale',
- 'trglocale': 'trglocale',
- 'name': 'name',
- 'state': 'state',
- 'due_date': 'due_date',
- 'archived': 'archived',
- 'metadata': 'metadata',
- 'sample_review_percentage': 'sample_review_percentage',
- 'created_at': 'created_at',
- 'updated_at': 'updated_at',
- 'workflow_status': 'workflowStatus',
- 'document': 'document'
- }
-
- def __init__(self, id=None, memory_id=None, job_id=None, srclang=None, trglang=None, srclocale=None, trglocale=None, name=None, state=None, due_date=None, archived=None, metadata=None, sample_review_percentage=None, created_at=None, updated_at=None, workflow_status=None, document=None, local_vars_configuration=None): # noqa: E501
- """Project - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._memory_id = None
- self._job_id = None
- self._srclang = None
- self._trglang = None
- self._srclocale = None
- self._trglocale = None
- self._name = None
- self._state = None
- self._due_date = None
- self._archived = None
- self._metadata = None
- self._sample_review_percentage = None
- self._created_at = None
- self._updated_at = None
- self._workflow_status = None
- self._document = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if memory_id is not None:
- self.memory_id = memory_id
- if job_id is not None:
- self.job_id = job_id
- if srclang is not None:
- self.srclang = srclang
- if trglang is not None:
- self.trglang = trglang
- if srclocale is not None:
- self.srclocale = srclocale
- if trglocale is not None:
- self.trglocale = trglocale
- if name is not None:
- self.name = name
- if state is not None:
- self.state = state
- if due_date is not None:
- self.due_date = due_date
- if archived is not None:
- self.archived = archived
- if metadata is not None:
- self.metadata = metadata
- if sample_review_percentage is not None:
- self.sample_review_percentage = sample_review_percentage
- if created_at is not None:
- self.created_at = created_at
- if updated_at is not None:
- self.updated_at = updated_at
- if workflow_status is not None:
- self.workflow_status = workflow_status
- if document is not None:
- self.document = document
-
- @property
- def id(self):
- """Gets the id of this Project. # noqa: E501
-
- A unique number identifying the Project. # noqa: E501
-
- :return: The id of this Project. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this Project.
-
- A unique number identifying the Project. # noqa: E501
-
- :param id: The id of this Project. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def memory_id(self):
- """Gets the memory_id of this Project. # noqa: E501
-
- A unique number identifying the associated Memory. # noqa: E501
-
- :return: The memory_id of this Project. # noqa: E501
- :rtype: int
- """
- return self._memory_id
-
- @memory_id.setter
- def memory_id(self, memory_id):
- """Sets the memory_id of this Project.
-
- A unique number identifying the associated Memory. # noqa: E501
-
- :param memory_id: The memory_id of this Project. # noqa: E501
- :type: int
- """
-
- self._memory_id = memory_id
-
- @property
- def job_id(self):
- """Gets the job_id of this Project. # noqa: E501
-
- A unique number identifying the associated Job. # noqa: E501
-
- :return: The job_id of this Project. # noqa: E501
- :rtype: int
- """
- return self._job_id
-
- @job_id.setter
- def job_id(self, job_id):
- """Sets the job_id of this Project.
-
- A unique number identifying the associated Job. # noqa: E501
-
- :param job_id: The job_id of this Project. # noqa: E501
- :type: int
- """
-
- self._job_id = job_id
-
- @property
- def srclang(self):
- """Gets the srclang of this Project. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The srclang of this Project. # noqa: E501
- :rtype: str
- """
- return self._srclang
-
- @srclang.setter
- def srclang(self, srclang):
- """Sets the srclang of this Project.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param srclang: The srclang of this Project. # noqa: E501
- :type: str
- """
-
- self._srclang = srclang
-
- @property
- def trglang(self):
- """Gets the trglang of this Project. # noqa: E501
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :return: The trglang of this Project. # noqa: E501
- :rtype: str
- """
- return self._trglang
-
- @trglang.setter
- def trglang(self, trglang):
- """Sets the trglang of this Project.
-
- An ISO 639-1 language identifier. # noqa: E501
-
- :param trglang: The trglang of this Project. # noqa: E501
- :type: str
- """
-
- self._trglang = trglang
-
- @property
- def srclocale(self):
- """Gets the srclocale of this Project. # noqa: E501
-
- A locale identifier, supported for srclang. # noqa: E501
-
- :return: The srclocale of this Project. # noqa: E501
- :rtype: str
- """
- return self._srclocale
-
- @srclocale.setter
- def srclocale(self, srclocale):
- """Sets the srclocale of this Project.
-
- A locale identifier, supported for srclang. # noqa: E501
-
- :param srclocale: The srclocale of this Project. # noqa: E501
- :type: str
- """
-
- self._srclocale = srclocale
-
- @property
- def trglocale(self):
- """Gets the trglocale of this Project. # noqa: E501
-
- A locale identifier, supported for trglang. # noqa: E501
-
- :return: The trglocale of this Project. # noqa: E501
- :rtype: str
- """
- return self._trglocale
-
- @trglocale.setter
- def trglocale(self, trglocale):
- """Sets the trglocale of this Project.
-
- A locale identifier, supported for trglang. # noqa: E501
-
- :param trglocale: The trglocale of this Project. # noqa: E501
- :type: str
- """
-
- self._trglocale = trglocale
-
- @property
- def name(self):
- """Gets the name of this Project. # noqa: E501
-
- A name for the project. # noqa: E501
-
- :return: The name of this Project. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this Project.
-
- A name for the project. # noqa: E501
-
- :param name: The name of this Project. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def state(self):
- """Gets the state of this Project. # noqa: E501
-
- The project's state. The possible states are `backlog`, `inProgress`, `inReview`, `inQA`, and `done`. # noqa: E501
-
- :return: The state of this Project. # noqa: E501
- :rtype: str
- """
- return self._state
-
- @state.setter
- def state(self, state):
- """Sets the state of this Project.
-
- The project's state. The possible states are `backlog`, `inProgress`, `inReview`, `inQA`, and `done`. # noqa: E501
-
- :param state: The state of this Project. # noqa: E501
- :type: str
- """
-
- self._state = state
-
- @property
- def due_date(self):
- """Gets the due_date of this Project. # noqa: E501
-
- The due date. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The due_date of this Project. # noqa: E501
- :rtype: int
- """
- return self._due_date
-
- @due_date.setter
- def due_date(self, due_date):
- """Sets the due_date of this Project.
-
- The due date. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param due_date: The due_date of this Project. # noqa: E501
- :type: int
- """
-
- self._due_date = due_date
-
- @property
- def archived(self):
- """Gets the archived of this Project. # noqa: E501
-
- The archived state of the Project. # noqa: E501
-
- :return: The archived of this Project. # noqa: E501
- :rtype: bool
- """
- return self._archived
-
- @archived.setter
- def archived(self, archived):
- """Sets the archived of this Project.
-
- The archived state of the Project. # noqa: E501
-
- :param archived: The archived of this Project. # noqa: E501
- :type: bool
- """
-
- self._archived = archived
-
- @property
- def metadata(self):
- """Gets the metadata of this Project. # noqa: E501
-
- A JSON object of key/value string pairs. Stores custom project information. # noqa: E501
-
- :return: The metadata of this Project. # noqa: E501
- :rtype: object
- """
- return self._metadata
-
- @metadata.setter
- def metadata(self, metadata):
- """Sets the metadata of this Project.
-
- A JSON object of key/value string pairs. Stores custom project information. # noqa: E501
-
- :param metadata: The metadata of this Project. # noqa: E501
- :type: object
- """
-
- self._metadata = metadata
-
- @property
- def sample_review_percentage(self):
- """Gets the sample_review_percentage of this Project. # noqa: E501
-
- The project's sample review percentage. # noqa: E501
-
- :return: The sample_review_percentage of this Project. # noqa: E501
- :rtype: int
- """
- return self._sample_review_percentage
-
- @sample_review_percentage.setter
- def sample_review_percentage(self, sample_review_percentage):
- """Sets the sample_review_percentage of this Project.
-
- The project's sample review percentage. # noqa: E501
-
- :param sample_review_percentage: The sample_review_percentage of this Project. # noqa: E501
- :type: int
- """
-
- self._sample_review_percentage = sample_review_percentage
-
- @property
- def created_at(self):
- """Gets the created_at of this Project. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The created_at of this Project. # noqa: E501
- :rtype: int
- """
- return self._created_at
-
- @created_at.setter
- def created_at(self, created_at):
- """Sets the created_at of this Project.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param created_at: The created_at of this Project. # noqa: E501
- :type: int
- """
-
- self._created_at = created_at
-
- @property
- def updated_at(self):
- """Gets the updated_at of this Project. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The updated_at of this Project. # noqa: E501
- :rtype: int
- """
- return self._updated_at
-
- @updated_at.setter
- def updated_at(self, updated_at):
- """Sets the updated_at of this Project.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param updated_at: The updated_at of this Project. # noqa: E501
- :type: int
- """
-
- self._updated_at = updated_at
-
- @property
- def workflow_status(self):
- """Gets the workflow_status of this Project. # noqa: E501
-
- The status of the Workflow for the current project. This may not be present for all project endpoints even with workflows enabled. # noqa: E501
-
- :return: The workflow_status of this Project. # noqa: E501
- :rtype: str
- """
- return self._workflow_status
-
- @workflow_status.setter
- def workflow_status(self, workflow_status):
- """Sets the workflow_status of this Project.
-
- The status of the Workflow for the current project. This may not be present for all project endpoints even with workflows enabled. # noqa: E501
-
- :param workflow_status: The workflow_status of this Project. # noqa: E501
- :type: str
- """
- allowed_values = ["READY_TO_START", "IN_PROGRESS", "DONE"] # noqa: E501
- if self.local_vars_configuration.client_side_validation and workflow_status not in allowed_values: # noqa: E501
- raise ValueError(
- "Invalid value for `workflow_status` ({0}), must be one of {1}" # noqa: E501
- .format(workflow_status, allowed_values)
- )
-
- self._workflow_status = workflow_status
-
- @property
- def document(self):
- """Gets the document of this Project. # noqa: E501
-
- A list of Documents. # noqa: E501
-
- :return: The document of this Project. # noqa: E501
- :rtype: list[DocumentWithoutSegments]
- """
- return self._document
-
- @document.setter
- def document(self, document):
- """Sets the document of this Project.
-
- A list of Documents. # noqa: E501
-
- :param document: The document of this Project. # noqa: E501
- :type: list[DocumentWithoutSegments]
- """
-
- self._document = document
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, Project):
- return False
-
- return self.to_dict() == other.to_dict()
+ A Project is a collection of zero or more Documents. It is specific to a language pair, and is associated with exactly one Memory for that language pair. The Memory association cannot be changed after the Project is created.
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the Project.")
+ memory_id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the associated Memory.")
+ job_id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the associated Job.")
+ srclang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ trglang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language identifier.")
+ srclocale: Optional[StrictStr] = Field(default=None, description="A locale identifier, supported for srclang.")
+ trglocale: Optional[StrictStr] = Field(default=None, description="A locale identifier, supported for trglang.")
+ name: Optional[StrictStr] = Field(default=None, description="A name for the project.")
+ state: Optional[StrictStr] = Field(default=None, description="The project's state. The possible states are `backlog`, `inProgress`, `inReview`, `inQA`, and `done`.")
+ due_date: Optional[StrictInt] = Field(default=None, description="The due date. Measured in seconds since the Unix epoch.")
+ archived: Optional[StrictBool] = Field(default=None, description="The archived state of the Project.")
+ metadata: Optional[Dict[str, Any]] = Field(default=None, description="A JSON object of key/value string pairs. Stores custom project information.")
+ sample_review_percentage: Optional[StrictInt] = Field(default=None, description="The project's sample review percentage.")
+ created_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ updated_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ workflow_status: Optional[StrictStr] = Field(default=None, description="The status of the Workflow for the current project. This may not be present for all project endpoints even with workflows enabled.", alias="workflowStatus")
+ document: Optional[List[DocumentWithoutSegments]] = Field(default=None, description="A list of Documents.")
+ __properties: ClassVar[List[str]] = ["id", "memory_id", "job_id", "srclang", "trglang", "srclocale", "trglocale", "name", "state", "due_date", "archived", "metadata", "sample_review_percentage", "created_at", "updated_at", "workflowStatus", "document"]
+
+ @field_validator('workflow_status')
+ def workflow_status_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['READY_TO_START', 'IN_PROGRESS', 'DONE']):
+ raise ValueError("must be one of enum values ('READY_TO_START', 'IN_PROGRESS', 'DONE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Project from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in document (list)
+ _items = []
+ if self.document:
+ for _item_document in self.document:
+ if _item_document:
+ _items.append(_item_document.to_dict())
+ _dict['document'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Project from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "memory_id": obj.get("memory_id"),
+ "job_id": obj.get("job_id"),
+ "srclang": obj.get("srclang"),
+ "trglang": obj.get("trglang"),
+ "srclocale": obj.get("srclocale"),
+ "trglocale": obj.get("trglocale"),
+ "name": obj.get("name"),
+ "state": obj.get("state"),
+ "due_date": obj.get("due_date"),
+ "archived": obj.get("archived"),
+ "metadata": obj.get("metadata"),
+ "sample_review_percentage": obj.get("sample_review_percentage"),
+ "created_at": obj.get("created_at"),
+ "updated_at": obj.get("updated_at"),
+ "workflowStatus": obj.get("workflowStatus"),
+ "document": [DocumentWithoutSegments.from_dict(_item) for _item in obj["document"]] if obj.get("document") is not None else None
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, Project):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/project_create_parameters.py b/lilt/models/project_create_parameters.py
index 133cdc5..6966c79 100644
--- a/lilt/models/project_create_parameters.py
+++ b/lilt/models/project_create_parameters.py
@@ -3,262 +3,125 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-class ProjectCreateParameters(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
+class ProjectCreateParameters(BaseModel):
"""
- openapi_types = {
- 'name': 'str',
- 'memory_id': 'int',
- 'job_id': 'int',
- 'due_date': 'int',
- 'metadata': 'object',
- 'workflow_template_id': 'int'
- }
-
- attribute_map = {
- 'name': 'name',
- 'memory_id': 'memory_id',
- 'job_id': 'job_id',
- 'due_date': 'due_date',
- 'metadata': 'metadata',
- 'workflow_template_id': 'workflowTemplateId'
- }
-
- def __init__(self, name=None, memory_id=None, job_id=None, due_date=None, metadata=None, workflow_template_id=None, local_vars_configuration=None): # noqa: E501
- """ProjectCreateParameters - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._name = None
- self._memory_id = None
- self._job_id = None
- self._due_date = None
- self._metadata = None
- self._workflow_template_id = None
- self.discriminator = None
-
- self.name = name
- self.memory_id = memory_id
- if job_id is not None:
- self.job_id = job_id
- if due_date is not None:
- self.due_date = due_date
- if metadata is not None:
- self.metadata = metadata
- if workflow_template_id is not None:
- self.workflow_template_id = workflow_template_id
-
- @property
- def name(self):
- """Gets the name of this ProjectCreateParameters. # noqa: E501
-
- A name for the Project. # noqa: E501
-
- :return: The name of this ProjectCreateParameters. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this ProjectCreateParameters.
-
- A name for the Project. # noqa: E501
-
- :param name: The name of this ProjectCreateParameters. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
- raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
-
- self._name = name
-
- @property
- def memory_id(self):
- """Gets the memory_id of this ProjectCreateParameters. # noqa: E501
-
- The Memory to associate with this new Project. # noqa: E501
-
- :return: The memory_id of this ProjectCreateParameters. # noqa: E501
- :rtype: int
- """
- return self._memory_id
-
- @memory_id.setter
- def memory_id(self, memory_id):
- """Sets the memory_id of this ProjectCreateParameters.
-
- The Memory to associate with this new Project. # noqa: E501
-
- :param memory_id: The memory_id of this ProjectCreateParameters. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and memory_id is None: # noqa: E501
- raise ValueError("Invalid value for `memory_id`, must not be `None`") # noqa: E501
-
- self._memory_id = memory_id
-
- @property
- def job_id(self):
- """Gets the job_id of this ProjectCreateParameters. # noqa: E501
-
- The Job to associate with this new Project. If a Job ID is not provided then a new Job will be created to contain the Project. # noqa: E501
-
- :return: The job_id of this ProjectCreateParameters. # noqa: E501
- :rtype: int
- """
- return self._job_id
-
- @job_id.setter
- def job_id(self, job_id):
- """Sets the job_id of this ProjectCreateParameters.
-
- The Job to associate with this new Project. If a Job ID is not provided then a new Job will be created to contain the Project. # noqa: E501
-
- :param job_id: The job_id of this ProjectCreateParameters. # noqa: E501
- :type: int
- """
-
- self._job_id = job_id
-
- @property
- def due_date(self):
- """Gets the due_date of this ProjectCreateParameters. # noqa: E501
-
- The due date. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The due_date of this ProjectCreateParameters. # noqa: E501
- :rtype: int
+ ProjectCreateParameters
+ """ # noqa: E501
+ name: StrictStr = Field(description="A name for the Project.")
+ memory_id: StrictInt = Field(description="The Memory to associate with this new Project.")
+ job_id: Optional[StrictInt] = Field(default=None, description="The Job to associate with this new Project. If a Job ID is not provided then a new Job will be created to contain the Project. ")
+ due_date: Optional[StrictInt] = Field(default=None, description="The due date. Measured in seconds since the Unix epoch.")
+ metadata: Optional[Dict[str, Any]] = Field(default=None, description="A JSON object of key/value string pairs. Stores custom project information.")
+ workflow_template_id: Optional[StrictInt] = Field(default=None, description="The workflow template used to create this project. WorkflowTemplateIds can be retrieved via the /workflows/templates endpoint. If not specified then the organization default workflowTemplateId will be used.", alias="workflowTemplateId")
+ workflow_template_name: Optional[StrictStr] = Field(default=None, description="Name of the workflow for the project, if a workflowTemplateId is passed, this field will be ignored.")
+ llm_provider: Optional[StrictStr] = Field(default=None, description="The LLM provider to use for the project. Defaults to \"neural\".")
+ external_model_id: Optional[StrictInt] = Field(default=None, description="External model ID, if any. Must match the chosen llm_provider.")
+ is_plural: Optional[StrictBool] = Field(default=None, description="Whether the documents in this project contain ICU plural forms.")
+ require_batch_qa_translator: Optional[StrictBool] = Field(default=None, description="Whether to require batch QA from the translator side.")
+ enable_prompt_labeling: Optional[StrictBool] = Field(default=None, description="Whether to enable prompt labeling for the project.")
+ job_type: Optional[StrictStr] = Field(default=None, description="(Optional) A specialized job type for advanced features.")
+ additional_guidelines: Optional[StrictStr] = Field(default=None, description="(Optional) Additional instructions or guidelines.")
+ is_enhanced_human_ai_optimized: Optional[StrictBool] = Field(default=None, description="Whether the project is enhanced with AI optimization.")
+ domain_id: Optional[StrictInt] = Field(default=None, description="A domain ID to categorize this project under.", alias="domainId")
+ __properties: ClassVar[List[str]] = ["name", "memory_id", "job_id", "due_date", "metadata", "workflowTemplateId", "workflow_template_name", "llm_provider", "external_model_id", "is_plural", "require_batch_qa_translator", "enable_prompt_labeling", "job_type", "additional_guidelines", "is_enhanced_human_ai_optimized", "domainId"]
+
+ @field_validator('job_type')
+ def job_type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['TRANSLATION', 'PROMPT_RESPONSE']):
+ raise ValueError("must be one of enum values ('TRANSLATION', 'PROMPT_RESPONSE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ProjectCreateParameters from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._due_date
-
- @due_date.setter
- def due_date(self, due_date):
- """Sets the due_date of this ProjectCreateParameters.
-
- The due date. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param due_date: The due_date of this ProjectCreateParameters. # noqa: E501
- :type: int
- """
-
- self._due_date = due_date
-
- @property
- def metadata(self):
- """Gets the metadata of this ProjectCreateParameters. # noqa: E501
-
- A JSON object of key/value string pairs. Stores custom project information. # noqa: E501
-
- :return: The metadata of this ProjectCreateParameters. # noqa: E501
- :rtype: object
- """
- return self._metadata
-
- @metadata.setter
- def metadata(self, metadata):
- """Sets the metadata of this ProjectCreateParameters.
-
- A JSON object of key/value string pairs. Stores custom project information. # noqa: E501
-
- :param metadata: The metadata of this ProjectCreateParameters. # noqa: E501
- :type: object
- """
-
- self._metadata = metadata
-
- @property
- def workflow_template_id(self):
- """Gets the workflow_template_id of this ProjectCreateParameters. # noqa: E501
-
- The workflow template used to create this project. WorkflowTemplateIds can be retrieved via the /workflows/templates endpoint. If not specified then the organization default workflowTemplateId will be used. # noqa: E501
-
- :return: The workflow_template_id of this ProjectCreateParameters. # noqa: E501
- :rtype: int
- """
- return self._workflow_template_id
-
- @workflow_template_id.setter
- def workflow_template_id(self, workflow_template_id):
- """Sets the workflow_template_id of this ProjectCreateParameters.
-
- The workflow template used to create this project. WorkflowTemplateIds can be retrieved via the /workflows/templates endpoint. If not specified then the organization default workflowTemplateId will be used. # noqa: E501
-
- :param workflow_template_id: The workflow_template_id of this ProjectCreateParameters. # noqa: E501
- :type: int
- """
-
- self._workflow_template_id = workflow_template_id
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, ProjectCreateParameters):
- return False
-
- return self.to_dict() == other.to_dict()
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ProjectCreateParameters from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "memory_id": obj.get("memory_id"),
+ "job_id": obj.get("job_id"),
+ "due_date": obj.get("due_date"),
+ "metadata": obj.get("metadata"),
+ "workflowTemplateId": obj.get("workflowTemplateId"),
+ "workflow_template_name": obj.get("workflow_template_name"),
+ "llm_provider": obj.get("llm_provider"),
+ "external_model_id": obj.get("external_model_id"),
+ "is_plural": obj.get("is_plural"),
+ "require_batch_qa_translator": obj.get("require_batch_qa_translator"),
+ "enable_prompt_labeling": obj.get("enable_prompt_labeling"),
+ "job_type": obj.get("job_type"),
+ "additional_guidelines": obj.get("additional_guidelines"),
+ "is_enhanced_human_ai_optimized": obj.get("is_enhanced_human_ai_optimized"),
+ "domainId": obj.get("domainId")
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, ProjectCreateParameters):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/project_delete_response.py b/lilt/models/project_delete_response.py
index d6b2f05..91abd03 100644
--- a/lilt/models/project_delete_response.py
+++ b/lilt/models/project_delete_response.py
@@ -3,148 +3,87 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class ProjectDeleteResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class ProjectDeleteResponse(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'deleted': 'bool'
- }
-
- attribute_map = {
- 'id': 'id',
- 'deleted': 'deleted'
- }
-
- def __init__(self, id=None, deleted=None, local_vars_configuration=None): # noqa: E501
- """ProjectDeleteResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._deleted = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if deleted is not None:
- self.deleted = deleted
-
- @property
- def id(self):
- """Gets the id of this ProjectDeleteResponse. # noqa: E501
-
- A unique Project identifier. # noqa: E501
-
- :return: The id of this ProjectDeleteResponse. # noqa: E501
- :rtype: int
+ ProjectDeleteResponse
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique Project identifier.")
+ deleted: Optional[StrictBool] = Field(default=None, description="If the operation succeeded, then `true`. Otherwise, `false`.")
+ __properties: ClassVar[List[str]] = ["id", "deleted"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ProjectDeleteResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this ProjectDeleteResponse.
+ excluded_fields: Set[str] = set([
+ ])
- A unique Project identifier. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- :param id: The id of this ProjectDeleteResponse. # noqa: E501
- :type: int
- """
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ProjectDeleteResponse from a dict"""
+ if obj is None:
+ return None
- self._id = id
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @property
- def deleted(self):
- """Gets the deleted of this ProjectDeleteResponse. # noqa: E501
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "deleted": obj.get("deleted")
+ })
+ return _obj
- If the operation succeeded, then `true`. Otherwise, `false`. # noqa: E501
-
- :return: The deleted of this ProjectDeleteResponse. # noqa: E501
- :rtype: bool
- """
- return self._deleted
-
- @deleted.setter
- def deleted(self, deleted):
- """Sets the deleted of this ProjectDeleteResponse.
-
- If the operation succeeded, then `true`. Otherwise, `false`. # noqa: E501
-
- :param deleted: The deleted of this ProjectDeleteResponse. # noqa: E501
- :type: bool
- """
- self._deleted = deleted
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, ProjectDeleteResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, ProjectDeleteResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/project_stats.py b/lilt/models/project_stats.py
index 243b622..c100bed 100644
--- a/lilt/models/project_stats.py
+++ b/lilt/models/project_stats.py
@@ -3,227 +3,93 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class ProjectStats(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+class ProjectStats(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'source_words': 'int',
- 'exact_words': 'int',
- 'fuzzy_words': 'int',
- 'new_words': 'int'
- }
-
- attribute_map = {
- 'id': 'id',
- 'source_words': 'sourceWords',
- 'exact_words': 'exactWords',
- 'fuzzy_words': 'fuzzyWords',
- 'new_words': 'newWords'
- }
-
- def __init__(self, id=None, source_words=None, exact_words=None, fuzzy_words=None, new_words=None, local_vars_configuration=None): # noqa: E501
- """ProjectStats - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._source_words = None
- self._exact_words = None
- self._fuzzy_words = None
- self._new_words = None
- self.discriminator = None
-
- self.id = id
- self.source_words = source_words
- self.exact_words = exact_words
- self.fuzzy_words = fuzzy_words
- self.new_words = new_words
-
- @property
- def id(self):
- """Gets the id of this ProjectStats. # noqa: E501
-
-
- :return: The id of this ProjectStats. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this ProjectStats.
-
-
- :param id: The id of this ProjectStats. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
- raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
-
- self._id = id
-
- @property
- def source_words(self):
- """Gets the source_words of this ProjectStats. # noqa: E501
-
-
- :return: The source_words of this ProjectStats. # noqa: E501
- :rtype: int
- """
- return self._source_words
-
- @source_words.setter
- def source_words(self, source_words):
- """Sets the source_words of this ProjectStats.
-
-
- :param source_words: The source_words of this ProjectStats. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and source_words is None: # noqa: E501
- raise ValueError("Invalid value for `source_words`, must not be `None`") # noqa: E501
-
- self._source_words = source_words
-
- @property
- def exact_words(self):
- """Gets the exact_words of this ProjectStats. # noqa: E501
-
-
- :return: The exact_words of this ProjectStats. # noqa: E501
- :rtype: int
- """
- return self._exact_words
-
- @exact_words.setter
- def exact_words(self, exact_words):
- """Sets the exact_words of this ProjectStats.
-
-
- :param exact_words: The exact_words of this ProjectStats. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and exact_words is None: # noqa: E501
- raise ValueError("Invalid value for `exact_words`, must not be `None`") # noqa: E501
-
- self._exact_words = exact_words
-
- @property
- def fuzzy_words(self):
- """Gets the fuzzy_words of this ProjectStats. # noqa: E501
-
-
- :return: The fuzzy_words of this ProjectStats. # noqa: E501
- :rtype: int
- """
- return self._fuzzy_words
-
- @fuzzy_words.setter
- def fuzzy_words(self, fuzzy_words):
- """Sets the fuzzy_words of this ProjectStats.
-
-
- :param fuzzy_words: The fuzzy_words of this ProjectStats. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and fuzzy_words is None: # noqa: E501
- raise ValueError("Invalid value for `fuzzy_words`, must not be `None`") # noqa: E501
-
- self._fuzzy_words = fuzzy_words
-
- @property
- def new_words(self):
- """Gets the new_words of this ProjectStats. # noqa: E501
-
-
- :return: The new_words of this ProjectStats. # noqa: E501
- :rtype: int
+ ProjectStats
+ """ # noqa: E501
+ id: StrictInt
+ source_words: StrictInt = Field(alias="sourceWords")
+ exact_words: StrictInt = Field(alias="exactWords")
+ fuzzy_words: StrictInt = Field(alias="fuzzyWords")
+ new_words: StrictInt = Field(alias="newWords")
+ __properties: ClassVar[List[str]] = ["id", "sourceWords", "exactWords", "fuzzyWords", "newWords"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ProjectStats from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._new_words
-
- @new_words.setter
- def new_words(self, new_words):
- """Sets the new_words of this ProjectStats.
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ProjectStats from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "sourceWords": obj.get("sourceWords"),
+ "exactWords": obj.get("exactWords"),
+ "fuzzyWords": obj.get("fuzzyWords"),
+ "newWords": obj.get("newWords")
+ })
+ return _obj
- :param new_words: The new_words of this ProjectStats. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and new_words is None: # noqa: E501
- raise ValueError("Invalid value for `new_words`, must not be `None`") # noqa: E501
-
- self._new_words = new_words
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, ProjectStats):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, ProjectStats):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/sdlxliff_filter.py b/lilt/models/sdlxliff_filter.py
index 01f8e66..ee87870 100644
--- a/lilt/models/sdlxliff_filter.py
+++ b/lilt/models/sdlxliff_filter.py
@@ -3,183 +3,96 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class SDLXLIFFFilter(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class SDLXLIFFFilter(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'conf_name': 'str',
- 'allowable_percentage': 'int',
- 'allow_unlocked_segments': 'bool'
- }
-
- attribute_map = {
- 'conf_name': 'confName',
- 'allowable_percentage': 'allowablePercentage',
- 'allow_unlocked_segments': 'allowUnlockedSegments'
- }
-
- def __init__(self, conf_name=None, allowable_percentage=None, allow_unlocked_segments=None, local_vars_configuration=None): # noqa: E501
- """SDLXLIFFFilter - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._conf_name = None
- self._allowable_percentage = None
- self._allow_unlocked_segments = None
- self.discriminator = None
-
- self.conf_name = conf_name
- if allowable_percentage is not None:
- self.allowable_percentage = allowable_percentage
- if allow_unlocked_segments is not None:
- self.allow_unlocked_segments = allow_unlocked_segments
-
- @property
- def conf_name(self):
- """Gets the conf_name of this SDLXLIFFFilter. # noqa: E501
-
- the current state of the SDLXLIFF Trans Unit. # noqa: E501
-
- :return: The conf_name of this SDLXLIFFFilter. # noqa: E501
- :rtype: str
+ SDLXLIFFFilter
+ """ # noqa: E501
+ conf_name: StrictStr = Field(description="the current state of the SDLXLIFF Trans Unit.", alias="confName")
+ allowable_percentage: Optional[StrictInt] = Field(default=None, description="This represents for the current conf_name what percentage the filter applies to. If you pass -1 it will take any value for this field and won't ignore blank values. If you pass 50, Lilt will only import Segments that have a 50 percent match or better.", alias="allowablePercentage")
+ allow_unlocked_segments: Optional[StrictBool] = Field(default=None, description="Boolean that tells Lilt whether we should allow unlocked Segments for this conf_name.", alias="allowUnlockedSegments")
+ __properties: ClassVar[List[str]] = ["confName", "allowablePercentage", "allowUnlockedSegments"]
+
+ @field_validator('conf_name')
+ def conf_name_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['Translated', 'Draft', 'ApprovedTranslation', 'Locked', 'SignedOff']):
+ raise ValueError("must be one of enum values ('Translated', 'Draft', 'ApprovedTranslation', 'Locked', 'SignedOff')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of SDLXLIFFFilter from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._conf_name
+ excluded_fields: Set[str] = set([
+ ])
- @conf_name.setter
- def conf_name(self, conf_name):
- """Sets the conf_name of this SDLXLIFFFilter.
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- the current state of the SDLXLIFF Trans Unit. # noqa: E501
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of SDLXLIFFFilter from a dict"""
+ if obj is None:
+ return None
- :param conf_name: The conf_name of this SDLXLIFFFilter. # noqa: E501
- :type: str
- """
- if self.local_vars_configuration.client_side_validation and conf_name is None: # noqa: E501
- raise ValueError("Invalid value for `conf_name`, must not be `None`") # noqa: E501
- allowed_values = ["Translated", "Draft", "ApprovedTranslation", "Locked", "SignedOff"] # noqa: E501
- if self.local_vars_configuration.client_side_validation and conf_name not in allowed_values: # noqa: E501
- raise ValueError(
- "Invalid value for `conf_name` ({0}), must be one of {1}" # noqa: E501
- .format(conf_name, allowed_values)
- )
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- self._conf_name = conf_name
+ _obj = cls.model_validate({
+ "confName": obj.get("confName"),
+ "allowablePercentage": obj.get("allowablePercentage"),
+ "allowUnlockedSegments": obj.get("allowUnlockedSegments")
+ })
+ return _obj
- @property
- def allowable_percentage(self):
- """Gets the allowable_percentage of this SDLXLIFFFilter. # noqa: E501
-
- This represents for the current conf_name what percentage the filter applies to. If you pass -1 it will take any value for this field and won't ignore blank values. If you pass 50, Lilt will only import Segments that have a 50 percent match or better. # noqa: E501
-
- :return: The allowable_percentage of this SDLXLIFFFilter. # noqa: E501
- :rtype: int
- """
- return self._allowable_percentage
-
- @allowable_percentage.setter
- def allowable_percentage(self, allowable_percentage):
- """Sets the allowable_percentage of this SDLXLIFFFilter.
-
- This represents for the current conf_name what percentage the filter applies to. If you pass -1 it will take any value for this field and won't ignore blank values. If you pass 50, Lilt will only import Segments that have a 50 percent match or better. # noqa: E501
-
- :param allowable_percentage: The allowable_percentage of this SDLXLIFFFilter. # noqa: E501
- :type: int
- """
-
- self._allowable_percentage = allowable_percentage
-
- @property
- def allow_unlocked_segments(self):
- """Gets the allow_unlocked_segments of this SDLXLIFFFilter. # noqa: E501
-
- Boolean that tells Lilt whether we should allow unlocked Segments for this conf_name. # noqa: E501
-
- :return: The allow_unlocked_segments of this SDLXLIFFFilter. # noqa: E501
- :rtype: bool
- """
- return self._allow_unlocked_segments
-
- @allow_unlocked_segments.setter
- def allow_unlocked_segments(self, allow_unlocked_segments):
- """Sets the allow_unlocked_segments of this SDLXLIFFFilter.
-
- Boolean that tells Lilt whether we should allow unlocked Segments for this conf_name. # noqa: E501
-
- :param allow_unlocked_segments: The allow_unlocked_segments of this SDLXLIFFFilter. # noqa: E501
- :type: bool
- """
- self._allow_unlocked_segments = allow_unlocked_segments
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, SDLXLIFFFilter):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, SDLXLIFFFilter):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/segment.py b/lilt/models/segment.py
index 967d0f3..1d03bcc 100644
--- a/lilt/models/segment.py
+++ b/lilt/models/segment.py
@@ -3,400 +3,105 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-
-class Segment(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class Segment(BaseModel):
"""
+ A Segment is a source string and, optionally, its translation. A Segment can be associated with both a Memory and a Document. The Segment object contains additional metadata about the source and target strings.
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the Segment.")
+ created_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ updated_at: Optional[StrictInt] = Field(default=None, description="Time at which the object was created. Measured in seconds since the Unix epoch.")
+ document_id: Optional[StrictInt] = Field(default=None, description="A unique Document identifier.")
+ memory_id: Optional[StrictInt] = Field(default=None, description="The Memory with which this Segment is associated.")
+ source: Optional[StrictStr] = Field(default=None, description="The source string.")
+ srclang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language code.")
+ target: Optional[StrictStr] = Field(default=None, description="The target string.")
+ trglang: Optional[StrictStr] = Field(default=None, description="An ISO 639-1 language code.")
+ is_confirmed: Optional[StrictBool] = Field(default=None, description="The confirmation status.")
+ is_reviewed: Optional[StrictBool] = Field(default=None, description="The review status.")
+ __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "document_id", "memory_id", "source", "srclang", "target", "trglang", "is_confirmed", "is_reviewed"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Segment from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Segment from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "created_at": obj.get("created_at"),
+ "updated_at": obj.get("updated_at"),
+ "document_id": obj.get("document_id"),
+ "memory_id": obj.get("memory_id"),
+ "source": obj.get("source"),
+ "srclang": obj.get("srclang"),
+ "target": obj.get("target"),
+ "trglang": obj.get("trglang"),
+ "is_confirmed": obj.get("is_confirmed"),
+ "is_reviewed": obj.get("is_reviewed")
+ })
+ return _obj
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'created_at': 'int',
- 'updated_at': 'int',
- 'document_id': 'int',
- 'memory_id': 'int',
- 'source': 'str',
- 'srclang': 'str',
- 'target': 'str',
- 'trglang': 'str',
- 'is_confirmed': 'bool',
- 'is_reviewed': 'bool'
- }
-
- attribute_map = {
- 'id': 'id',
- 'created_at': 'created_at',
- 'updated_at': 'updated_at',
- 'document_id': 'document_id',
- 'memory_id': 'memory_id',
- 'source': 'source',
- 'srclang': 'srclang',
- 'target': 'target',
- 'trglang': 'trglang',
- 'is_confirmed': 'is_confirmed',
- 'is_reviewed': 'is_reviewed'
- }
-
- def __init__(self, id=None, created_at=None, updated_at=None, document_id=None, memory_id=None, source=None, srclang=None, target=None, trglang=None, is_confirmed=None, is_reviewed=None, local_vars_configuration=None): # noqa: E501
- """Segment - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._created_at = None
- self._updated_at = None
- self._document_id = None
- self._memory_id = None
- self._source = None
- self._srclang = None
- self._target = None
- self._trglang = None
- self._is_confirmed = None
- self._is_reviewed = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if created_at is not None:
- self.created_at = created_at
- if updated_at is not None:
- self.updated_at = updated_at
- if document_id is not None:
- self.document_id = document_id
- if memory_id is not None:
- self.memory_id = memory_id
- if source is not None:
- self.source = source
- if srclang is not None:
- self.srclang = srclang
- if target is not None:
- self.target = target
- if trglang is not None:
- self.trglang = trglang
- if is_confirmed is not None:
- self.is_confirmed = is_confirmed
- if is_reviewed is not None:
- self.is_reviewed = is_reviewed
-
- @property
- def id(self):
- """Gets the id of this Segment. # noqa: E501
-
- A unique number identifying the Segment. # noqa: E501
-
- :return: The id of this Segment. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this Segment.
-
- A unique number identifying the Segment. # noqa: E501
-
- :param id: The id of this Segment. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def created_at(self):
- """Gets the created_at of this Segment. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The created_at of this Segment. # noqa: E501
- :rtype: int
- """
- return self._created_at
-
- @created_at.setter
- def created_at(self, created_at):
- """Sets the created_at of this Segment.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param created_at: The created_at of this Segment. # noqa: E501
- :type: int
- """
-
- self._created_at = created_at
-
- @property
- def updated_at(self):
- """Gets the updated_at of this Segment. # noqa: E501
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :return: The updated_at of this Segment. # noqa: E501
- :rtype: int
- """
- return self._updated_at
-
- @updated_at.setter
- def updated_at(self, updated_at):
- """Sets the updated_at of this Segment.
-
- Time at which the object was created. Measured in seconds since the Unix epoch. # noqa: E501
-
- :param updated_at: The updated_at of this Segment. # noqa: E501
- :type: int
- """
-
- self._updated_at = updated_at
-
- @property
- def document_id(self):
- """Gets the document_id of this Segment. # noqa: E501
-
- A unique Document identifier. # noqa: E501
-
- :return: The document_id of this Segment. # noqa: E501
- :rtype: int
- """
- return self._document_id
-
- @document_id.setter
- def document_id(self, document_id):
- """Sets the document_id of this Segment.
-
- A unique Document identifier. # noqa: E501
-
- :param document_id: The document_id of this Segment. # noqa: E501
- :type: int
- """
-
- self._document_id = document_id
-
- @property
- def memory_id(self):
- """Gets the memory_id of this Segment. # noqa: E501
-
- The Memory with which this Segment is associated. # noqa: E501
-
- :return: The memory_id of this Segment. # noqa: E501
- :rtype: int
- """
- return self._memory_id
-
- @memory_id.setter
- def memory_id(self, memory_id):
- """Sets the memory_id of this Segment.
-
- The Memory with which this Segment is associated. # noqa: E501
-
- :param memory_id: The memory_id of this Segment. # noqa: E501
- :type: int
- """
-
- self._memory_id = memory_id
-
- @property
- def source(self):
- """Gets the source of this Segment. # noqa: E501
-
- The source string. # noqa: E501
-
- :return: The source of this Segment. # noqa: E501
- :rtype: str
- """
- return self._source
-
- @source.setter
- def source(self, source):
- """Sets the source of this Segment.
-
- The source string. # noqa: E501
-
- :param source: The source of this Segment. # noqa: E501
- :type: str
- """
-
- self._source = source
-
- @property
- def srclang(self):
- """Gets the srclang of this Segment. # noqa: E501
-
- An ISO 639-1 language code. # noqa: E501
-
- :return: The srclang of this Segment. # noqa: E501
- :rtype: str
- """
- return self._srclang
-
- @srclang.setter
- def srclang(self, srclang):
- """Sets the srclang of this Segment.
-
- An ISO 639-1 language code. # noqa: E501
-
- :param srclang: The srclang of this Segment. # noqa: E501
- :type: str
- """
-
- self._srclang = srclang
-
- @property
- def target(self):
- """Gets the target of this Segment. # noqa: E501
-
- The target string. # noqa: E501
-
- :return: The target of this Segment. # noqa: E501
- :rtype: str
- """
- return self._target
-
- @target.setter
- def target(self, target):
- """Sets the target of this Segment.
-
- The target string. # noqa: E501
-
- :param target: The target of this Segment. # noqa: E501
- :type: str
- """
-
- self._target = target
-
- @property
- def trglang(self):
- """Gets the trglang of this Segment. # noqa: E501
-
- An ISO 639-1 language code. # noqa: E501
-
- :return: The trglang of this Segment. # noqa: E501
- :rtype: str
- """
- return self._trglang
-
- @trglang.setter
- def trglang(self, trglang):
- """Sets the trglang of this Segment.
-
- An ISO 639-1 language code. # noqa: E501
-
- :param trglang: The trglang of this Segment. # noqa: E501
- :type: str
- """
-
- self._trglang = trglang
-
- @property
- def is_confirmed(self):
- """Gets the is_confirmed of this Segment. # noqa: E501
-
- The confirmation status. # noqa: E501
-
- :return: The is_confirmed of this Segment. # noqa: E501
- :rtype: bool
- """
- return self._is_confirmed
-
- @is_confirmed.setter
- def is_confirmed(self, is_confirmed):
- """Sets the is_confirmed of this Segment.
-
- The confirmation status. # noqa: E501
-
- :param is_confirmed: The is_confirmed of this Segment. # noqa: E501
- :type: bool
- """
-
- self._is_confirmed = is_confirmed
-
- @property
- def is_reviewed(self):
- """Gets the is_reviewed of this Segment. # noqa: E501
-
- The review status. # noqa: E501
-
- :return: The is_reviewed of this Segment. # noqa: E501
- :rtype: bool
- """
- return self._is_reviewed
-
- @is_reviewed.setter
- def is_reviewed(self, is_reviewed):
- """Sets the is_reviewed of this Segment.
-
- The review status. # noqa: E501
-
- :param is_reviewed: The is_reviewed of this Segment. # noqa: E501
- :type: bool
- """
-
- self._is_reviewed = is_reviewed
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, Segment):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, Segment):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/sign_lilt_create_terms_response.py b/lilt/models/sign_lilt_create_terms_response.py
index ed80dd9..cd71396 100644
--- a/lilt/models/sign_lilt_create_terms_response.py
+++ b/lilt/models/sign_lilt_create_terms_response.py
@@ -3,120 +3,85 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class SignLiltCreateTermsResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
+from pydantic import BaseModel, ConfigDict, Field, StrictBool
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
- Do not edit the class manually.
+class SignLiltCreateTermsResponse(BaseModel):
"""
+ SignLiltCreateTermsResponse
+ """ # noqa: E501
+ signed_agreement: Optional[StrictBool] = Field(default=None, description="Whether or not the agreement has been signed.", alias="signedAgreement")
+ __properties: ClassVar[List[str]] = ["signedAgreement"]
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'signed_agreement': 'bool'
- }
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
- attribute_map = {
- 'signed_agreement': 'signedAgreement'
- }
- def __init__(self, signed_agreement=None, local_vars_configuration=None): # noqa: E501
- """SignLiltCreateTermsResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
- self._signed_agreement = None
- self.discriminator = None
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
- if signed_agreement is not None:
- self.signed_agreement = signed_agreement
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of SignLiltCreateTermsResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
- @property
- def signed_agreement(self):
- """Gets the signed_agreement of this SignLiltCreateTermsResponse. # noqa: E501
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
- Whether or not the agreement has been signed. # noqa: E501
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
- :return: The signed_agreement of this SignLiltCreateTermsResponse. # noqa: E501
- :rtype: bool
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._signed_agreement
+ excluded_fields: Set[str] = set([
+ ])
- @signed_agreement.setter
- def signed_agreement(self, signed_agreement):
- """Sets the signed_agreement of this SignLiltCreateTermsResponse.
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- Whether or not the agreement has been signed. # noqa: E501
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of SignLiltCreateTermsResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "signedAgreement": obj.get("signedAgreement")
+ })
+ return _obj
- :param signed_agreement: The signed_agreement of this SignLiltCreateTermsResponse. # noqa: E501
- :type: bool
- """
- self._signed_agreement = signed_agreement
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, SignLiltCreateTermsResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, SignLiltCreateTermsResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/source_file.py b/lilt/models/source_file.py
index fdac161..2f13e17 100644
--- a/lilt/models/source_file.py
+++ b/lilt/models/source_file.py
@@ -3,344 +3,102 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional, Union
+from typing import Optional, Set
+from typing_extensions import Self
-
-class SourceFile(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class SourceFile(BaseModel):
"""
+ A SourceFile is an unprocessed source file that can later be added to a project.
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique number identifying the SourceFile.")
+ name: Optional[StrictStr] = Field(default=None, description="The file name.")
+ file_hash: Optional[StrictStr] = Field(default=None, description="A unique hash value associated with the file. An MD5 hash of the file content will be used by default.")
+ detected_lang: Optional[StrictStr] = Field(default=None, description="Language associated with the file.")
+ detected_lang_confidence: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Confidence score for the language associated with the file.")
+ category: Optional[StrictStr] = Field(default=None, description="The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.")
+ labels: Optional[List[StrictStr]] = Field(default=None, description="The list of labels associated with the file.")
+ created_at: Optional[datetime] = Field(default=None, description="Time at which the object was created.")
+ updated_at: Optional[datetime] = Field(default=None, description="Time at which the object was created.")
+ __properties: ClassVar[List[str]] = ["id", "name", "file_hash", "detected_lang", "detected_lang_confidence", "category", "labels", "created_at", "updated_at"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of SourceFile from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of SourceFile from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "file_hash": obj.get("file_hash"),
+ "detected_lang": obj.get("detected_lang"),
+ "detected_lang_confidence": obj.get("detected_lang_confidence"),
+ "category": obj.get("category"),
+ "labels": obj.get("labels"),
+ "created_at": obj.get("created_at"),
+ "updated_at": obj.get("updated_at")
+ })
+ return _obj
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'name': 'str',
- 'file_hash': 'str',
- 'detected_lang': 'str',
- 'detected_lang_confidence': 'float',
- 'category': 'str',
- 'labels': 'list[str]',
- 'created_at': 'datetime',
- 'updated_at': 'datetime'
- }
-
- attribute_map = {
- 'id': 'id',
- 'name': 'name',
- 'file_hash': 'file_hash',
- 'detected_lang': 'detected_lang',
- 'detected_lang_confidence': 'detected_lang_confidence',
- 'category': 'category',
- 'labels': 'labels',
- 'created_at': 'created_at',
- 'updated_at': 'updated_at'
- }
-
- def __init__(self, id=None, name=None, file_hash=None, detected_lang=None, detected_lang_confidence=None, category=None, labels=None, created_at=None, updated_at=None, local_vars_configuration=None): # noqa: E501
- """SourceFile - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._name = None
- self._file_hash = None
- self._detected_lang = None
- self._detected_lang_confidence = None
- self._category = None
- self._labels = None
- self._created_at = None
- self._updated_at = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if name is not None:
- self.name = name
- if file_hash is not None:
- self.file_hash = file_hash
- if detected_lang is not None:
- self.detected_lang = detected_lang
- if detected_lang_confidence is not None:
- self.detected_lang_confidence = detected_lang_confidence
- if category is not None:
- self.category = category
- if labels is not None:
- self.labels = labels
- if created_at is not None:
- self.created_at = created_at
- if updated_at is not None:
- self.updated_at = updated_at
-
- @property
- def id(self):
- """Gets the id of this SourceFile. # noqa: E501
-
- A unique number identifying the SourceFile. # noqa: E501
-
- :return: The id of this SourceFile. # noqa: E501
- :rtype: int
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this SourceFile.
-
- A unique number identifying the SourceFile. # noqa: E501
-
- :param id: The id of this SourceFile. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def name(self):
- """Gets the name of this SourceFile. # noqa: E501
-
- The file name. # noqa: E501
-
- :return: The name of this SourceFile. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this SourceFile.
-
- The file name. # noqa: E501
-
- :param name: The name of this SourceFile. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def file_hash(self):
- """Gets the file_hash of this SourceFile. # noqa: E501
-
- A unique hash value associated with the file. An MD5 hash of the file content will be used by default. # noqa: E501
-
- :return: The file_hash of this SourceFile. # noqa: E501
- :rtype: str
- """
- return self._file_hash
-
- @file_hash.setter
- def file_hash(self, file_hash):
- """Sets the file_hash of this SourceFile.
-
- A unique hash value associated with the file. An MD5 hash of the file content will be used by default. # noqa: E501
-
- :param file_hash: The file_hash of this SourceFile. # noqa: E501
- :type: str
- """
-
- self._file_hash = file_hash
-
- @property
- def detected_lang(self):
- """Gets the detected_lang of this SourceFile. # noqa: E501
-
- Language associated with the file. # noqa: E501
-
- :return: The detected_lang of this SourceFile. # noqa: E501
- :rtype: str
- """
- return self._detected_lang
-
- @detected_lang.setter
- def detected_lang(self, detected_lang):
- """Sets the detected_lang of this SourceFile.
-
- Language associated with the file. # noqa: E501
-
- :param detected_lang: The detected_lang of this SourceFile. # noqa: E501
- :type: str
- """
-
- self._detected_lang = detected_lang
-
- @property
- def detected_lang_confidence(self):
- """Gets the detected_lang_confidence of this SourceFile. # noqa: E501
-
- Confidence score for the language associated with the file. # noqa: E501
-
- :return: The detected_lang_confidence of this SourceFile. # noqa: E501
- :rtype: float
- """
- return self._detected_lang_confidence
-
- @detected_lang_confidence.setter
- def detected_lang_confidence(self, detected_lang_confidence):
- """Sets the detected_lang_confidence of this SourceFile.
-
- Confidence score for the language associated with the file. # noqa: E501
-
- :param detected_lang_confidence: The detected_lang_confidence of this SourceFile. # noqa: E501
- :type: float
- """
-
- self._detected_lang_confidence = detected_lang_confidence
-
- @property
- def category(self):
- """Gets the category of this SourceFile. # noqa: E501
-
- The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material. # noqa: E501
-
- :return: The category of this SourceFile. # noqa: E501
- :rtype: str
- """
- return self._category
-
- @category.setter
- def category(self, category):
- """Sets the category of this SourceFile.
-
- The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material. # noqa: E501
-
- :param category: The category of this SourceFile. # noqa: E501
- :type: str
- """
-
- self._category = category
-
- @property
- def labels(self):
- """Gets the labels of this SourceFile. # noqa: E501
-
- The list of labels associated with the file. # noqa: E501
-
- :return: The labels of this SourceFile. # noqa: E501
- :rtype: list[str]
- """
- return self._labels
-
- @labels.setter
- def labels(self, labels):
- """Sets the labels of this SourceFile.
-
- The list of labels associated with the file. # noqa: E501
-
- :param labels: The labels of this SourceFile. # noqa: E501
- :type: list[str]
- """
-
- self._labels = labels
-
- @property
- def created_at(self):
- """Gets the created_at of this SourceFile. # noqa: E501
-
- Time at which the object was created. # noqa: E501
-
- :return: The created_at of this SourceFile. # noqa: E501
- :rtype: datetime
- """
- return self._created_at
-
- @created_at.setter
- def created_at(self, created_at):
- """Sets the created_at of this SourceFile.
-
- Time at which the object was created. # noqa: E501
-
- :param created_at: The created_at of this SourceFile. # noqa: E501
- :type: datetime
- """
-
- self._created_at = created_at
-
- @property
- def updated_at(self):
- """Gets the updated_at of this SourceFile. # noqa: E501
-
- Time at which the object was created. # noqa: E501
-
- :return: The updated_at of this SourceFile. # noqa: E501
- :rtype: datetime
- """
- return self._updated_at
-
- @updated_at.setter
- def updated_at(self, updated_at):
- """Sets the updated_at of this SourceFile.
-
- Time at which the object was created. # noqa: E501
-
- :param updated_at: The updated_at of this SourceFile. # noqa: E501
- :type: datetime
- """
-
- self._updated_at = updated_at
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, SourceFile):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, SourceFile):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/termbase_export_response.py b/lilt/models/termbase_export_response.py
index c39c3de..4ffae4b 100644
--- a/lilt/models/termbase_export_response.py
+++ b/lilt/models/termbase_export_response.py
@@ -3,148 +3,87 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class TermbaseExportResponse(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class TermbaseExportResponse(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'is_processing': 'int'
- }
-
- attribute_map = {
- 'id': 'id',
- 'is_processing': 'is_processing'
- }
-
- def __init__(self, id=None, is_processing=None, local_vars_configuration=None): # noqa: E501
- """TermbaseExportResponse - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._is_processing = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if is_processing is not None:
- self.is_processing = is_processing
-
- @property
- def id(self):
- """Gets the id of this TermbaseExportResponse. # noqa: E501
-
- A unique Memory identifier. # noqa: E501
-
- :return: The id of this TermbaseExportResponse. # noqa: E501
- :rtype: int
+ TermbaseExportResponse
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="A unique Memory identifier.")
+ is_processing: Optional[StrictInt] = Field(default=None, description="The current state of the import.")
+ __properties: ClassVar[List[str]] = ["id", "is_processing"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TermbaseExportResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this TermbaseExportResponse.
+ excluded_fields: Set[str] = set([
+ ])
- A unique Memory identifier. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- :param id: The id of this TermbaseExportResponse. # noqa: E501
- :type: int
- """
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TermbaseExportResponse from a dict"""
+ if obj is None:
+ return None
- self._id = id
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @property
- def is_processing(self):
- """Gets the is_processing of this TermbaseExportResponse. # noqa: E501
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "is_processing": obj.get("is_processing")
+ })
+ return _obj
- The current state of the import. # noqa: E501
-
- :return: The is_processing of this TermbaseExportResponse. # noqa: E501
- :rtype: int
- """
- return self._is_processing
-
- @is_processing.setter
- def is_processing(self, is_processing):
- """Sets the is_processing of this TermbaseExportResponse.
-
- The current state of the import. # noqa: E501
-
- :param is_processing: The is_processing of this TermbaseExportResponse. # noqa: E501
- :type: int
- """
- self._is_processing = is_processing
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, TermbaseExportResponse):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, TermbaseExportResponse):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/translate_segment_body.py b/lilt/models/translate_segment_body.py
index e807f04..fc8cb14 100644
--- a/lilt/models/translate_segment_body.py
+++ b/lilt/models/translate_segment_body.py
@@ -3,345 +3,101 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-
-class TranslateSegmentBody(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class TranslateSegmentBody(BaseModel):
"""
+ TranslateSegmentBody
+ """ # noqa: E501
+ source: Optional[StrictStr] = Field(default=None, description="A unique Segment identifier.")
+ memory_id: StrictInt = Field(description="A unique Memory identifier.")
+ source_hash: Optional[StrictInt] = Field(default=None, description="A source hash code.")
+ n: Optional[StrictInt] = Field(default=None, description="Return top n translations (deprecated).")
+ prefix: Optional[StrictStr] = Field(default=None, description="A target prefix")
+ rich: Optional[StrictBool] = Field(default=False, description="Returns rich translation information (e.g., with word alignments).")
+ tm_matches: Optional[StrictBool] = Field(default=True, description="Include translation memory fuzzy matches.")
+ project_tags: Optional[StrictBool] = Field(default=False, description="Project tags. Projects tags in source to target if set to true.")
+ contains_icu_data: Optional[StrictBool] = Field(default=False, description="Contains ICU data. If true then tags in the source following the ICU standard will be parsed and retained.", alias="containsICUData")
+ __properties: ClassVar[List[str]] = ["source", "memory_id", "source_hash", "n", "prefix", "rich", "tm_matches", "project_tags", "containsICUData"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TranslateSegmentBody from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TranslateSegmentBody from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "source": obj.get("source"),
+ "memory_id": obj.get("memory_id"),
+ "source_hash": obj.get("source_hash"),
+ "n": obj.get("n"),
+ "prefix": obj.get("prefix"),
+ "rich": obj.get("rich") if obj.get("rich") is not None else False,
+ "tm_matches": obj.get("tm_matches") if obj.get("tm_matches") is not None else True,
+ "project_tags": obj.get("project_tags") if obj.get("project_tags") is not None else False,
+ "containsICUData": obj.get("containsICUData") if obj.get("containsICUData") is not None else False
+ })
+ return _obj
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'source': 'str',
- 'memory_id': 'int',
- 'source_hash': 'int',
- 'n': 'int',
- 'prefix': 'str',
- 'rich': 'bool',
- 'tm_matches': 'bool',
- 'project_tags': 'bool',
- 'contains_icu_data': 'bool'
- }
-
- attribute_map = {
- 'source': 'source',
- 'memory_id': 'memory_id',
- 'source_hash': 'source_hash',
- 'n': 'n',
- 'prefix': 'prefix',
- 'rich': 'rich',
- 'tm_matches': 'tm_matches',
- 'project_tags': 'project_tags',
- 'contains_icu_data': 'containsICUData'
- }
-
- def __init__(self, source=None, memory_id=None, source_hash=None, n=None, prefix=None, rich=False, tm_matches=True, project_tags=False, contains_icu_data=False, local_vars_configuration=None): # noqa: E501
- """TranslateSegmentBody - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._source = None
- self._memory_id = None
- self._source_hash = None
- self._n = None
- self._prefix = None
- self._rich = None
- self._tm_matches = None
- self._project_tags = None
- self._contains_icu_data = None
- self.discriminator = None
-
- if source is not None:
- self.source = source
- self.memory_id = memory_id
- if source_hash is not None:
- self.source_hash = source_hash
- if n is not None:
- self.n = n
- if prefix is not None:
- self.prefix = prefix
- if rich is not None:
- self.rich = rich
- if tm_matches is not None:
- self.tm_matches = tm_matches
- if project_tags is not None:
- self.project_tags = project_tags
- if contains_icu_data is not None:
- self.contains_icu_data = contains_icu_data
-
- @property
- def source(self):
- """Gets the source of this TranslateSegmentBody. # noqa: E501
-
- A unique Segment identifier. # noqa: E501
-
- :return: The source of this TranslateSegmentBody. # noqa: E501
- :rtype: str
- """
- return self._source
-
- @source.setter
- def source(self, source):
- """Sets the source of this TranslateSegmentBody.
-
- A unique Segment identifier. # noqa: E501
-
- :param source: The source of this TranslateSegmentBody. # noqa: E501
- :type: str
- """
-
- self._source = source
-
- @property
- def memory_id(self):
- """Gets the memory_id of this TranslateSegmentBody. # noqa: E501
-
- A unique Memory identifier. # noqa: E501
-
- :return: The memory_id of this TranslateSegmentBody. # noqa: E501
- :rtype: int
- """
- return self._memory_id
-
- @memory_id.setter
- def memory_id(self, memory_id):
- """Sets the memory_id of this TranslateSegmentBody.
-
- A unique Memory identifier. # noqa: E501
-
- :param memory_id: The memory_id of this TranslateSegmentBody. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and memory_id is None: # noqa: E501
- raise ValueError("Invalid value for `memory_id`, must not be `None`") # noqa: E501
-
- self._memory_id = memory_id
-
- @property
- def source_hash(self):
- """Gets the source_hash of this TranslateSegmentBody. # noqa: E501
-
- A source hash code. # noqa: E501
-
- :return: The source_hash of this TranslateSegmentBody. # noqa: E501
- :rtype: int
- """
- return self._source_hash
-
- @source_hash.setter
- def source_hash(self, source_hash):
- """Sets the source_hash of this TranslateSegmentBody.
-
- A source hash code. # noqa: E501
-
- :param source_hash: The source_hash of this TranslateSegmentBody. # noqa: E501
- :type: int
- """
-
- self._source_hash = source_hash
-
- @property
- def n(self):
- """Gets the n of this TranslateSegmentBody. # noqa: E501
-
- Return top n translations (deprecated). # noqa: E501
-
- :return: The n of this TranslateSegmentBody. # noqa: E501
- :rtype: int
- """
- return self._n
-
- @n.setter
- def n(self, n):
- """Sets the n of this TranslateSegmentBody.
-
- Return top n translations (deprecated). # noqa: E501
-
- :param n: The n of this TranslateSegmentBody. # noqa: E501
- :type: int
- """
-
- self._n = n
-
- @property
- def prefix(self):
- """Gets the prefix of this TranslateSegmentBody. # noqa: E501
-
- A target prefix # noqa: E501
-
- :return: The prefix of this TranslateSegmentBody. # noqa: E501
- :rtype: str
- """
- return self._prefix
-
- @prefix.setter
- def prefix(self, prefix):
- """Sets the prefix of this TranslateSegmentBody.
-
- A target prefix # noqa: E501
-
- :param prefix: The prefix of this TranslateSegmentBody. # noqa: E501
- :type: str
- """
-
- self._prefix = prefix
-
- @property
- def rich(self):
- """Gets the rich of this TranslateSegmentBody. # noqa: E501
-
- Returns rich translation information (e.g., with word alignments). # noqa: E501
-
- :return: The rich of this TranslateSegmentBody. # noqa: E501
- :rtype: bool
- """
- return self._rich
-
- @rich.setter
- def rich(self, rich):
- """Sets the rich of this TranslateSegmentBody.
-
- Returns rich translation information (e.g., with word alignments). # noqa: E501
-
- :param rich: The rich of this TranslateSegmentBody. # noqa: E501
- :type: bool
- """
-
- self._rich = rich
-
- @property
- def tm_matches(self):
- """Gets the tm_matches of this TranslateSegmentBody. # noqa: E501
-
- Include translation memory fuzzy matches. # noqa: E501
-
- :return: The tm_matches of this TranslateSegmentBody. # noqa: E501
- :rtype: bool
- """
- return self._tm_matches
-
- @tm_matches.setter
- def tm_matches(self, tm_matches):
- """Sets the tm_matches of this TranslateSegmentBody.
-
- Include translation memory fuzzy matches. # noqa: E501
-
- :param tm_matches: The tm_matches of this TranslateSegmentBody. # noqa: E501
- :type: bool
- """
-
- self._tm_matches = tm_matches
-
- @property
- def project_tags(self):
- """Gets the project_tags of this TranslateSegmentBody. # noqa: E501
-
- Project tags. Projects tags in source to target if set to true. # noqa: E501
-
- :return: The project_tags of this TranslateSegmentBody. # noqa: E501
- :rtype: bool
- """
- return self._project_tags
-
- @project_tags.setter
- def project_tags(self, project_tags):
- """Sets the project_tags of this TranslateSegmentBody.
-
- Project tags. Projects tags in source to target if set to true. # noqa: E501
-
- :param project_tags: The project_tags of this TranslateSegmentBody. # noqa: E501
- :type: bool
- """
-
- self._project_tags = project_tags
-
- @property
- def contains_icu_data(self):
- """Gets the contains_icu_data of this TranslateSegmentBody. # noqa: E501
-
- Contains ICU data. If true then tags in the source following the ICU standard will be parsed and retained. # noqa: E501
-
- :return: The contains_icu_data of this TranslateSegmentBody. # noqa: E501
- :rtype: bool
- """
- return self._contains_icu_data
-
- @contains_icu_data.setter
- def contains_icu_data(self, contains_icu_data):
- """Sets the contains_icu_data of this TranslateSegmentBody.
-
- Contains ICU data. If true then tags in the source following the ICU standard will be parsed and retained. # noqa: E501
-
- :param contains_icu_data: The contains_icu_data of this TranslateSegmentBody. # noqa: E501
- :type: bool
- """
-
- self._contains_icu_data = contains_icu_data
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, TranslateSegmentBody):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, TranslateSegmentBody):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/translation.py b/lilt/models/translation.py
index a5c7197..8734371 100644
--- a/lilt/models/translation.py
+++ b/lilt/models/translation.py
@@ -3,316 +3,99 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class Translation(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional, Union
+from typing import Optional, Set
+from typing_extensions import Self
+class Translation(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'target': 'str',
- 'target_with_tags': 'str',
- 'align': 'str',
- 'provenance': 'str',
- 'score': 'float',
- 'is_tm_match': 'bool',
- 'target_delimiters': 'list[str]',
- 'target_words': 'list[str]'
- }
-
- attribute_map = {
- 'target': 'target',
- 'target_with_tags': 'targetWithTags',
- 'align': 'align',
- 'provenance': 'provenance',
- 'score': 'score',
- 'is_tm_match': 'isTMMatch',
- 'target_delimiters': 'targetDelimiters',
- 'target_words': 'targetWords'
- }
-
- def __init__(self, target=None, target_with_tags=None, align=None, provenance=None, score=None, is_tm_match=None, target_delimiters=None, target_words=None, local_vars_configuration=None): # noqa: E501
- """Translation - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._target = None
- self._target_with_tags = None
- self._align = None
- self._provenance = None
- self._score = None
- self._is_tm_match = None
- self._target_delimiters = None
- self._target_words = None
- self.discriminator = None
-
- if target is not None:
- self.target = target
- if target_with_tags is not None:
- self.target_with_tags = target_with_tags
- if align is not None:
- self.align = align
- if provenance is not None:
- self.provenance = provenance
- if score is not None:
- self.score = score
- if is_tm_match is not None:
- self.is_tm_match = is_tm_match
- if target_delimiters is not None:
- self.target_delimiters = target_delimiters
- if target_words is not None:
- self.target_words = target_words
-
- @property
- def target(self):
- """Gets the target of this Translation. # noqa: E501
-
- The target string. # noqa: E501
-
- :return: The target of this Translation. # noqa: E501
- :rtype: str
- """
- return self._target
-
- @target.setter
- def target(self, target):
- """Sets the target of this Translation.
-
- The target string. # noqa: E501
-
- :param target: The target of this Translation. # noqa: E501
- :type: str
- """
-
- self._target = target
-
- @property
- def target_with_tags(self):
- """Gets the target_with_tags of this Translation. # noqa: E501
-
- The target string with source tags projected into the target. # noqa: E501
-
- :return: The target_with_tags of this Translation. # noqa: E501
- :rtype: str
- """
- return self._target_with_tags
-
- @target_with_tags.setter
- def target_with_tags(self, target_with_tags):
- """Sets the target_with_tags of this Translation.
-
- The target string with source tags projected into the target. # noqa: E501
-
- :param target_with_tags: The target_with_tags of this Translation. # noqa: E501
- :type: str
- """
-
- self._target_with_tags = target_with_tags
-
- @property
- def align(self):
- """Gets the align of this Translation. # noqa: E501
-
- \"MT only: A whitespace delimited list of source-target alignment indices.\" # noqa: E501
-
- :return: The align of this Translation. # noqa: E501
- :rtype: str
- """
- return self._align
-
- @align.setter
- def align(self, align):
- """Sets the align of this Translation.
-
- \"MT only: A whitespace delimited list of source-target alignment indices.\" # noqa: E501
-
- :param align: The align of this Translation. # noqa: E501
- :type: str
- """
-
- self._align = align
-
- @property
- def provenance(self):
- """Gets the provenance of this Translation. # noqa: E501
-
- Positive values indicate that the word is from the Memory, with contiguous identical entries (e.g., 2 2) indicating phrase matches. Negative contiguous values indicate entries from the Lexicon. 0 indicates a word from the background data. # noqa: E501
-
- :return: The provenance of this Translation. # noqa: E501
- :rtype: str
- """
- return self._provenance
-
- @provenance.setter
- def provenance(self, provenance):
- """Sets the provenance of this Translation.
-
- Positive values indicate that the word is from the Memory, with contiguous identical entries (e.g., 2 2) indicating phrase matches. Negative contiguous values indicate entries from the Lexicon. 0 indicates a word from the background data. # noqa: E501
-
- :param provenance: The provenance of this Translation. # noqa: E501
- :type: str
- """
-
- self._provenance = provenance
-
- @property
- def score(self):
- """Gets the score of this Translation. # noqa: E501
-
- The score of the translation. # noqa: E501
-
- :return: The score of this Translation. # noqa: E501
- :rtype: float
- """
- return self._score
-
- @score.setter
- def score(self, score):
- """Sets the score of this Translation.
-
- The score of the translation. # noqa: E501
-
- :param score: The score of this Translation. # noqa: E501
- :type: float
- """
-
- self._score = score
-
- @property
- def is_tm_match(self):
- """Gets the is_tm_match of this Translation. # noqa: E501
-
- TM only: If true, indicates an exact translation memory match. # noqa: E501
-
- :return: The is_tm_match of this Translation. # noqa: E501
- :rtype: bool
- """
- return self._is_tm_match
-
- @is_tm_match.setter
- def is_tm_match(self, is_tm_match):
- """Sets the is_tm_match of this Translation.
-
- TM only: If true, indicates an exact translation memory match. # noqa: E501
-
- :param is_tm_match: The is_tm_match of this Translation. # noqa: E501
- :type: bool
- """
-
- self._is_tm_match = is_tm_match
-
- @property
- def target_delimiters(self):
- """Gets the target_delimiters of this Translation. # noqa: E501
-
- A format string that indicates, for each word, if the word should be preceded by a space. # noqa: E501
-
- :return: The target_delimiters of this Translation. # noqa: E501
- :rtype: list[str]
- """
- return self._target_delimiters
-
- @target_delimiters.setter
- def target_delimiters(self, target_delimiters):
- """Sets the target_delimiters of this Translation.
-
- A format string that indicates, for each word, if the word should be preceded by a space. # noqa: E501
-
- :param target_delimiters: The target_delimiters of this Translation. # noqa: E501
- :type: list[str]
- """
-
- self._target_delimiters = target_delimiters
-
- @property
- def target_words(self):
- """Gets the target_words of this Translation. # noqa: E501
-
- The target string can be constructed by suffixing each `targetDelimiters` entry with its corresponding word in `targetWords` and concatenating the constructed array. Please note that the `targetDelimiters` array has one more entry than `targetWords` array which is why the last entry in the array will be the last value of `targetDelimiters`. # noqa: E501
-
- :return: The target_words of this Translation. # noqa: E501
- :rtype: list[str]
- """
- return self._target_words
-
- @target_words.setter
- def target_words(self, target_words):
- """Sets the target_words of this Translation.
-
- The target string can be constructed by suffixing each `targetDelimiters` entry with its corresponding word in `targetWords` and concatenating the constructed array. Please note that the `targetDelimiters` array has one more entry than `targetWords` array which is why the last entry in the array will be the last value of `targetDelimiters`. # noqa: E501
-
- :param target_words: The target_words of this Translation. # noqa: E501
- :type: list[str]
- """
-
- self._target_words = target_words
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, Translation):
- return False
-
- return self.to_dict() == other.to_dict()
+ A machine translation (MT) or a translation memory (TM) match of a source segment.
+ """ # noqa: E501
+ target: Optional[StrictStr] = Field(default=None, description="The target string.")
+ target_with_tags: Optional[StrictStr] = Field(default=None, description="The target string with source tags projected into the target.", alias="targetWithTags")
+ align: Optional[StrictStr] = Field(default=None, description="\"MT only: A whitespace delimited list of source-target alignment indices.\" ")
+ provenance: Optional[StrictStr] = Field(default=None, description="Positive values indicate that the word is from the Memory, with contiguous identical entries (e.g., 2 2) indicating phrase matches. Negative contiguous values indicate entries from the Lexicon. 0 indicates a word from the background data. ")
+ score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The score of the translation.")
+ is_tm_match: Optional[StrictBool] = Field(default=None, description="TM only: If true, indicates an exact translation memory match.", alias="isTMMatch")
+ target_delimiters: Optional[List[StrictStr]] = Field(default=None, description="A format string that indicates, for each word, if the word should be preceded by a space.", alias="targetDelimiters")
+ target_words: Optional[List[StrictStr]] = Field(default=None, description="The target string can be constructed by suffixing each `targetDelimiters` entry with its corresponding word in `targetWords` and concatenating the constructed array. Please note that the `targetDelimiters` array has one more entry than `targetWords` array which is why the last entry in the array will be the last value of `targetDelimiters`. ", alias="targetWords")
+ __properties: ClassVar[List[str]] = ["target", "targetWithTags", "align", "provenance", "score", "isTMMatch", "targetDelimiters", "targetWords"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Translation from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Translation from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "target": obj.get("target"),
+ "targetWithTags": obj.get("targetWithTags"),
+ "align": obj.get("align"),
+ "provenance": obj.get("provenance"),
+ "score": obj.get("score"),
+ "isTMMatch": obj.get("isTMMatch"),
+ "targetDelimiters": obj.get("targetDelimiters"),
+ "targetWords": obj.get("targetWords")
+ })
+ return _obj
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, Translation):
- return True
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/translation_info.py b/lilt/models/translation_info.py
index 226b2ff..89f14c6 100644
--- a/lilt/models/translation_info.py
+++ b/lilt/models/translation_info.py
@@ -3,232 +3,93 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-
-class TranslationInfo(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
+class TranslationInfo(BaseModel):
"""
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'id': 'int',
- 'file_id': 'int',
- 'status': 'str',
- 'created_at': 'int',
- 'error_msg': 'str'
- }
-
- attribute_map = {
- 'id': 'id',
- 'file_id': 'fileId',
- 'status': 'status',
- 'created_at': 'createdAt',
- 'error_msg': 'errorMsg'
- }
-
- def __init__(self, id=None, file_id=None, status=None, created_at=None, error_msg=None, local_vars_configuration=None): # noqa: E501
- """TranslationInfo - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._file_id = None
- self._status = None
- self._created_at = None
- self._error_msg = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if file_id is not None:
- self.file_id = file_id
- if status is not None:
- self.status = status
- if created_at is not None:
- self.created_at = created_at
- if error_msg is not None:
- self.error_msg = error_msg
-
- @property
- def id(self):
- """Gets the id of this TranslationInfo. # noqa: E501
-
- Unique identifier for this translation. # noqa: E501
-
- :return: The id of this TranslationInfo. # noqa: E501
- :rtype: int
+ Information describing a batch translation process.
+ """ # noqa: E501
+ id: Optional[StrictInt] = Field(default=None, description="Unique identifier for this translation.")
+ file_id: Optional[StrictInt] = Field(default=None, description="id of the File that is being translated.", alias="fileId")
+ status: Optional[StrictStr] = Field(default=None, description="Status of the translation - `InProgress`, `ReadyForDownload`, `Completed`, `Failed`.")
+ created_at: Optional[StrictInt] = Field(default=None, description="Time when this translation was started, in seconds since the Unix epoch.", alias="createdAt")
+ error_msg: Optional[StrictStr] = Field(default=None, description="Error message, present when status is `Failed`.", alias="errorMsg")
+ __properties: ClassVar[List[str]] = ["id", "fileId", "status", "createdAt", "errorMsg"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TranslationInfo from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this TranslationInfo.
-
- Unique identifier for this translation. # noqa: E501
-
- :param id: The id of this TranslationInfo. # noqa: E501
- :type: int
- """
-
- self._id = id
-
- @property
- def file_id(self):
- """Gets the file_id of this TranslationInfo. # noqa: E501
-
- id of the File that is being translated. # noqa: E501
-
- :return: The file_id of this TranslationInfo. # noqa: E501
- :rtype: int
- """
- return self._file_id
-
- @file_id.setter
- def file_id(self, file_id):
- """Sets the file_id of this TranslationInfo.
-
- id of the File that is being translated. # noqa: E501
-
- :param file_id: The file_id of this TranslationInfo. # noqa: E501
- :type: int
- """
-
- self._file_id = file_id
-
- @property
- def status(self):
- """Gets the status of this TranslationInfo. # noqa: E501
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TranslationInfo from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "fileId": obj.get("fileId"),
+ "status": obj.get("status"),
+ "createdAt": obj.get("createdAt"),
+ "errorMsg": obj.get("errorMsg")
+ })
+ return _obj
- Status of the translation - `InProgress`, `ReadyForDownload`, `Completed`, `Failed`. # noqa: E501
-
- :return: The status of this TranslationInfo. # noqa: E501
- :rtype: str
- """
- return self._status
-
- @status.setter
- def status(self, status):
- """Sets the status of this TranslationInfo.
-
- Status of the translation - `InProgress`, `ReadyForDownload`, `Completed`, `Failed`. # noqa: E501
-
- :param status: The status of this TranslationInfo. # noqa: E501
- :type: str
- """
-
- self._status = status
-
- @property
- def created_at(self):
- """Gets the created_at of this TranslationInfo. # noqa: E501
-
- Time when this translation was started, in seconds since the Unix epoch. # noqa: E501
-
- :return: The created_at of this TranslationInfo. # noqa: E501
- :rtype: int
- """
- return self._created_at
-
- @created_at.setter
- def created_at(self, created_at):
- """Sets the created_at of this TranslationInfo.
-
- Time when this translation was started, in seconds since the Unix epoch. # noqa: E501
-
- :param created_at: The created_at of this TranslationInfo. # noqa: E501
- :type: int
- """
-
- self._created_at = created_at
-
- @property
- def error_msg(self):
- """Gets the error_msg of this TranslationInfo. # noqa: E501
-
- Error message, present when status is `Failed`. # noqa: E501
-
- :return: The error_msg of this TranslationInfo. # noqa: E501
- :rtype: str
- """
- return self._error_msg
-
- @error_msg.setter
- def error_msg(self, error_msg):
- """Sets the error_msg of this TranslationInfo.
-
- Error message, present when status is `Failed`. # noqa: E501
-
- :param error_msg: The error_msg of this TranslationInfo. # noqa: E501
- :type: str
- """
- self._error_msg = error_msg
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, TranslationInfo):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, TranslationInfo):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/translation_list.py b/lilt/models/translation_list.py
index 88fc5de..ff8dd1e 100644
--- a/lilt/models/translation_list.py
+++ b/lilt/models/translation_list.py
@@ -3,204 +3,99 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lilt.models.translation import Translation
+from typing import Optional, Set
+from typing_extensions import Self
-class TranslationList(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
+class TranslationList(BaseModel):
"""
- openapi_types = {
- 'untokenized_source': 'str',
- 'tokenized_source': 'str',
- 'source_delimiters': 'list[str]',
- 'translation': 'list[Translation]'
- }
-
- attribute_map = {
- 'untokenized_source': 'untokenizedSource',
- 'tokenized_source': 'tokenizedSource',
- 'source_delimiters': 'sourceDelimiters',
- 'translation': 'translation'
- }
-
- def __init__(self, untokenized_source=None, tokenized_source=None, source_delimiters=None, translation=None, local_vars_configuration=None): # noqa: E501
- """TranslationList - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._untokenized_source = None
- self._tokenized_source = None
- self._source_delimiters = None
- self._translation = None
- self.discriminator = None
-
- if untokenized_source is not None:
- self.untokenized_source = untokenized_source
- if tokenized_source is not None:
- self.tokenized_source = tokenized_source
- if source_delimiters is not None:
- self.source_delimiters = source_delimiters
- if translation is not None:
- self.translation = translation
-
- @property
- def untokenized_source(self):
- """Gets the untokenized_source of this TranslationList. # noqa: E501
-
- The untokenized source segment. Punctuation has not been separated from words. # noqa: E501
-
- :return: The untokenized_source of this TranslationList. # noqa: E501
- :rtype: str
- """
- return self._untokenized_source
-
- @untokenized_source.setter
- def untokenized_source(self, untokenized_source):
- """Sets the untokenized_source of this TranslationList.
-
- The untokenized source segment. Punctuation has not been separated from words. # noqa: E501
-
- :param untokenized_source: The untokenized_source of this TranslationList. # noqa: E501
- :type: str
- """
-
- self._untokenized_source = untokenized_source
-
- @property
- def tokenized_source(self):
- """Gets the tokenized_source of this TranslationList. # noqa: E501
-
- The tokenized source segment. Punctuation has been separated from words. # noqa: E501
-
- :return: The tokenized_source of this TranslationList. # noqa: E501
- :rtype: str
- """
- return self._tokenized_source
-
- @tokenized_source.setter
- def tokenized_source(self, tokenized_source):
- """Sets the tokenized_source of this TranslationList.
-
- The tokenized source segment. Punctuation has been separated from words. # noqa: E501
-
- :param tokenized_source: The tokenized_source of this TranslationList. # noqa: E501
- :type: str
- """
-
- self._tokenized_source = tokenized_source
-
- @property
- def source_delimiters(self):
- """Gets the source_delimiters of this TranslationList. # noqa: E501
-
- A format string that indicates, for each word, if the word should be preceded by a space. # noqa: E501
-
- :return: The source_delimiters of this TranslationList. # noqa: E501
- :rtype: list[str]
- """
- return self._source_delimiters
-
- @source_delimiters.setter
- def source_delimiters(self, source_delimiters):
- """Sets the source_delimiters of this TranslationList.
-
- A format string that indicates, for each word, if the word should be preceded by a space. # noqa: E501
-
- :param source_delimiters: The source_delimiters of this TranslationList. # noqa: E501
- :type: list[str]
- """
-
- self._source_delimiters = source_delimiters
-
- @property
- def translation(self):
- """Gets the translation of this TranslationList. # noqa: E501
-
- A list of Translation objects. # noqa: E501
-
- :return: The translation of this TranslationList. # noqa: E501
- :rtype: list[Translation]
+ An ranked list of translations and associated metadata.
+ """ # noqa: E501
+ untokenized_source: Optional[StrictStr] = Field(default=None, description="The untokenized source segment. Punctuation has not been separated from words.", alias="untokenizedSource")
+ tokenized_source: Optional[StrictStr] = Field(default=None, description="The tokenized source segment. Punctuation has been separated from words.", alias="tokenizedSource")
+ source_delimiters: Optional[List[StrictStr]] = Field(default=None, description="A format string that indicates, for each word, if the word should be preceded by a space.", alias="sourceDelimiters")
+ translation: Optional[List[Translation]] = Field(default=None, description="A list of Translation objects.")
+ __properties: ClassVar[List[str]] = ["untokenizedSource", "tokenizedSource", "sourceDelimiters", "translation"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TranslationList from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._translation
-
- @translation.setter
- def translation(self, translation):
- """Sets the translation of this TranslationList.
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in translation (list)
+ _items = []
+ if self.translation:
+ for _item_translation in self.translation:
+ if _item_translation:
+ _items.append(_item_translation.to_dict())
+ _dict['translation'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TranslationList from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "untokenizedSource": obj.get("untokenizedSource"),
+ "tokenizedSource": obj.get("tokenizedSource"),
+ "sourceDelimiters": obj.get("sourceDelimiters"),
+ "translation": [Translation.from_dict(_item) for _item in obj["translation"]] if obj.get("translation") is not None else None
+ })
+ return _obj
- A list of Translation objects. # noqa: E501
-
- :param translation: The translation of this TranslationList. # noqa: E501
- :type: list[Translation]
- """
- self._translation = translation
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, TranslationList):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, TranslationList):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/translation_memory_entry.py b/lilt/models/translation_memory_entry.py
index 036fe77..d92eb8e 100644
--- a/lilt/models/translation_memory_entry.py
+++ b/lilt/models/translation_memory_entry.py
@@ -3,204 +3,91 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
-class TranslationMemoryEntry(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
+class TranslationMemoryEntry(BaseModel):
"""
- openapi_types = {
- 'source': 'str',
- 'target': 'str',
- 'score': 'int',
- 'metadata': 'object'
- }
-
- attribute_map = {
- 'source': 'source',
- 'target': 'target',
- 'score': 'score',
- 'metadata': 'metadata'
- }
-
- def __init__(self, source=None, target=None, score=None, metadata=None, local_vars_configuration=None): # noqa: E501
- """TranslationMemoryEntry - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._source = None
- self._target = None
- self._score = None
- self._metadata = None
- self.discriminator = None
-
- if source is not None:
- self.source = source
- if target is not None:
- self.target = target
- if score is not None:
- self.score = score
- if metadata is not None:
- self.metadata = metadata
-
- @property
- def source(self):
- """Gets the source of this TranslationMemoryEntry. # noqa: E501
-
- The source string. # noqa: E501
-
- :return: The source of this TranslationMemoryEntry. # noqa: E501
- :rtype: str
- """
- return self._source
-
- @source.setter
- def source(self, source):
- """Sets the source of this TranslationMemoryEntry.
-
- The source string. # noqa: E501
-
- :param source: The source of this TranslationMemoryEntry. # noqa: E501
- :type: str
- """
-
- self._source = source
-
- @property
- def target(self):
- """Gets the target of this TranslationMemoryEntry. # noqa: E501
-
- The target string. Tags will be automatically placed according to the query string. # noqa: E501
-
- :return: The target of this TranslationMemoryEntry. # noqa: E501
- :rtype: str
- """
- return self._target
-
- @target.setter
- def target(self, target):
- """Sets the target of this TranslationMemoryEntry.
-
- The target string. Tags will be automatically placed according to the query string. # noqa: E501
-
- :param target: The target of this TranslationMemoryEntry. # noqa: E501
- :type: str
- """
-
- self._target = target
-
- @property
- def score(self):
- """Gets the score of this TranslationMemoryEntry. # noqa: E501
-
- The fuzzy match score. # noqa: E501
-
- :return: The score of this TranslationMemoryEntry. # noqa: E501
- :rtype: int
- """
- return self._score
-
- @score.setter
- def score(self, score):
- """Sets the score of this TranslationMemoryEntry.
-
- The fuzzy match score. # noqa: E501
-
- :param score: The score of this TranslationMemoryEntry. # noqa: E501
- :type: int
- """
-
- self._score = score
-
- @property
- def metadata(self):
- """Gets the metadata of this TranslationMemoryEntry. # noqa: E501
-
- Attributes describing the translation memory entry. # noqa: E501
-
- :return: The metadata of this TranslationMemoryEntry. # noqa: E501
- :rtype: object
+ A translation memory entry.
+ """ # noqa: E501
+ source: Optional[StrictStr] = Field(default=None, description="The source string.")
+ target: Optional[StrictStr] = Field(default=None, description="The target string. Tags will be automatically placed according to the query string.")
+ score: Optional[StrictInt] = Field(default=None, description="The fuzzy match score.")
+ metadata: Optional[Dict[str, Any]] = Field(default=None, description="Attributes describing the translation memory entry.")
+ __properties: ClassVar[List[str]] = ["source", "target", "score", "metadata"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TranslationMemoryEntry from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._metadata
-
- @metadata.setter
- def metadata(self, metadata):
- """Sets the metadata of this TranslationMemoryEntry.
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TranslationMemoryEntry from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "source": obj.get("source"),
+ "target": obj.get("target"),
+ "score": obj.get("score"),
+ "metadata": obj.get("metadata")
+ })
+ return _obj
- Attributes describing the translation memory entry. # noqa: E501
-
- :param metadata: The metadata of this TranslationMemoryEntry. # noqa: E501
- :type: object
- """
- self._metadata = metadata
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, TranslationMemoryEntry):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, TranslationMemoryEntry):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/webhook_response.py b/lilt/models/webhook_response.py
new file mode 100644
index 0000000..d0619ca
--- /dev/null
+++ b/lilt/models/webhook_response.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class WebhookResponse(BaseModel):
+ """
+ WebhookResponse
+ """ # noqa: E501
+ id: StrictInt = Field(description="The unique identifier for the webhook configuration.")
+ webhook_name: StrictStr = Field(description="The name of the webhook configuration.", alias="webhookName")
+ webhook_url: StrictStr = Field(description="The URL to which the webhook notifications will be sent.", alias="webhookUrl")
+ event_type: List[StrictStr] = Field(description="The list of event types that will trigger the webhook notification.", alias="eventType")
+ __properties: ClassVar[List[str]] = ["id", "webhookName", "webhookUrl", "eventType"]
+
+ @field_validator('event_type')
+ def event_type_validate_enum(cls, value):
+ """Validates the enum"""
+ for i in value:
+ if i not in set(['JOB_DELIVER', 'JOB_UPDATE', 'PROJECT_DELIVER', 'PROJECT_UPDATE']):
+ raise ValueError("each list item must be one of ('JOB_DELIVER', 'JOB_UPDATE', 'PROJECT_DELIVER', 'PROJECT_UPDATE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of WebhookResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of WebhookResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "webhookName": obj.get("webhookName"),
+ "webhookUrl": obj.get("webhookUrl"),
+ "eventType": obj.get("eventType")
+ })
+ return _obj
+
+
diff --git a/lilt/models/webhooks_update_request.py b/lilt/models/webhooks_update_request.py
new file mode 100644
index 0000000..16175a2
--- /dev/null
+++ b/lilt/models/webhooks_update_request.py
@@ -0,0 +1,149 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import json
+import pprint
+import re # noqa: F401
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
+from typing import Optional
+from lilt.models.webhooks_update_request_any_of import WebhooksUpdateRequestAnyOf
+from lilt.models.webhooks_update_request_any_of1 import WebhooksUpdateRequestAnyOf1
+from lilt.models.webhooks_update_request_any_of2 import WebhooksUpdateRequestAnyOf2
+from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
+from typing_extensions import Literal, Self
+from pydantic import Field
+
+WEBHOOKSUPDATEREQUEST_ANY_OF_SCHEMAS = ["WebhooksUpdateRequestAnyOf", "WebhooksUpdateRequestAnyOf1", "WebhooksUpdateRequestAnyOf2"]
+
+class WebhooksUpdateRequest(BaseModel):
+ """
+ WebhooksUpdateRequest
+ """
+
+ # data type: WebhooksUpdateRequestAnyOf
+ anyof_schema_1_validator: Optional[WebhooksUpdateRequestAnyOf] = None
+ # data type: WebhooksUpdateRequestAnyOf1
+ anyof_schema_2_validator: Optional[WebhooksUpdateRequestAnyOf1] = None
+ # data type: WebhooksUpdateRequestAnyOf2
+ anyof_schema_3_validator: Optional[WebhooksUpdateRequestAnyOf2] = None
+ if TYPE_CHECKING:
+ actual_instance: Optional[Union[WebhooksUpdateRequestAnyOf, WebhooksUpdateRequestAnyOf1, WebhooksUpdateRequestAnyOf2]] = None
+ else:
+ actual_instance: Any = None
+ any_of_schemas: Set[str] = { "WebhooksUpdateRequestAnyOf", "WebhooksUpdateRequestAnyOf1", "WebhooksUpdateRequestAnyOf2" }
+
+ model_config = {
+ "validate_assignment": True,
+ "protected_namespaces": (),
+ }
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @field_validator('actual_instance')
+ def actual_instance_must_validate_anyof(cls, v):
+ instance = WebhooksUpdateRequest.model_construct()
+ error_messages = []
+ # validate data type: WebhooksUpdateRequestAnyOf
+ if not isinstance(v, WebhooksUpdateRequestAnyOf):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `WebhooksUpdateRequestAnyOf`")
+ else:
+ return v
+
+ # validate data type: WebhooksUpdateRequestAnyOf1
+ if not isinstance(v, WebhooksUpdateRequestAnyOf1):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `WebhooksUpdateRequestAnyOf1`")
+ else:
+ return v
+
+ # validate data type: WebhooksUpdateRequestAnyOf2
+ if not isinstance(v, WebhooksUpdateRequestAnyOf2):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `WebhooksUpdateRequestAnyOf2`")
+ else:
+ return v
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when setting the actual_instance in WebhooksUpdateRequest with anyOf schemas: WebhooksUpdateRequestAnyOf, WebhooksUpdateRequestAnyOf1, WebhooksUpdateRequestAnyOf2. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Returns the object represented by the json string"""
+ instance = cls.model_construct()
+ error_messages = []
+ # anyof_schema_1_validator: Optional[WebhooksUpdateRequestAnyOf] = None
+ try:
+ instance.actual_instance = WebhooksUpdateRequestAnyOf.from_json(json_str)
+ return instance
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # anyof_schema_2_validator: Optional[WebhooksUpdateRequestAnyOf1] = None
+ try:
+ instance.actual_instance = WebhooksUpdateRequestAnyOf1.from_json(json_str)
+ return instance
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # anyof_schema_3_validator: Optional[WebhooksUpdateRequestAnyOf2] = None
+ try:
+ instance.actual_instance = WebhooksUpdateRequestAnyOf2.from_json(json_str)
+ return instance
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into WebhooksUpdateRequest with anyOf schemas: WebhooksUpdateRequestAnyOf, WebhooksUpdateRequestAnyOf1, WebhooksUpdateRequestAnyOf2. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> Optional[Union[Dict[str, Any], WebhooksUpdateRequestAnyOf, WebhooksUpdateRequestAnyOf1, WebhooksUpdateRequestAnyOf2]]:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.model_dump())
+
+
diff --git a/lilt/models/webhooks_update_request_any_of.py b/lilt/models/webhooks_update_request_any_of.py
new file mode 100644
index 0000000..1b04527
--- /dev/null
+++ b/lilt/models/webhooks_update_request_any_of.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class WebhooksUpdateRequestAnyOf(BaseModel):
+ """
+ WebhooksUpdateRequestAnyOf
+ """ # noqa: E501
+ webhook_name: StrictStr = Field(description="The name of the webhook configuration.", alias="webhookName")
+ __properties: ClassVar[List[str]] = ["webhookName"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of WebhooksUpdateRequestAnyOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of WebhooksUpdateRequestAnyOf from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "webhookName": obj.get("webhookName")
+ })
+ return _obj
+
+
diff --git a/lilt/models/webhooks_update_request_any_of1.py b/lilt/models/webhooks_update_request_any_of1.py
new file mode 100644
index 0000000..c02c379
--- /dev/null
+++ b/lilt/models/webhooks_update_request_any_of1.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class WebhooksUpdateRequestAnyOf1(BaseModel):
+ """
+ WebhooksUpdateRequestAnyOf1
+ """ # noqa: E501
+ webhook_url: StrictStr = Field(description="The URL to which the webhook notifications will be sent.", alias="webhookUrl")
+ __properties: ClassVar[List[str]] = ["webhookUrl"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of WebhooksUpdateRequestAnyOf1 from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of WebhooksUpdateRequestAnyOf1 from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "webhookUrl": obj.get("webhookUrl")
+ })
+ return _obj
+
+
diff --git a/lilt/models/webhooks_update_request_any_of2.py b/lilt/models/webhooks_update_request_any_of2.py
new file mode 100644
index 0000000..81d2ddc
--- /dev/null
+++ b/lilt/models/webhooks_update_request_any_of2.py
@@ -0,0 +1,95 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class WebhooksUpdateRequestAnyOf2(BaseModel):
+ """
+ WebhooksUpdateRequestAnyOf2
+ """ # noqa: E501
+ event_type: List[StrictStr] = Field(description="The list of event types that will trigger the webhook notification.", alias="eventType")
+ __properties: ClassVar[List[str]] = ["eventType"]
+
+ @field_validator('event_type')
+ def event_type_validate_enum(cls, value):
+ """Validates the enum"""
+ for i in value:
+ if i not in set(['JOB_DELIVER', 'JOB_UPDATE', 'PROJECT_DELIVER', 'PROJECT_UPDATE']):
+ raise ValueError("each list item must be one of ('JOB_DELIVER', 'JOB_UPDATE', 'PROJECT_DELIVER', 'PROJECT_UPDATE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of WebhooksUpdateRequestAnyOf2 from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of WebhooksUpdateRequestAnyOf2 from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "eventType": obj.get("eventType")
+ })
+ return _obj
+
+
diff --git a/lilt/models/workflow_stage_assignment.py b/lilt/models/workflow_stage_assignment.py
index 3a68d48..2a39b29 100644
--- a/lilt/models/workflow_stage_assignment.py
+++ b/lilt/models/workflow_stage_assignment.py
@@ -3,171 +3,89 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class WorkflowStageAssignment(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class WorkflowStageAssignment(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'workflow_stage_template_id': 'int',
- 'user_id': 'int',
- 'email': 'str'
- }
-
- attribute_map = {
- 'workflow_stage_template_id': 'workflowStageTemplateId',
- 'user_id': 'userId',
- 'email': 'email'
- }
-
- def __init__(self, workflow_stage_template_id=None, user_id=None, email=None, local_vars_configuration=None): # noqa: E501
- """WorkflowStageAssignment - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._workflow_stage_template_id = None
- self._user_id = None
- self._email = None
- self.discriminator = None
-
- self.workflow_stage_template_id = workflow_stage_template_id
- if user_id is not None:
- self.user_id = user_id
- if email is not None:
- self.email = email
-
- @property
- def workflow_stage_template_id(self):
- """Gets the workflow_stage_template_id of this WorkflowStageAssignment. # noqa: E501
-
-
- :return: The workflow_stage_template_id of this WorkflowStageAssignment. # noqa: E501
- :rtype: int
+ An assignment object that associates a user to a workflow stage template.
+ """ # noqa: E501
+ workflow_stage_template_id: StrictInt = Field(alias="workflowStageTemplateId")
+ user_id: Optional[StrictInt] = Field(default=None, alias="userId")
+ email: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["workflowStageTemplateId", "userId", "email"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of WorkflowStageAssignment from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._workflow_stage_template_id
+ excluded_fields: Set[str] = set([
+ ])
- @workflow_stage_template_id.setter
- def workflow_stage_template_id(self, workflow_stage_template_id):
- """Sets the workflow_stage_template_id of this WorkflowStageAssignment.
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of WorkflowStageAssignment from a dict"""
+ if obj is None:
+ return None
- :param workflow_stage_template_id: The workflow_stage_template_id of this WorkflowStageAssignment. # noqa: E501
- :type: int
- """
- if self.local_vars_configuration.client_side_validation and workflow_stage_template_id is None: # noqa: E501
- raise ValueError("Invalid value for `workflow_stage_template_id`, must not be `None`") # noqa: E501
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- self._workflow_stage_template_id = workflow_stage_template_id
+ _obj = cls.model_validate({
+ "workflowStageTemplateId": obj.get("workflowStageTemplateId"),
+ "userId": obj.get("userId"),
+ "email": obj.get("email")
+ })
+ return _obj
- @property
- def user_id(self):
- """Gets the user_id of this WorkflowStageAssignment. # noqa: E501
-
-
- :return: The user_id of this WorkflowStageAssignment. # noqa: E501
- :rtype: int
- """
- return self._user_id
-
- @user_id.setter
- def user_id(self, user_id):
- """Sets the user_id of this WorkflowStageAssignment.
-
-
- :param user_id: The user_id of this WorkflowStageAssignment. # noqa: E501
- :type: int
- """
-
- self._user_id = user_id
-
- @property
- def email(self):
- """Gets the email of this WorkflowStageAssignment. # noqa: E501
-
-
- :return: The email of this WorkflowStageAssignment. # noqa: E501
- :rtype: str
- """
- return self._email
-
- @email.setter
- def email(self, email):
- """Sets the email of this WorkflowStageAssignment.
-
-
- :param email: The email of this WorkflowStageAssignment. # noqa: E501
- :type: str
- """
- self._email = email
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, WorkflowStageAssignment):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, WorkflowStageAssignment):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/workflow_stage_template.py b/lilt/models/workflow_stage_template.py
index 792b6ac..babdfa9 100644
--- a/lilt/models/workflow_stage_template.py
+++ b/lilt/models/workflow_stage_template.py
@@ -3,154 +3,97 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
-
-class WorkflowStageTemplate(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+class WorkflowStageTemplate(BaseModel):
"""
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- """
- openapi_types = {
- 'name': 'str',
- 'assignment_type': 'str'
- }
-
- attribute_map = {
- 'name': 'name',
- 'assignment_type': 'assignmentType'
- }
-
- def __init__(self, name=None, assignment_type=None, local_vars_configuration=None): # noqa: E501
- """WorkflowStageTemplate - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._name = None
- self._assignment_type = None
- self.discriminator = None
-
- if name is not None:
- self.name = name
- if assignment_type is not None:
- self.assignment_type = assignment_type
-
- @property
- def name(self):
- """Gets the name of this WorkflowStageTemplate. # noqa: E501
-
- The human readable name of a Workflow stage. # noqa: E501
-
- :return: The name of this WorkflowStageTemplate. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this WorkflowStageTemplate.
-
- The human readable name of a Workflow stage. # noqa: E501
-
- :param name: The name of this WorkflowStageTemplate. # noqa: E501
- :type: str
+ A single stage within a Workflow Template.
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, description="The human readable name of a Workflow stage.")
+ assignment_type: Optional[StrictStr] = Field(default=None, description="An enum to represent all possible types of Workflow stage.", alias="assignmentType")
+ __properties: ClassVar[List[str]] = ["name", "assignmentType"]
+
+ @field_validator('assignment_type')
+ def assignment_type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['READY_TO_START', 'TRANSLATE', 'REVIEW', 'SECONDARY_REVIEW', 'DONE']):
+ raise ValueError("must be one of enum values ('READY_TO_START', 'TRANSLATE', 'REVIEW', 'SECONDARY_REVIEW', 'DONE')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of WorkflowStageTemplate from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
+ excluded_fields: Set[str] = set([
+ ])
- self._name = name
-
- @property
- def assignment_type(self):
- """Gets the assignment_type of this WorkflowStageTemplate. # noqa: E501
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
- An enum to represent all possible types of Workflow stage. # noqa: E501
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of WorkflowStageTemplate from a dict"""
+ if obj is None:
+ return None
- :return: The assignment_type of this WorkflowStageTemplate. # noqa: E501
- :rtype: str
- """
- return self._assignment_type
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
- @assignment_type.setter
- def assignment_type(self, assignment_type):
- """Sets the assignment_type of this WorkflowStageTemplate.
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "assignmentType": obj.get("assignmentType")
+ })
+ return _obj
- An enum to represent all possible types of Workflow stage. # noqa: E501
- :param assignment_type: The assignment_type of this WorkflowStageTemplate. # noqa: E501
- :type: str
- """
- allowed_values = ["READY_TO_START", "TRANSLATE", "REVIEW", "SECONDARY_REVIEW", "DONE"] # noqa: E501
- if self.local_vars_configuration.client_side_validation and assignment_type not in allowed_values: # noqa: E501
- raise ValueError(
- "Invalid value for `assignment_type` ({0}), must be one of {1}" # noqa: E501
- .format(assignment_type, allowed_values)
- )
-
- self._assignment_type = assignment_type
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, WorkflowStageTemplate):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, WorkflowStageTemplate):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/models/workflow_template.py b/lilt/models/workflow_template.py
index 290f591..2569160 100644
--- a/lilt/models/workflow_template.py
+++ b/lilt/models/workflow_template.py
@@ -3,202 +3,99 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+from __future__ import annotations
import pprint
import re # noqa: F401
+import json
-import six
-
-from lilt.configuration import Configuration
-
+from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional, Union
+from lilt.models.workflow_stage_template import WorkflowStageTemplate
+from typing import Optional, Set
+from typing_extensions import Self
-class WorkflowTemplate(object):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
-
- """
- Attributes:
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
+class WorkflowTemplate(BaseModel):
"""
- openapi_types = {
- 'id': 'float',
- 'name': 'str',
- 'team_id': 'float',
- 'stages': 'list[WorkflowStageTemplate]'
- }
-
- attribute_map = {
- 'id': 'id',
- 'name': 'name',
- 'team_id': 'TeamId',
- 'stages': 'stages'
- }
-
- def __init__(self, id=None, name=None, team_id=None, stages=None, local_vars_configuration=None): # noqa: E501
- """WorkflowTemplate - a model defined in OpenAPI""" # noqa: E501
- if local_vars_configuration is None:
- local_vars_configuration = Configuration()
- self.local_vars_configuration = local_vars_configuration
-
- self._id = None
- self._name = None
- self._team_id = None
- self._stages = None
- self.discriminator = None
-
- if id is not None:
- self.id = id
- if name is not None:
- self.name = name
- if team_id is not None:
- self.team_id = team_id
- if stages is not None:
- self.stages = stages
-
- @property
- def id(self):
- """Gets the id of this WorkflowTemplate. # noqa: E501
-
- Identifier of a teams Workflow template. Can be used during Job creation for specifying the workflow used for a job or language pair. # noqa: E501
-
- :return: The id of this WorkflowTemplate. # noqa: E501
- :rtype: float
- """
- return self._id
-
- @id.setter
- def id(self, id):
- """Sets the id of this WorkflowTemplate.
-
- Identifier of a teams Workflow template. Can be used during Job creation for specifying the workflow used for a job or language pair. # noqa: E501
-
- :param id: The id of this WorkflowTemplate. # noqa: E501
- :type: float
- """
-
- self._id = id
-
- @property
- def name(self):
- """Gets the name of this WorkflowTemplate. # noqa: E501
-
-
- :return: The name of this WorkflowTemplate. # noqa: E501
- :rtype: str
- """
- return self._name
-
- @name.setter
- def name(self, name):
- """Sets the name of this WorkflowTemplate.
-
-
- :param name: The name of this WorkflowTemplate. # noqa: E501
- :type: str
- """
-
- self._name = name
-
- @property
- def team_id(self):
- """Gets the team_id of this WorkflowTemplate. # noqa: E501
-
- The name of a given Workflow template. # noqa: E501
-
- :return: The team_id of this WorkflowTemplate. # noqa: E501
- :rtype: float
- """
- return self._team_id
-
- @team_id.setter
- def team_id(self, team_id):
- """Sets the team_id of this WorkflowTemplate.
-
- The name of a given Workflow template. # noqa: E501
-
- :param team_id: The team_id of this WorkflowTemplate. # noqa: E501
- :type: float
- """
-
- self._team_id = team_id
-
- @property
- def stages(self):
- """Gets the stages of this WorkflowTemplate. # noqa: E501
-
- The stages in this workflow template. # noqa: E501
-
- :return: The stages of this WorkflowTemplate. # noqa: E501
- :rtype: list[WorkflowStageTemplate]
+ A workflow template which defines the workflow's possible steps (combination of Translation, Review and Customer Review).
+ """ # noqa: E501
+ id: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Identifier of a teams Workflow template. Can be used during Job creation for specifying the workflow used for a job or language pair.")
+ name: Optional[StrictStr] = None
+ team_id: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The name of a given Workflow template.", alias="TeamId")
+ stages: Optional[List[WorkflowStageTemplate]] = Field(default=None, description="The stages in this workflow template.")
+ __properties: ClassVar[List[str]] = ["id", "name", "TeamId", "stages"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of WorkflowTemplate from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
"""
- return self._stages
-
- @stages.setter
- def stages(self, stages):
- """Sets the stages of this WorkflowTemplate.
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in stages (list)
+ _items = []
+ if self.stages:
+ for _item_stages in self.stages:
+ if _item_stages:
+ _items.append(_item_stages.to_dict())
+ _dict['stages'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of WorkflowTemplate from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "TeamId": obj.get("TeamId"),
+ "stages": [WorkflowStageTemplate.from_dict(_item) for _item in obj["stages"]] if obj.get("stages") is not None else None
+ })
+ return _obj
- The stages in this workflow template. # noqa: E501
-
- :param stages: The stages of this WorkflowTemplate. # noqa: E501
- :type: list[WorkflowStageTemplate]
- """
- self._stages = stages
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- result = {}
-
- for attr, _ in six.iteritems(self.openapi_types):
- value = getattr(self, attr)
- if isinstance(value, list):
- result[attr] = list(map(
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
- value
- ))
- elif hasattr(value, "to_dict"):
- result[attr] = value.to_dict()
- elif isinstance(value, dict):
- result[attr] = dict(map(
- lambda item: (item[0], item[1].to_dict())
- if hasattr(item[1], "to_dict") else item,
- value.items()
- ))
- else:
- result[attr] = value
-
- return result
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, WorkflowTemplate):
- return False
-
- return self.to_dict() == other.to_dict()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- if not isinstance(other, WorkflowTemplate):
- return True
-
- return self.to_dict() != other.to_dict()
diff --git a/lilt/py.typed b/lilt/py.typed
new file mode 100644
index 0000000..e69de29
diff --git a/lilt/rest.py b/lilt/rest.py
index a9b4d75..4966336 100644
--- a/lilt/rest.py
+++ b/lilt/rest.py
@@ -3,57 +3,66 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import io
import json
-import logging
import re
import ssl
-import certifi
-# python 2 and python 3 compatibility library
-import six
-from six.moves.urllib.parse import urlencode
import urllib3
from lilt.exceptions import ApiException, ApiValueError
+SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
+RESTResponseType = urllib3.HTTPResponse
+
-logger = logging.getLogger(__name__)
+def is_socks_proxy_url(url):
+ if url is None:
+ return False
+ split_section = url.split("://")
+ if len(split_section) < 2:
+ return False
+ else:
+ return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
class RESTResponse(io.IOBase):
- def __init__(self, resp):
- self.urllib3_response = resp
+ def __init__(self, resp) -> None:
+ self.response = resp
self.status = resp.status
self.reason = resp.reason
- self.data = resp.data
+ self.data = None
+
+ def read(self):
+ if self.data is None:
+ self.data = self.response.data
+ return self.data
def getheaders(self):
"""Returns a dictionary of the response headers."""
- return self.urllib3_response.getheaders()
+ return self.response.headers
def getheader(self, name, default=None):
"""Returns a given response header."""
- return self.urllib3_response.getheader(name, default)
+ return self.response.headers.get(name, default)
-class RESTClientObject(object):
+class RESTClientObject:
- def __init__(self, configuration, pools_size=4, maxsize=None):
+ def __init__(self, configuration) -> None:
# urllib3.PoolManager will pass all kw parameters to connectionpool
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
- # maxsize is the number of requests to host that are allowed in parallel # noqa: E501
# Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
# cert_reqs
@@ -62,74 +71,80 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
else:
cert_reqs = ssl.CERT_NONE
- # ca_certs
- if configuration.ssl_ca_cert:
- ca_certs = configuration.ssl_ca_cert
- else:
- # if not set certificate file, use Mozilla's root certificates.
- ca_certs = certifi.where()
-
- addition_pool_args = {}
+ pool_args = {
+ "cert_reqs": cert_reqs,
+ "ca_certs": configuration.ssl_ca_cert,
+ "cert_file": configuration.cert_file,
+ "key_file": configuration.key_file,
+ "ca_cert_data": configuration.ca_cert_data,
+ }
if configuration.assert_hostname is not None:
- addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
+ pool_args['assert_hostname'] = (
+ configuration.assert_hostname
+ )
if configuration.retries is not None:
- addition_pool_args['retries'] = configuration.retries
+ pool_args['retries'] = configuration.retries
- if maxsize is None:
- if configuration.connection_pool_maxsize is not None:
- maxsize = configuration.connection_pool_maxsize
- else:
- maxsize = 4
+ if configuration.tls_server_name:
+ pool_args['server_hostname'] = configuration.tls_server_name
+
+
+ if configuration.socket_options is not None:
+ pool_args['socket_options'] = configuration.socket_options
+
+ if configuration.connection_pool_maxsize is not None:
+ pool_args['maxsize'] = configuration.connection_pool_maxsize
# https pool manager
+ self.pool_manager: urllib3.PoolManager
+
if configuration.proxy:
- self.pool_manager = urllib3.ProxyManager(
- num_pools=pools_size,
- maxsize=maxsize,
- cert_reqs=cert_reqs,
- ca_certs=ca_certs,
- cert_file=configuration.cert_file,
- key_file=configuration.key_file,
- proxy_url=configuration.proxy,
- proxy_headers=configuration.proxy_headers,
- **addition_pool_args
- )
+ if is_socks_proxy_url(configuration.proxy):
+ from urllib3.contrib.socks import SOCKSProxyManager
+ pool_args["proxy_url"] = configuration.proxy
+ pool_args["headers"] = configuration.proxy_headers
+ self.pool_manager = SOCKSProxyManager(**pool_args)
+ else:
+ pool_args["proxy_url"] = configuration.proxy
+ pool_args["proxy_headers"] = configuration.proxy_headers
+ self.pool_manager = urllib3.ProxyManager(**pool_args)
else:
- self.pool_manager = urllib3.PoolManager(
- num_pools=pools_size,
- maxsize=maxsize,
- cert_reqs=cert_reqs,
- ca_certs=ca_certs,
- cert_file=configuration.cert_file,
- key_file=configuration.key_file,
- **addition_pool_args
- )
-
- def request(self, method, url, query_params=None, headers=None,
- body=None, post_params=None, _preload_content=True,
- _request_timeout=None):
+ self.pool_manager = urllib3.PoolManager(**pool_args)
+
+ def request(
+ self,
+ method,
+ url,
+ headers=None,
+ body=None,
+ post_params=None,
+ _request_timeout=None
+ ):
"""Perform requests.
:param method: http request method
:param url: http request url
- :param query_params: query parameters in the url
:param headers: http request headers
:param body: request json body, for `application/json`
:param post_params: request post parameters,
`application/x-www-form-urlencoded`
and `multipart/form-data`
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
"""
method = method.upper()
- assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
- 'PATCH', 'OPTIONS']
+ assert method in [
+ 'GET',
+ 'HEAD',
+ 'DELETE',
+ 'POST',
+ 'PUT',
+ 'PATCH',
+ 'OPTIONS'
+ ]
if post_params and body:
raise ApiValueError(
@@ -141,60 +156,83 @@ def request(self, method, url, query_params=None, headers=None,
timeout = None
if _request_timeout:
- if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821
+ if isinstance(_request_timeout, (int, float)):
timeout = urllib3.Timeout(total=_request_timeout)
- elif (isinstance(_request_timeout, tuple) and
- len(_request_timeout) == 2):
+ elif (
+ isinstance(_request_timeout, tuple)
+ and len(_request_timeout) == 2
+ ):
timeout = urllib3.Timeout(
- connect=_request_timeout[0], read=_request_timeout[1])
-
- if 'Content-Type' not in headers:
- headers['Content-Type'] = 'application/json'
+ connect=_request_timeout[0],
+ read=_request_timeout[1]
+ )
try:
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
- if query_params:
- url += '?' + urlencode(query_params)
- if re.search('json', headers['Content-Type'], re.IGNORECASE):
+
+ # no content type provided or payload is json
+ content_type = headers.get('Content-Type')
+ if (
+ not content_type
+ or re.search('json', content_type, re.IGNORECASE)
+ ):
request_body = None
if body is not None:
request_body = json.dumps(body)
r = self.pool_manager.request(
- method, url,
+ method,
+ url,
body=request_body,
- preload_content=_preload_content,
timeout=timeout,
- headers=headers)
- elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ headers=headers,
+ preload_content=False
+ )
+ elif content_type == 'application/x-www-form-urlencoded':
r = self.pool_manager.request(
- method, url,
+ method,
+ url,
fields=post_params,
encode_multipart=False,
- preload_content=_preload_content,
timeout=timeout,
- headers=headers)
- elif headers['Content-Type'] == 'multipart/form-data':
+ headers=headers,
+ preload_content=False
+ )
+ elif content_type == 'multipart/form-data':
# must del headers['Content-Type'], or the correct
# Content-Type which generated by urllib3 will be
# overwritten.
del headers['Content-Type']
+ # Ensures that dict objects are serialized
+ post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
r = self.pool_manager.request(
- method, url,
+ method,
+ url,
fields=post_params,
encode_multipart=True,
- preload_content=_preload_content,
timeout=timeout,
- headers=headers)
+ headers=headers,
+ preload_content=False
+ )
# Pass a `string` parameter directly in the body to support
- # other content types than Json when `body` argument is
- # provided in serialized form
+ # other content types than JSON when `body` argument is
+ # provided in serialized form.
elif isinstance(body, str) or isinstance(body, bytes):
- request_body = body
r = self.pool_manager.request(
- method, url,
+ method,
+ url,
+ body=body,
+ timeout=timeout,
+ headers=headers,
+ preload_content=False
+ )
+ elif headers['Content-Type'].startswith('text/') and isinstance(body, bool):
+ request_body = "true" if body else "false"
+ r = self.pool_manager.request(
+ method,
+ url,
body=request_body,
- preload_content=_preload_content,
+ preload_content=False,
timeout=timeout,
headers=headers)
else:
@@ -205,87 +243,16 @@ def request(self, method, url, query_params=None, headers=None,
raise ApiException(status=0, reason=msg)
# For `GET`, `HEAD`
else:
- r = self.pool_manager.request(method, url,
- fields=query_params,
- preload_content=_preload_content,
- timeout=timeout,
- headers=headers)
+ r = self.pool_manager.request(
+ method,
+ url,
+ fields={},
+ timeout=timeout,
+ headers=headers,
+ preload_content=False
+ )
except urllib3.exceptions.SSLError as e:
- msg = "{0}\n{1}".format(type(e).__name__, str(e))
+ msg = "\n".join([type(e).__name__, str(e)])
raise ApiException(status=0, reason=msg)
- if _preload_content:
- r = RESTResponse(r)
-
- # log response body
- logger.debug("response body: %s", r.data)
-
- if not 200 <= r.status <= 299:
- raise ApiException(http_resp=r)
-
- return r
-
- def GET(self, url, headers=None, query_params=None, _preload_content=True,
- _request_timeout=None):
- return self.request("GET", url,
- headers=headers,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- query_params=query_params)
-
- def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
- _request_timeout=None):
- return self.request("HEAD", url,
- headers=headers,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- query_params=query_params)
-
- def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
- body=None, _preload_content=True, _request_timeout=None):
- return self.request("OPTIONS", url,
- headers=headers,
- query_params=query_params,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
-
- def DELETE(self, url, headers=None, query_params=None, body=None,
- _preload_content=True, _request_timeout=None):
- return self.request("DELETE", url,
- headers=headers,
- query_params=query_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
-
- def POST(self, url, headers=None, query_params=None, post_params=None,
- body=None, _preload_content=True, _request_timeout=None):
- return self.request("POST", url,
- headers=headers,
- query_params=query_params,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
-
- def PUT(self, url, headers=None, query_params=None, post_params=None,
- body=None, _preload_content=True, _request_timeout=None):
- return self.request("PUT", url,
- headers=headers,
- query_params=query_params,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
-
- def PATCH(self, url, headers=None, query_params=None, post_params=None,
- body=None, _preload_content=True, _request_timeout=None):
- return self.request("PATCH", url,
- headers=headers,
- query_params=query_params,
- post_params=post_params,
- _preload_content=_preload_content,
- _request_timeout=_request_timeout,
- body=body)
+ return RESTResponse(r)
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..056e2f3
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,89 @@
+[tool.poetry]
+name = "lilt"
+version = "v3.0.2"
+description = "Lilt REST API"
+authors = ["OpenAPI Generator Community "]
+license = "Lilt Platform Terms and Conditions"
+readme = "README.md"
+repository = "https://github.com/lilt/lilt-python"
+keywords = ["OpenAPI", "OpenAPI-Generator", "Lilt REST API"]
+include = ["lilt/py.typed"]
+
+[tool.poetry.dependencies]
+python = "^3.9"
+
+urllib3 = ">= 2.1.0, < 3.0.0"
+python-dateutil = ">= 2.8.2"
+pydantic = ">= 2"
+typing-extensions = ">= 4.7.1"
+
+[tool.poetry.dev-dependencies]
+pytest = ">= 7.2.1"
+pytest-cov = ">= 2.8.1"
+tox = ">= 3.9.0"
+flake8 = ">= 4.0.0"
+types-python-dateutil = ">= 2.8.19.14"
+mypy = ">= 1.5"
+
+
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[tool.pylint.'MESSAGES CONTROL']
+extension-pkg-whitelist = "pydantic"
+
+[tool.mypy]
+files = [
+ "lilt",
+ #"test", # auto-generated tests
+ "tests", # hand-written tests
+]
+# TODO: enable "strict" once all these individual checks are passing
+# strict = true
+
+# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options
+warn_unused_configs = true
+warn_redundant_casts = true
+warn_unused_ignores = true
+
+## Getting these passing should be easy
+strict_equality = true
+extra_checks = true
+
+## Strongly recommend enabling this one as soon as you can
+check_untyped_defs = true
+
+## These shouldn't be too much additional work, but may be tricky to
+## get passing if you use a lot of untyped libraries
+disallow_subclassing_any = true
+disallow_untyped_decorators = true
+disallow_any_generics = true
+
+### These next few are various gradations of forcing use of type annotations
+#disallow_untyped_calls = true
+#disallow_incomplete_defs = true
+#disallow_untyped_defs = true
+#
+### This one isn't too hard to get passing, but return on investment is lower
+#no_implicit_reexport = true
+#
+### This one can be tricky to get passing if you use a lot of untyped libraries
+#warn_return_any = true
+
+[[tool.mypy.overrides]]
+module = [
+ "lilt.configuration",
+]
+warn_unused_ignores = true
+strict_equality = true
+extra_checks = true
+check_untyped_defs = true
+disallow_subclassing_any = true
+disallow_untyped_decorators = true
+disallow_any_generics = true
+disallow_untyped_calls = true
+disallow_incomplete_defs = true
+disallow_untyped_defs = true
+no_implicit_reexport = true
+warn_return_any = true
diff --git a/requirements.txt b/requirements.txt
index eb358ef..6cbb2b9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,4 @@
-certifi >= 14.05.14
-future; python_version<="2.7"
-six >= 1.10
-python_dateutil >= 2.5.3
-setuptools >= 21.0.0
-urllib3 >= 1.15.1
+urllib3 >= 2.1.0, < 3.0.0
+python_dateutil >= 2.8.2
+pydantic >= 2
+typing-extensions >= 4.7.1
diff --git a/setup.cfg b/setup.cfg
index 91a3c28..11433ee 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,2 @@
[flake8]
max-line-length=99
-
-[metadata]
-license_files = LICENSE.md
diff --git a/setup.py b/setup.py
index d8d4a28..ed91e25 100644
--- a/setup.py
+++ b/setup.py
@@ -3,25 +3,32 @@
"""
Lilt REST API
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
- The version of the OpenAPI document: v3.0
- Generated by: https://openapi-generator.tech
-"""
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
from setuptools import setup, find_packages # noqa: H301
-NAME = "lilt-python"
-VERSION = "3.0.0"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-
-REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
+NAME = "lilt-python"
+VERSION = "v3.0.2"
+PYTHON_REQUIRES = ">= 3.9"
+REQUIRES = [
+ "urllib3 >= 2.1.0, < 3.0.0",
+ "python-dateutil >= 2.8.2",
+ "pydantic >= 2",
+ "typing-extensions >= 4.7.1",
+]
setup(
name=NAME,
@@ -34,10 +41,10 @@
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
+ license="Lilt Platform Terms and Conditions",
+ long_description_content_type='text/markdown',
long_description="""\
- Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501
- """,
- entry_points = {
- 'console_scripts': ['local_test=workflow_tests.local_test:main']
- }
-)
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+ """, # noqa: E501
+ package_data={"lilt": ["py.typed"]},
+)
\ No newline at end of file
diff --git a/test/test_create_webhook_options.py b/test/test_create_webhook_options.py
new file mode 100644
index 0000000..0ec577e
--- /dev/null
+++ b/test/test_create_webhook_options.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.create_webhook_options import CreateWebhookOptions
+
+class TestCreateWebhookOptions(unittest.TestCase):
+ """CreateWebhookOptions unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> CreateWebhookOptions:
+ """Test CreateWebhookOptions
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CreateWebhookOptions`
+ """
+ model = CreateWebhookOptions()
+ if include_optional:
+ return CreateWebhookOptions(
+ webhook_name = '',
+ webhook_url = '',
+ event_type = [
+ 'JOB_DELIVER'
+ ]
+ )
+ else:
+ return CreateWebhookOptions(
+ webhook_name = '',
+ webhook_url = '',
+ event_type = [
+ 'JOB_DELIVER'
+ ],
+ )
+ """
+
+ def testCreateWebhookOptions(self):
+ """Test CreateWebhookOptions"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_delete_lilt_create_content200_response.py b/test/test_delete_lilt_create_content200_response.py
new file mode 100644
index 0000000..c80d0d8
--- /dev/null
+++ b/test/test_delete_lilt_create_content200_response.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.delete_lilt_create_content200_response import DeleteLiltCreateContent200Response
+
+class TestDeleteLiltCreateContent200Response(unittest.TestCase):
+ """DeleteLiltCreateContent200Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DeleteLiltCreateContent200Response:
+ """Test DeleteLiltCreateContent200Response
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DeleteLiltCreateContent200Response`
+ """
+ model = DeleteLiltCreateContent200Response()
+ if include_optional:
+ return DeleteLiltCreateContent200Response(
+ id = 56
+ )
+ else:
+ return DeleteLiltCreateContent200Response(
+ )
+ """
+
+ def testDeleteLiltCreateContent200Response(self):
+ """Test DeleteLiltCreateContent200Response"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_domain.py b/test/test_domain.py
new file mode 100644
index 0000000..6aa36ff
--- /dev/null
+++ b/test/test_domain.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.domain import Domain
+
+class TestDomain(unittest.TestCase):
+ """Domain unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Domain:
+ """Test Domain
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Domain`
+ """
+ model = Domain()
+ if include_optional:
+ return Domain(
+ domain_id = 123,
+ domain_name = 'Example Domain',
+ models = [{"id":456,"name":"Example Model","provider":"Google Translate","status":"Active","srcLang":"en","trgLang":"es","srcLocale":"US","trgLocale":"ES"}],
+ filter_configs = [{"id":789,"isDefault":true,"filterConfig":"Example Filter Config","filterName":"Example Filter","configName":"Example Config Name","configDescription":"Example Config Description","subfilters":"{}","segmentationConfigSetting":"SENTENCE","srx":"Example SRX","segmentationConfigName":"Example Segmentation Config","domains":[{"id":101,"name":"Example Domain Ref"}],"createdAt":"2024-01-01T00:00:00Z","updatedAt":"2024-01-02T00:00:00Z","default":true}],
+ domain_metadata = [{"id":131,"key":"Example Key","value":"Example Value"}]
+ )
+ else:
+ return Domain(
+ domain_id = 123,
+ domain_name = 'Example Domain',
+ models = [{"id":456,"name":"Example Model","provider":"Google Translate","status":"Active","srcLang":"en","trgLang":"es","srcLocale":"US","trgLocale":"ES"}],
+ filter_configs = [{"id":789,"isDefault":true,"filterConfig":"Example Filter Config","filterName":"Example Filter","configName":"Example Config Name","configDescription":"Example Config Description","subfilters":"{}","segmentationConfigSetting":"SENTENCE","srx":"Example SRX","segmentationConfigName":"Example Segmentation Config","domains":[{"id":101,"name":"Example Domain Ref"}],"createdAt":"2024-01-01T00:00:00Z","updatedAt":"2024-01-02T00:00:00Z","default":true}],
+ domain_metadata = [{"id":131,"key":"Example Key","value":"Example Value"}],
+ )
+ """
+
+ def testDomain(self):
+ """Test Domain"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_domain_list.py b/test/test_domain_list.py
new file mode 100644
index 0000000..917297d
--- /dev/null
+++ b/test/test_domain_list.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.domain_list import DomainList
+
+class TestDomainList(unittest.TestCase):
+ """DomainList unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DomainList:
+ """Test DomainList
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DomainList`
+ """
+ model = DomainList()
+ if include_optional:
+ return DomainList(
+ items = [{"domainId":123,"domainName":"Example Domain","models":[{"id":456,"name":"Example Model","provider":"Google Translate","status":"Active","srcLang":"en","trgLang":"es","srcLocale":"US","trgLocale":"ES"}],"filterConfigs":[{"id":789,"isDefault":true,"filterConfig":"Example Filter Config","filterName":"Example Filter","configName":"Example Config Name","configDescription":"Example Config Description","subfilters":"Example Subfilters","segmentationConfigSetting":"SENTENCE","srx":"Example SRX","segmentationConfigName":"Example Segmentation Config","domains":[{"id":101,"name":"Example Domain Ref"}],"createdAt":"2024-01-01T00:00:00Z","updatedAt":"2024-01-02T00:00:00Z","default":true}],"domainMetadata":[{"id":131,"key":"Example Key","value":"Example Value"}]}],
+ size = 1
+ )
+ else:
+ return DomainList(
+ items = [{"domainId":123,"domainName":"Example Domain","models":[{"id":456,"name":"Example Model","provider":"Google Translate","status":"Active","srcLang":"en","trgLang":"es","srcLocale":"US","trgLocale":"ES"}],"filterConfigs":[{"id":789,"isDefault":true,"filterConfig":"Example Filter Config","filterName":"Example Filter","configName":"Example Config Name","configDescription":"Example Config Description","subfilters":"Example Subfilters","segmentationConfigSetting":"SENTENCE","srx":"Example SRX","segmentationConfigName":"Example Segmentation Config","domains":[{"id":101,"name":"Example Domain Ref"}],"createdAt":"2024-01-01T00:00:00Z","updatedAt":"2024-01-02T00:00:00Z","default":true}],"domainMetadata":[{"id":131,"key":"Example Key","value":"Example Value"}]}],
+ size = 1,
+ )
+ """
+
+ def testDomainList(self):
+ """Test DomainList"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_domain_metadata.py b/test/test_domain_metadata.py
new file mode 100644
index 0000000..e839109
--- /dev/null
+++ b/test/test_domain_metadata.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.domain_metadata import DomainMetadata
+
+class TestDomainMetadata(unittest.TestCase):
+ """DomainMetadata unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DomainMetadata:
+ """Test DomainMetadata
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DomainMetadata`
+ """
+ model = DomainMetadata()
+ if include_optional:
+ return DomainMetadata(
+ id = 131,
+ key = 'Example Key',
+ value = 'Example Value'
+ )
+ else:
+ return DomainMetadata(
+ )
+ """
+
+ def testDomainMetadata(self):
+ """Test DomainMetadata"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_domain_reference.py b/test/test_domain_reference.py
new file mode 100644
index 0000000..ec06a8d
--- /dev/null
+++ b/test/test_domain_reference.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.domain_reference import DomainReference
+
+class TestDomainReference(unittest.TestCase):
+ """DomainReference unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DomainReference:
+ """Test DomainReference
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DomainReference`
+ """
+ model = DomainReference()
+ if include_optional:
+ return DomainReference(
+ id = 101,
+ name = 'Example Domain Ref'
+ )
+ else:
+ return DomainReference(
+ )
+ """
+
+ def testDomainReference(self):
+ """Test DomainReference"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_domains_api.py b/test/test_domains_api.py
new file mode 100644
index 0000000..0771960
--- /dev/null
+++ b/test/test_domains_api.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.api.domains_api import DomainsApi
+
+
+class TestDomainsApi(unittest.TestCase):
+ """DomainsApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = DomainsApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_get_domains(self) -> None:
+ """Test case for get_domains
+
+ Retrieve Domains
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_filter_config.py b/test/test_filter_config.py
new file mode 100644
index 0000000..86023fa
--- /dev/null
+++ b/test/test_filter_config.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.filter_config import FilterConfig
+
+class TestFilterConfig(unittest.TestCase):
+ """FilterConfig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> FilterConfig:
+ """Test FilterConfig
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `FilterConfig`
+ """
+ model = FilterConfig()
+ if include_optional:
+ return FilterConfig(
+ id = 789,
+ is_default = True,
+ filter_config = 'Example Filter Config',
+ filter_name = 'Example Filter',
+ config_name = 'Example Config Name',
+ config_description = 'Example Config Description',
+ subfilters = 'Example Subfilters',
+ segmentation_config_setting = 'SENTENCE',
+ srx = 'Example SRX',
+ segmentation_config_name = 'Example Segmentation Config',
+ domains = [{"id":101,"name":"Example Domain Ref"}],
+ created_at = '2024-01-01T00:00Z',
+ updated_at = '2024-01-02T00:00Z',
+ default = True
+ )
+ else:
+ return FilterConfig(
+ )
+ """
+
+ def testFilterConfig(self):
+ """Test FilterConfig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_model.py b/test/test_model.py
new file mode 100644
index 0000000..b6dc051
--- /dev/null
+++ b/test/test_model.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.model import Model
+
+class TestModel(unittest.TestCase):
+ """Model unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Model:
+ """Test Model
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Model`
+ """
+ model = Model()
+ if include_optional:
+ return Model(
+ id = 456,
+ name = 'Example Model',
+ provider = 'Google Translate',
+ status = 'Active',
+ src_lang = 'en',
+ trg_lang = 'es',
+ src_locale = 'en-US',
+ trg_locale = 'es-ES'
+ )
+ else:
+ return Model(
+ )
+ """
+
+ def testModel(self):
+ """Test Model"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_webhook_configuration_api.py b/test/test_webhook_configuration_api.py
new file mode 100644
index 0000000..fafca27
--- /dev/null
+++ b/test/test_webhook_configuration_api.py
@@ -0,0 +1,66 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.api.webhook_configuration_api import WebhookConfigurationApi
+
+
+class TestWebhookConfigurationApi(unittest.TestCase):
+ """WebhookConfigurationApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = WebhookConfigurationApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_services_configuration_api_webhooks_delete(self) -> None:
+ """Test case for services_configuration_api_webhooks_delete
+
+ Delete a specific Webhook Configuration by ID.
+ """
+ pass
+
+ def test_webhooks_create(self) -> None:
+ """Test case for webhooks_create
+
+ Creates a new Webhook Configuration
+ """
+ pass
+
+ def test_webhooks_get(self) -> None:
+ """Test case for webhooks_get
+
+ Retrieve a specific Webhook Configuration by ID.
+ """
+ pass
+
+ def test_webhooks_get_many(self) -> None:
+ """Test case for webhooks_get_many
+
+ Retrieve a list of Webhook Configurations.
+ """
+ pass
+
+ def test_webhooks_update(self) -> None:
+ """Test case for webhooks_update
+
+ Update a specific Webhook Configuration by ID.
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_webhook_response.py b/test/test_webhook_response.py
new file mode 100644
index 0000000..eccf1d1
--- /dev/null
+++ b/test/test_webhook_response.py
@@ -0,0 +1,62 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.webhook_response import WebhookResponse
+
+class TestWebhookResponse(unittest.TestCase):
+ """WebhookResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> WebhookResponse:
+ """Test WebhookResponse
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `WebhookResponse`
+ """
+ model = WebhookResponse()
+ if include_optional:
+ return WebhookResponse(
+ id = 12345,
+ webhook_name = '',
+ webhook_url = '',
+ event_type = [
+ 'JOB_DELIVER'
+ ]
+ )
+ else:
+ return WebhookResponse(
+ id = 12345,
+ webhook_name = '',
+ webhook_url = '',
+ event_type = [
+ 'JOB_DELIVER'
+ ],
+ )
+ """
+
+ def testWebhookResponse(self):
+ """Test WebhookResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_webhooks_update_request.py b/test/test_webhooks_update_request.py
new file mode 100644
index 0000000..8b342df
--- /dev/null
+++ b/test/test_webhooks_update_request.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.webhooks_update_request import WebhooksUpdateRequest
+
+class TestWebhooksUpdateRequest(unittest.TestCase):
+ """WebhooksUpdateRequest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> WebhooksUpdateRequest:
+ """Test WebhooksUpdateRequest
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `WebhooksUpdateRequest`
+ """
+ model = WebhooksUpdateRequest()
+ if include_optional:
+ return WebhooksUpdateRequest(
+ webhook_name = '',
+ webhook_url = '',
+ event_type = [
+ 'JOB_DELIVER'
+ ]
+ )
+ else:
+ return WebhooksUpdateRequest(
+ webhook_name = '',
+ webhook_url = '',
+ event_type = [
+ 'JOB_DELIVER'
+ ],
+ )
+ """
+
+ def testWebhooksUpdateRequest(self):
+ """Test WebhooksUpdateRequest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_webhooks_update_request_any_of.py b/test/test_webhooks_update_request_any_of.py
new file mode 100644
index 0000000..5e20284
--- /dev/null
+++ b/test/test_webhooks_update_request_any_of.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.webhooks_update_request_any_of import WebhooksUpdateRequestAnyOf
+
+class TestWebhooksUpdateRequestAnyOf(unittest.TestCase):
+ """WebhooksUpdateRequestAnyOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> WebhooksUpdateRequestAnyOf:
+ """Test WebhooksUpdateRequestAnyOf
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `WebhooksUpdateRequestAnyOf`
+ """
+ model = WebhooksUpdateRequestAnyOf()
+ if include_optional:
+ return WebhooksUpdateRequestAnyOf(
+ webhook_name = ''
+ )
+ else:
+ return WebhooksUpdateRequestAnyOf(
+ webhook_name = '',
+ )
+ """
+
+ def testWebhooksUpdateRequestAnyOf(self):
+ """Test WebhooksUpdateRequestAnyOf"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_webhooks_update_request_any_of1.py b/test/test_webhooks_update_request_any_of1.py
new file mode 100644
index 0000000..2a1e72d
--- /dev/null
+++ b/test/test_webhooks_update_request_any_of1.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.webhooks_update_request_any_of1 import WebhooksUpdateRequestAnyOf1
+
+class TestWebhooksUpdateRequestAnyOf1(unittest.TestCase):
+ """WebhooksUpdateRequestAnyOf1 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> WebhooksUpdateRequestAnyOf1:
+ """Test WebhooksUpdateRequestAnyOf1
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `WebhooksUpdateRequestAnyOf1`
+ """
+ model = WebhooksUpdateRequestAnyOf1()
+ if include_optional:
+ return WebhooksUpdateRequestAnyOf1(
+ webhook_url = ''
+ )
+ else:
+ return WebhooksUpdateRequestAnyOf1(
+ webhook_url = '',
+ )
+ """
+
+ def testWebhooksUpdateRequestAnyOf1(self):
+ """Test WebhooksUpdateRequestAnyOf1"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_webhooks_update_request_any_of2.py b/test/test_webhooks_update_request_any_of2.py
new file mode 100644
index 0000000..1ace4b5
--- /dev/null
+++ b/test/test_webhooks_update_request_any_of2.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Lilt REST API
+
+ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.
+
+ The version of the OpenAPI document: v3.0.2
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lilt.models.webhooks_update_request_any_of2 import WebhooksUpdateRequestAnyOf2
+
+class TestWebhooksUpdateRequestAnyOf2(unittest.TestCase):
+ """WebhooksUpdateRequestAnyOf2 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> WebhooksUpdateRequestAnyOf2:
+ """Test WebhooksUpdateRequestAnyOf2
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `WebhooksUpdateRequestAnyOf2`
+ """
+ model = WebhooksUpdateRequestAnyOf2()
+ if include_optional:
+ return WebhooksUpdateRequestAnyOf2(
+ event_type = [
+ 'JOB_DELIVER'
+ ]
+ )
+ else:
+ return WebhooksUpdateRequestAnyOf2(
+ event_type = [
+ 'JOB_DELIVER'
+ ],
+ )
+ """
+
+ def testWebhooksUpdateRequestAnyOf2(self):
+ """Test WebhooksUpdateRequestAnyOf2"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tox.ini b/tox.ini
index d8226cc..644d771 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py27, py3
+envlist = py3
[testenv]
deps=-r{toxinidir}/requirements.txt