diff --git a/README.md b/README.md index 48babc7..a84f971 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Convert API lets you effortlessly convert file formats and types. This Python package provides a native API client for [Cloudmersive Document Conversion](https://www.cloudmersive.com/convert-api) - API version: v1 -- Package version: 2.0.6 +- Package version: 2.0.7 - Build package: io.swagger.codegen.languages.PythonClientCodegen ## Requirements. @@ -105,6 +105,7 @@ Class | Method | HTTP request | Description *ConvertImageApi* | [**convert_image_image_format_convert**](docs/ConvertImageApi.md#convert_image_image_format_convert) | **POST** /convert/image/{format1}/to/{format2} | Image format conversion *ConvertImageApi* | [**convert_image_image_set_dpi**](docs/ConvertImageApi.md#convert_image_image_set_dpi) | **POST** /convert/image/set-dpi/{dpi} | Change image DPI *ConvertImageApi* | [**convert_image_multipage_image_format_convert**](docs/ConvertImageApi.md#convert_image_multipage_image_format_convert) | **POST** /convert/image-multipage/{format1}/to/{format2} | Multi-page format conversion +*ConvertTemplateApi* | [**convert_template_apply_docx_template**](docs/ConvertTemplateApi.md#convert_template_apply_docx_template) | **POST** /convert/template/docx/apply | Apply Word DOCX template *ConvertTemplateApi* | [**convert_template_apply_html_template**](docs/ConvertTemplateApi.md#convert_template_apply_html_template) | **POST** /convert/template/html/apply | Apply HTML template *ConvertWebApi* | [**convert_web_html_to_docx**](docs/ConvertWebApi.md#convert_web_html_to_docx) | **POST** /convert/html/to/docx | HTML to DOCX *ConvertWebApi* | [**convert_web_html_to_pdf**](docs/ConvertWebApi.md#convert_web_html_to_pdf) | **POST** /convert/web/html/to/pdf | Convert HTML string to PDF @@ -172,6 +173,8 @@ Class | Method | HTTP request | Description - [DocxTable](docs/DocxTable.md) - [DocxTableCell](docs/DocxTableCell.md) - [DocxTableRow](docs/DocxTableRow.md) + - [DocxTemplateApplicationRequest](docs/DocxTemplateApplicationRequest.md) + - [DocxTemplateOperation](docs/DocxTemplateOperation.md) - [DocxText](docs/DocxText.md) - [ExifValue](docs/ExifValue.md) - [FinishEditingRequest](docs/FinishEditingRequest.md) diff --git a/cloudmersive_convert_api_client/__init__.py b/cloudmersive_convert_api_client/__init__.py index 28c97dd..a7ac46d 100644 --- a/cloudmersive_convert_api_client/__init__.py +++ b/cloudmersive_convert_api_client/__init__.py @@ -57,6 +57,8 @@ from cloudmersive_convert_api_client.models.docx_table import DocxTable from cloudmersive_convert_api_client.models.docx_table_cell import DocxTableCell from cloudmersive_convert_api_client.models.docx_table_row import DocxTableRow +from cloudmersive_convert_api_client.models.docx_template_application_request import DocxTemplateApplicationRequest +from cloudmersive_convert_api_client.models.docx_template_operation import DocxTemplateOperation from cloudmersive_convert_api_client.models.docx_text import DocxText from cloudmersive_convert_api_client.models.exif_value import ExifValue from cloudmersive_convert_api_client.models.finish_editing_request import FinishEditingRequest diff --git a/cloudmersive_convert_api_client/api/convert_template_api.py b/cloudmersive_convert_api_client/api/convert_template_api.py index 74cef0a..9a96607 100644 --- a/cloudmersive_convert_api_client/api/convert_template_api.py +++ b/cloudmersive_convert_api_client/api/convert_template_api.py @@ -33,6 +33,109 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client + def convert_template_apply_docx_template(self, input_file, **kwargs): # noqa: E501 + """Apply Word DOCX template # noqa: E501 + + Apply operations to fill in a Word DOCX template by replacing target template/placeholder strings in the DOCX with values, generating a final Word DOCX result. For example, you could create a Word Document invoice containing strings such as \"{FirstName}\" and \"{LastName}\" and then replace these values with \"John\" and \"Smith\". # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.convert_template_apply_docx_template(input_file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file input_file: Input file to perform the operation on. (required) + :param object template_definition: Template definition for the document, including what values to replace + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.convert_template_apply_docx_template_with_http_info(input_file, **kwargs) # noqa: E501 + else: + (data) = self.convert_template_apply_docx_template_with_http_info(input_file, **kwargs) # noqa: E501 + return data + + def convert_template_apply_docx_template_with_http_info(self, input_file, **kwargs): # noqa: E501 + """Apply Word DOCX template # noqa: E501 + + Apply operations to fill in a Word DOCX template by replacing target template/placeholder strings in the DOCX with values, generating a final Word DOCX result. For example, you could create a Word Document invoice containing strings such as \"{FirstName}\" and \"{LastName}\" and then replace these values with \"John\" and \"Smith\". # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.convert_template_apply_docx_template_with_http_info(input_file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file input_file: Input file to perform the operation on. (required) + :param object template_definition: Template definition for the document, including what values to replace + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['input_file', 'template_definition'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method convert_template_apply_docx_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'input_file' is set + if ('input_file' not in params or + params['input_file'] is None): + raise ValueError("Missing the required parameter `input_file` when calling `convert_template_apply_docx_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'template_definition' in params: + header_params['templateDefinition'] = params['template_definition'] # noqa: E501 + + form_params = [] + local_var_files = {} + if 'input_file' in params: + local_var_files['inputFile'] = params['input_file'] # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'text/json', 'application/xml', 'text/xml']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['Apikey'] # noqa: E501 + + return self.api_client.call_api( + '/convert/template/docx/apply', 'POST', + 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=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def convert_template_apply_html_template(self, value, **kwargs): # noqa: E501 """Apply HTML template # noqa: E501 diff --git a/cloudmersive_convert_api_client/api_client.py b/cloudmersive_convert_api_client/api_client.py index 031e5bf..ef84cb2 100644 --- a/cloudmersive_convert_api_client/api_client.py +++ b/cloudmersive_convert_api_client/api_client.py @@ -74,7 +74,7 @@ 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 = 'Swagger-Codegen/2.0.6/python' + self.user_agent = 'Swagger-Codegen/2.0.7/python' def __del__(self): if self._pool is not None: diff --git a/cloudmersive_convert_api_client/configuration.py b/cloudmersive_convert_api_client/configuration.py index 0807df7..8d61592 100644 --- a/cloudmersive_convert_api_client/configuration.py +++ b/cloudmersive_convert_api_client/configuration.py @@ -240,5 +240,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v1\n"\ - "SDK Package Version: 2.0.6".\ + "SDK Package Version: 2.0.7".\ format(env=sys.platform, pyversion=sys.version) diff --git a/cloudmersive_convert_api_client/models/__init__.py b/cloudmersive_convert_api_client/models/__init__.py index 3baf6d9..a73e304 100644 --- a/cloudmersive_convert_api_client/models/__init__.py +++ b/cloudmersive_convert_api_client/models/__init__.py @@ -41,6 +41,8 @@ from cloudmersive_convert_api_client.models.docx_table import DocxTable from cloudmersive_convert_api_client.models.docx_table_cell import DocxTableCell from cloudmersive_convert_api_client.models.docx_table_row import DocxTableRow +from cloudmersive_convert_api_client.models.docx_template_application_request import DocxTemplateApplicationRequest +from cloudmersive_convert_api_client.models.docx_template_operation import DocxTemplateOperation from cloudmersive_convert_api_client.models.docx_text import DocxText from cloudmersive_convert_api_client.models.exif_value import ExifValue from cloudmersive_convert_api_client.models.finish_editing_request import FinishEditingRequest diff --git a/cloudmersive_convert_api_client/models/docx_template_application_request.py b/cloudmersive_convert_api_client/models/docx_template_application_request.py new file mode 100644 index 0000000..5ad056d --- /dev/null +++ b/cloudmersive_convert_api_client/models/docx_template_application_request.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + convertapi + + Convert API lets you effortlessly convert file formats and types. # noqa: E501 + + OpenAPI spec version: v1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from cloudmersive_convert_api_client.models.docx_template_operation import DocxTemplateOperation # noqa: F401,E501 + + +class DocxTemplateApplicationRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_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. + """ + swagger_types = { + 'operations': 'list[DocxTemplateOperation]' + } + + attribute_map = { + 'operations': 'Operations' + } + + def __init__(self, operations=None): # noqa: E501 + """DocxTemplateApplicationRequest - a model defined in Swagger""" # noqa: E501 + + self._operations = None + self.discriminator = None + + if operations is not None: + self.operations = operations + + @property + def operations(self): + """Gets the operations of this DocxTemplateApplicationRequest. # noqa: E501 + + Operations to apply to this template # noqa: E501 + + :return: The operations of this DocxTemplateApplicationRequest. # noqa: E501 + :rtype: list[DocxTemplateOperation] + """ + return self._operations + + @operations.setter + def operations(self, operations): + """Sets the operations of this DocxTemplateApplicationRequest. + + Operations to apply to this template # noqa: E501 + + :param operations: The operations of this DocxTemplateApplicationRequest. # noqa: E501 + :type: list[DocxTemplateOperation] + """ + + self._operations = operations + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_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 + if issubclass(DocxTemplateApplicationRequest, dict): + for key, value in self.items(): + result[key] = 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, DocxTemplateApplicationRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/cloudmersive_convert_api_client/models/docx_template_operation.py b/cloudmersive_convert_api_client/models/docx_template_operation.py new file mode 100644 index 0000000..6e26c8b --- /dev/null +++ b/cloudmersive_convert_api_client/models/docx_template_operation.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + convertapi + + Convert API lets you effortlessly convert file formats and types. # noqa: E501 + + OpenAPI spec version: v1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DocxTemplateOperation(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_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. + """ + swagger_types = { + 'action': 'int', + 'match_against': 'str', + 'replace_with': 'str' + } + + attribute_map = { + 'action': 'Action', + 'match_against': 'MatchAgainst', + 'replace_with': 'ReplaceWith' + } + + def __init__(self, action=None, match_against=None, replace_with=None): # noqa: E501 + """DocxTemplateOperation - a model defined in Swagger""" # noqa: E501 + + self._action = None + self._match_against = None + self._replace_with = None + self.discriminator = None + + if action is not None: + self.action = action + if match_against is not None: + self.match_against = match_against + if replace_with is not None: + self.replace_with = replace_with + + @property + def action(self): + """Gets the action of this DocxTemplateOperation. # noqa: E501 + + Operation action to take; possible values are \"Replace\" # noqa: E501 + + :return: The action of this DocxTemplateOperation. # noqa: E501 + :rtype: int + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this DocxTemplateOperation. + + Operation action to take; possible values are \"Replace\" # noqa: E501 + + :param action: The action of this DocxTemplateOperation. # noqa: E501 + :type: int + """ + allowed_values = [1] # noqa: E501 + if action not in allowed_values: + raise ValueError( + "Invalid value for `action` ({0}), must be one of {1}" # noqa: E501 + .format(action, allowed_values) + ) + + self._action = action + + @property + def match_against(self): + """Gets the match_against of this DocxTemplateOperation. # noqa: E501 + + For Replace operations, the string to match against (to be replaced with ReplaceWith string) # noqa: E501 + + :return: The match_against of this DocxTemplateOperation. # noqa: E501 + :rtype: str + """ + return self._match_against + + @match_against.setter + def match_against(self, match_against): + """Sets the match_against of this DocxTemplateOperation. + + For Replace operations, the string to match against (to be replaced with ReplaceWith string) # noqa: E501 + + :param match_against: The match_against of this DocxTemplateOperation. # noqa: E501 + :type: str + """ + + self._match_against = match_against + + @property + def replace_with(self): + """Gets the replace_with of this DocxTemplateOperation. # noqa: E501 + + For Replace operations, the string to Replace the original string with # noqa: E501 + + :return: The replace_with of this DocxTemplateOperation. # noqa: E501 + :rtype: str + """ + return self._replace_with + + @replace_with.setter + def replace_with(self, replace_with): + """Sets the replace_with of this DocxTemplateOperation. + + For Replace operations, the string to Replace the original string with # noqa: E501 + + :param replace_with: The replace_with of this DocxTemplateOperation. # noqa: E501 + :type: str + """ + + self._replace_with = replace_with + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_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 + if issubclass(DocxTemplateOperation, dict): + for key, value in self.items(): + result[key] = 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, DocxTemplateOperation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/cloudmersive_convert_api_client/models/html_template_application_request.py b/cloudmersive_convert_api_client/models/html_template_application_request.py index 0e781d2..003eead 100644 --- a/cloudmersive_convert_api_client/models/html_template_application_request.py +++ b/cloudmersive_convert_api_client/models/html_template_application_request.py @@ -63,6 +63,7 @@ def __init__(self, html_template=None, html_template_url=None, operations=None): def html_template(self): """Gets the html_template of this HtmlTemplateApplicationRequest. # noqa: E501 + HTML template input as a string # noqa: E501 :return: The html_template of this HtmlTemplateApplicationRequest. # noqa: E501 :rtype: str @@ -73,6 +74,7 @@ def html_template(self): def html_template(self, html_template): """Sets the html_template of this HtmlTemplateApplicationRequest. + HTML template input as a string # noqa: E501 :param html_template: The html_template of this HtmlTemplateApplicationRequest. # noqa: E501 :type: str @@ -84,6 +86,7 @@ def html_template(self, html_template): def html_template_url(self): """Gets the html_template_url of this HtmlTemplateApplicationRequest. # noqa: E501 + URL to HTML template input # noqa: E501 :return: The html_template_url of this HtmlTemplateApplicationRequest. # noqa: E501 :rtype: str @@ -94,6 +97,7 @@ def html_template_url(self): def html_template_url(self, html_template_url): """Sets the html_template_url of this HtmlTemplateApplicationRequest. + URL to HTML template input # noqa: E501 :param html_template_url: The html_template_url of this HtmlTemplateApplicationRequest. # noqa: E501 :type: str @@ -105,6 +109,7 @@ def html_template_url(self, html_template_url): def operations(self): """Gets the operations of this HtmlTemplateApplicationRequest. # noqa: E501 + Operations to apply to this template # noqa: E501 :return: The operations of this HtmlTemplateApplicationRequest. # noqa: E501 :rtype: list[HtmlTemplateOperation] @@ -115,6 +120,7 @@ def operations(self): def operations(self, operations): """Sets the operations of this HtmlTemplateApplicationRequest. + Operations to apply to this template # noqa: E501 :param operations: The operations of this HtmlTemplateApplicationRequest. # noqa: E501 :type: list[HtmlTemplateOperation] diff --git a/cloudmersive_convert_api_client/models/html_template_operation.py b/cloudmersive_convert_api_client/models/html_template_operation.py index 5d6830a..bb2e9eb 100644 --- a/cloudmersive_convert_api_client/models/html_template_operation.py +++ b/cloudmersive_convert_api_client/models/html_template_operation.py @@ -61,6 +61,7 @@ def __init__(self, action=None, match_agsint=None, replace_with=None): # noqa: def action(self): """Gets the action of this HtmlTemplateOperation. # noqa: E501 + Operation action to take; possible values are \"Replace\" # noqa: E501 :return: The action of this HtmlTemplateOperation. # noqa: E501 :rtype: int @@ -71,6 +72,7 @@ def action(self): def action(self, action): """Sets the action of this HtmlTemplateOperation. + Operation action to take; possible values are \"Replace\" # noqa: E501 :param action: The action of this HtmlTemplateOperation. # noqa: E501 :type: int @@ -88,6 +90,7 @@ def action(self, action): def match_agsint(self): """Gets the match_agsint of this HtmlTemplateOperation. # noqa: E501 + For Replace operations, the string to match against (to be replaced with ReplaceWith string) # noqa: E501 :return: The match_agsint of this HtmlTemplateOperation. # noqa: E501 :rtype: str @@ -98,6 +101,7 @@ def match_agsint(self): def match_agsint(self, match_agsint): """Sets the match_agsint of this HtmlTemplateOperation. + For Replace operations, the string to match against (to be replaced with ReplaceWith string) # noqa: E501 :param match_agsint: The match_agsint of this HtmlTemplateOperation. # noqa: E501 :type: str @@ -109,6 +113,7 @@ def match_agsint(self, match_agsint): def replace_with(self): """Gets the replace_with of this HtmlTemplateOperation. # noqa: E501 + For Replace operations, the string to Replace the original string with # noqa: E501 :return: The replace_with of this HtmlTemplateOperation. # noqa: E501 :rtype: str @@ -119,6 +124,7 @@ def replace_with(self): def replace_with(self, replace_with): """Sets the replace_with of this HtmlTemplateOperation. + For Replace operations, the string to Replace the original string with # noqa: E501 :param replace_with: The replace_with of this HtmlTemplateOperation. # noqa: E501 :type: str diff --git a/cloudmersive_convert_api_client/models/multipage_image_format_conversion_result.py b/cloudmersive_convert_api_client/models/multipage_image_format_conversion_result.py index ecacd9f..621df42 100644 --- a/cloudmersive_convert_api_client/models/multipage_image_format_conversion_result.py +++ b/cloudmersive_convert_api_client/models/multipage_image_format_conversion_result.py @@ -63,6 +63,7 @@ def __init__(self, successful=None, page_count=None, pages=None): # noqa: E501 def successful(self): """Gets the successful of this MultipageImageFormatConversionResult. # noqa: E501 + True if successful, false otherwise # noqa: E501 :return: The successful of this MultipageImageFormatConversionResult. # noqa: E501 :rtype: bool @@ -73,6 +74,7 @@ def successful(self): def successful(self, successful): """Sets the successful of this MultipageImageFormatConversionResult. + True if successful, false otherwise # noqa: E501 :param successful: The successful of this MultipageImageFormatConversionResult. # noqa: E501 :type: bool @@ -84,6 +86,7 @@ def successful(self, successful): def page_count(self): """Gets the page_count of this MultipageImageFormatConversionResult. # noqa: E501 + The number of pages in the converted output # noqa: E501 :return: The page_count of this MultipageImageFormatConversionResult. # noqa: E501 :rtype: int @@ -94,6 +97,7 @@ def page_count(self): def page_count(self, page_count): """Sets the page_count of this MultipageImageFormatConversionResult. + The number of pages in the converted output # noqa: E501 :param page_count: The page_count of this MultipageImageFormatConversionResult. # noqa: E501 :type: int @@ -105,6 +109,7 @@ def page_count(self, page_count): def pages(self): """Gets the pages of this MultipageImageFormatConversionResult. # noqa: E501 + Converted page results # noqa: E501 :return: The pages of this MultipageImageFormatConversionResult. # noqa: E501 :rtype: list[PageConversionResult] @@ -115,6 +120,7 @@ def pages(self): def pages(self, pages): """Sets the pages of this MultipageImageFormatConversionResult. + Converted page results # noqa: E501 :param pages: The pages of this MultipageImageFormatConversionResult. # noqa: E501 :type: list[PageConversionResult] diff --git a/cloudmersive_convert_api_client/models/page_conversion_result.py b/cloudmersive_convert_api_client/models/page_conversion_result.py index dea323e..d51e126 100644 --- a/cloudmersive_convert_api_client/models/page_conversion_result.py +++ b/cloudmersive_convert_api_client/models/page_conversion_result.py @@ -56,6 +56,7 @@ def __init__(self, filename=None, file_bytes=None): # noqa: E501 def filename(self): """Gets the filename of this PageConversionResult. # noqa: E501 + File name of the image in the converted file format # noqa: E501 :return: The filename of this PageConversionResult. # noqa: E501 :rtype: str @@ -66,6 +67,7 @@ def filename(self): def filename(self, filename): """Sets the filename of this PageConversionResult. + File name of the image in the converted file format # noqa: E501 :param filename: The filename of this PageConversionResult. # noqa: E501 :type: str @@ -77,6 +79,7 @@ def filename(self, filename): def file_bytes(self): """Gets the file_bytes of this PageConversionResult. # noqa: E501 + File bytes (contents) of the image in converted file format # noqa: E501 :return: The file_bytes of this PageConversionResult. # noqa: E501 :rtype: str @@ -87,6 +90,7 @@ def file_bytes(self): def file_bytes(self, file_bytes): """Sets the file_bytes of this PageConversionResult. + File bytes (contents) of the image in converted file format # noqa: E501 :param file_bytes: The file_bytes of this PageConversionResult. # noqa: E501 :type: str diff --git a/docs/ConvertTemplateApi.md b/docs/ConvertTemplateApi.md index bf0ac6c..90b68c8 100644 --- a/docs/ConvertTemplateApi.md +++ b/docs/ConvertTemplateApi.md @@ -4,9 +4,66 @@ All URIs are relative to *https://api.cloudmersive.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**convert_template_apply_docx_template**](ConvertTemplateApi.md#convert_template_apply_docx_template) | **POST** /convert/template/docx/apply | Apply Word DOCX template [**convert_template_apply_html_template**](ConvertTemplateApi.md#convert_template_apply_html_template) | **POST** /convert/template/html/apply | Apply HTML template +# **convert_template_apply_docx_template** +> str convert_template_apply_docx_template(input_file, template_definition=template_definition) + +Apply Word DOCX template + +Apply operations to fill in a Word DOCX template by replacing target template/placeholder strings in the DOCX with values, generating a final Word DOCX result. For example, you could create a Word Document invoice containing strings such as \"{FirstName}\" and \"{LastName}\" and then replace these values with \"John\" and \"Smith\". + +### Example +```python +from __future__ import print_function +import time +import cloudmersive_convert_api_client +from cloudmersive_convert_api_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: Apikey +configuration = cloudmersive_convert_api_client.Configuration() +configuration.api_key['Apikey'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Apikey'] = 'Bearer' + +# create an instance of the API class +api_instance = cloudmersive_convert_api_client.ConvertTemplateApi(cloudmersive_convert_api_client.ApiClient(configuration)) +input_file = '/path/to/file.txt' # file | Input file to perform the operation on. +template_definition = NULL # object | Template definition for the document, including what values to replace (optional) + +try: + # Apply Word DOCX template + api_response = api_instance.convert_template_apply_docx_template(input_file, template_definition=template_definition) + pprint(api_response) +except ApiException as e: + print("Exception when calling ConvertTemplateApi->convert_template_apply_docx_template: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input_file** | **file**| Input file to perform the operation on. | + **template_definition** | [**object**](.md)| Template definition for the document, including what values to replace | [optional] + +### Return type + +**str** + +### Authorization + +[Apikey](../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, text/json, application/xml, text/xml + +[[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) + # **convert_template_apply_html_template** > HtmlTemplateApplicationResponse convert_template_apply_html_template(value) diff --git a/docs/DocxTemplateApplicationRequest.md b/docs/DocxTemplateApplicationRequest.md new file mode 100644 index 0000000..4549efb --- /dev/null +++ b/docs/DocxTemplateApplicationRequest.md @@ -0,0 +1,10 @@ +# DocxTemplateApplicationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**operations** | [**list[DocxTemplateOperation]**](DocxTemplateOperation.md) | Operations to apply to this template | [optional] + +[[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/DocxTemplateOperation.md b/docs/DocxTemplateOperation.md new file mode 100644 index 0000000..124b834 --- /dev/null +++ b/docs/DocxTemplateOperation.md @@ -0,0 +1,12 @@ +# DocxTemplateOperation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **int** | Operation action to take; possible values are \"Replace\" | [optional] +**match_against** | **str** | For Replace operations, the string to match against (to be replaced with ReplaceWith string) | [optional] +**replace_with** | **str** | For Replace operations, the string to Replace the original string with | [optional] + +[[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/HtmlTemplateApplicationRequest.md b/docs/HtmlTemplateApplicationRequest.md index 3ebbdf6..54c7aaa 100644 --- a/docs/HtmlTemplateApplicationRequest.md +++ b/docs/HtmlTemplateApplicationRequest.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**html_template** | **str** | | [optional] -**html_template_url** | **str** | | [optional] -**operations** | [**list[HtmlTemplateOperation]**](HtmlTemplateOperation.md) | | [optional] +**html_template** | **str** | HTML template input as a string | [optional] +**html_template_url** | **str** | URL to HTML template input | [optional] +**operations** | [**list[HtmlTemplateOperation]**](HtmlTemplateOperation.md) | Operations to apply to this template | [optional] [[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/HtmlTemplateOperation.md b/docs/HtmlTemplateOperation.md index 68ee789..2e6ec39 100644 --- a/docs/HtmlTemplateOperation.md +++ b/docs/HtmlTemplateOperation.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | **int** | | [optional] -**match_agsint** | **str** | | [optional] -**replace_with** | **str** | | [optional] +**action** | **int** | Operation action to take; possible values are \"Replace\" | [optional] +**match_agsint** | **str** | For Replace operations, the string to match against (to be replaced with ReplaceWith string) | [optional] +**replace_with** | **str** | For Replace operations, the string to Replace the original string with | [optional] [[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/MultipageImageFormatConversionResult.md b/docs/MultipageImageFormatConversionResult.md index 4f53b9e..505300b 100644 --- a/docs/MultipageImageFormatConversionResult.md +++ b/docs/MultipageImageFormatConversionResult.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**successful** | **bool** | | [optional] -**page_count** | **int** | | [optional] -**pages** | [**list[PageConversionResult]**](PageConversionResult.md) | | [optional] +**successful** | **bool** | True if successful, false otherwise | [optional] +**page_count** | **int** | The number of pages in the converted output | [optional] +**pages** | [**list[PageConversionResult]**](PageConversionResult.md) | Converted page results | [optional] [[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/PageConversionResult.md b/docs/PageConversionResult.md index d2e924e..a0f29e4 100644 --- a/docs/PageConversionResult.md +++ b/docs/PageConversionResult.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**filename** | **str** | | [optional] -**file_bytes** | **str** | | [optional] +**filename** | **str** | File name of the image in the converted file format | [optional] +**file_bytes** | **str** | File bytes (contents) of the image in converted file format | [optional] [[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/packageconfig.json b/packageconfig.json index a56f0be..620ed9d 100644 --- a/packageconfig.json +++ b/packageconfig.json @@ -1,6 +1,6 @@ { "projectName" : "cloudmersive_convert_api_client", "packageName" : "cloudmersive_convert_api_client", - "packageVersion": "2.0.6", + "packageVersion": "2.0.7", "packageUrl": "https://www.cloudmersive.com/convert-api" } \ No newline at end of file diff --git a/setup.py b/setup.py index 308ceaf..dc3d7c0 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "cloudmersive_convert_api_client" -VERSION = "2.0.6" +VERSION = "2.0.7" # To install the library, run the following # # python setup.py install diff --git a/test/test_docx_template_application_request.py b/test/test_docx_template_application_request.py new file mode 100644 index 0000000..3c798a4 --- /dev/null +++ b/test/test_docx_template_application_request.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + convertapi + + Convert API lets you effortlessly convert file formats and types. # noqa: E501 + + OpenAPI spec version: v1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import cloudmersive_convert_api_client +from cloudmersive_convert_api_client.models.docx_template_application_request import DocxTemplateApplicationRequest # noqa: E501 +from cloudmersive_convert_api_client.rest import ApiException + + +class TestDocxTemplateApplicationRequest(unittest.TestCase): + """DocxTemplateApplicationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDocxTemplateApplicationRequest(self): + """Test DocxTemplateApplicationRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudmersive_convert_api_client.models.docx_template_application_request.DocxTemplateApplicationRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_docx_template_operation.py b/test/test_docx_template_operation.py new file mode 100644 index 0000000..91bb861 --- /dev/null +++ b/test/test_docx_template_operation.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + convertapi + + Convert API lets you effortlessly convert file formats and types. # noqa: E501 + + OpenAPI spec version: v1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import cloudmersive_convert_api_client +from cloudmersive_convert_api_client.models.docx_template_operation import DocxTemplateOperation # noqa: E501 +from cloudmersive_convert_api_client.rest import ApiException + + +class TestDocxTemplateOperation(unittest.TestCase): + """DocxTemplateOperation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDocxTemplateOperation(self): + """Test DocxTemplateOperation""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudmersive_convert_api_client.models.docx_template_operation.DocxTemplateOperation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()