Skip to content

Commit

Permalink
2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Sep 9, 2019
1 parent 6ef2aa6 commit 5786eb9
Show file tree
Hide file tree
Showing 23 changed files with 605 additions and 16 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions cloudmersive_convert_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
103 changes: 103 additions & 0 deletions cloudmersive_convert_api_client/api/convert_template_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cloudmersive_convert_api_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion cloudmersive_convert_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions cloudmersive_convert_api_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 5786eb9

Please sign in to comment.