diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION index 26f8b8b..717311e 100644 --- a/.swagger-codegen/VERSION +++ b/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.5 \ No newline at end of file +unset \ No newline at end of file diff --git a/README.md b/README.md index 90375bc..580721b 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.1.1 +- Package version: 2.1.2 - Build package: io.swagger.codegen.languages.PythonClientCodegen ## Requirements. @@ -132,6 +132,7 @@ Class | Method | HTTP request | Description *EditDocumentApi* | [**edit_document_docx_remove_object**](docs/EditDocumentApi.md#edit_document_docx_remove_object) | **POST** /convert/edit/docx/remove-object | Delete any object in a DOCX *EditDocumentApi* | [**edit_document_docx_replace**](docs/EditDocumentApi.md#edit_document_docx_replace) | **POST** /convert/edit/docx/replace-all | Replace string in DOCX *EditDocumentApi* | [**edit_document_docx_set_footer**](docs/EditDocumentApi.md#edit_document_docx_set_footer) | **POST** /convert/edit/docx/set-footer | Set the footer in a DOCX +*EditDocumentApi* | [**edit_document_docx_set_footer_add_page_number**](docs/EditDocumentApi.md#edit_document_docx_set_footer_add_page_number) | **POST** /convert/edit/docx/set-footer/add-page-number | Add page number to footer in a DOCX *EditDocumentApi* | [**edit_document_docx_set_header**](docs/EditDocumentApi.md#edit_document_docx_set_header) | **POST** /convert/edit/docx/set-header | Set the header in a DOCX *EditDocumentApi* | [**edit_document_finish_editing**](docs/EditDocumentApi.md#edit_document_finish_editing) | **POST** /convert/edit/finish-editing | Download result from document editing *EditDocumentApi* | [**edit_document_pptx_replace**](docs/EditDocumentApi.md#edit_document_pptx_replace) | **POST** /convert/edit/pptx/replace-all | Replace string in PPTX @@ -175,6 +176,7 @@ Class | Method | HTTP request | Description - [DocxRemoveObjectResponse](docs/DocxRemoveObjectResponse.md) - [DocxRun](docs/DocxRun.md) - [DocxSection](docs/DocxSection.md) + - [DocxSetFooterAddPageNumberRequest](docs/DocxSetFooterAddPageNumberRequest.md) - [DocxSetFooterRequest](docs/DocxSetFooterRequest.md) - [DocxSetFooterResponse](docs/DocxSetFooterResponse.md) - [DocxSetHeaderRequest](docs/DocxSetHeaderRequest.md) diff --git a/cloudmersive_convert_api_client/__init__.py b/cloudmersive_convert_api_client/__init__.py index 4076510..bdf600c 100644 --- a/cloudmersive_convert_api_client/__init__.py +++ b/cloudmersive_convert_api_client/__init__.py @@ -50,6 +50,7 @@ from cloudmersive_convert_api_client.models.docx_remove_object_response import DocxRemoveObjectResponse from cloudmersive_convert_api_client.models.docx_run import DocxRun from cloudmersive_convert_api_client.models.docx_section import DocxSection +from cloudmersive_convert_api_client.models.docx_set_footer_add_page_number_request import DocxSetFooterAddPageNumberRequest from cloudmersive_convert_api_client.models.docx_set_footer_request import DocxSetFooterRequest from cloudmersive_convert_api_client.models.docx_set_footer_response import DocxSetFooterResponse from cloudmersive_convert_api_client.models.docx_set_header_request import DocxSetHeaderRequest diff --git a/cloudmersive_convert_api_client/api/edit_document_api.py b/cloudmersive_convert_api_client/api/edit_document_api.py index 21255c7..88ba79e 100644 --- a/cloudmersive_convert_api_client/api/edit_document_api.py +++ b/cloudmersive_convert_api_client/api/edit_document_api.py @@ -1419,6 +1419,105 @@ def edit_document_docx_set_footer_with_http_info(self, req_config, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def edit_document_docx_set_footer_add_page_number(self, req_config, **kwargs): # noqa: E501 + """Add page number to footer in a DOCX # noqa: E501 + + Set the footer in a Word Document (DOCX) to contain a page number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.edit_document_docx_set_footer_add_page_number(req_config, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DocxSetFooterAddPageNumberRequest req_config: (required) + :return: DocxSetFooterResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.edit_document_docx_set_footer_add_page_number_with_http_info(req_config, **kwargs) # noqa: E501 + else: + (data) = self.edit_document_docx_set_footer_add_page_number_with_http_info(req_config, **kwargs) # noqa: E501 + return data + + def edit_document_docx_set_footer_add_page_number_with_http_info(self, req_config, **kwargs): # noqa: E501 + """Add page number to footer in a DOCX # noqa: E501 + + Set the footer in a Word Document (DOCX) to contain a page number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.edit_document_docx_set_footer_add_page_number_with_http_info(req_config, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param DocxSetFooterAddPageNumberRequest req_config: (required) + :return: DocxSetFooterResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['req_config'] # 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 edit_document_docx_set_footer_add_page_number" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'req_config' is set + if ('req_config' not in params or + params['req_config'] is None): + raise ValueError("Missing the required parameter `req_config` when calling `edit_document_docx_set_footer_add_page_number`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'req_config' in params: + body_params = params['req_config'] + # 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 + ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']) # noqa: E501 + + # Authentication setting + auth_settings = ['Apikey'] # noqa: E501 + + return self.api_client.call_api( + '/convert/edit/docx/set-footer/add-page-number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DocxSetFooterResponse', # 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 edit_document_docx_set_header(self, req_config, **kwargs): # noqa: E501 """Set the header in a DOCX # noqa: E501 diff --git a/cloudmersive_convert_api_client/api_client.py b/cloudmersive_convert_api_client/api_client.py index d069caf..8ccd475 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.1.1/python' + self.user_agent = 'Swagger-Codegen/2.1.2/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 c737ee7..da37224 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.1.1".\ + "SDK Package Version: 2.1.2".\ 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 5b234d7..e89cfd7 100644 --- a/cloudmersive_convert_api_client/models/__init__.py +++ b/cloudmersive_convert_api_client/models/__init__.py @@ -33,6 +33,7 @@ from cloudmersive_convert_api_client.models.docx_remove_object_response import DocxRemoveObjectResponse from cloudmersive_convert_api_client.models.docx_run import DocxRun from cloudmersive_convert_api_client.models.docx_section import DocxSection +from cloudmersive_convert_api_client.models.docx_set_footer_add_page_number_request import DocxSetFooterAddPageNumberRequest from cloudmersive_convert_api_client.models.docx_set_footer_request import DocxSetFooterRequest from cloudmersive_convert_api_client.models.docx_set_footer_response import DocxSetFooterResponse from cloudmersive_convert_api_client.models.docx_set_header_request import DocxSetHeaderRequest diff --git a/cloudmersive_convert_api_client/models/docx_set_footer_add_page_number_request.py b/cloudmersive_convert_api_client/models/docx_set_footer_add_page_number_request.py new file mode 100644 index 0000000..97f8aff --- /dev/null +++ b/cloudmersive_convert_api_client/models/docx_set_footer_add_page_number_request.py @@ -0,0 +1,173 @@ +# 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 DocxSetFooterAddPageNumberRequest(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 = { + 'prepend_text': 'str', + 'input_file_bytes': 'str', + 'input_file_url': 'str' + } + + attribute_map = { + 'prepend_text': 'PrependText', + 'input_file_bytes': 'InputFileBytes', + 'input_file_url': 'InputFileUrl' + } + + def __init__(self, prepend_text=None, input_file_bytes=None, input_file_url=None): # noqa: E501 + """DocxSetFooterAddPageNumberRequest - a model defined in Swagger""" # noqa: E501 + + self._prepend_text = None + self._input_file_bytes = None + self._input_file_url = None + self.discriminator = None + + if prepend_text is not None: + self.prepend_text = prepend_text + if input_file_bytes is not None: + self.input_file_bytes = input_file_bytes + if input_file_url is not None: + self.input_file_url = input_file_url + + @property + def prepend_text(self): + """Gets the prepend_text of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + + + :return: The prepend_text of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + :rtype: str + """ + return self._prepend_text + + @prepend_text.setter + def prepend_text(self, prepend_text): + """Sets the prepend_text of this DocxSetFooterAddPageNumberRequest. + + + :param prepend_text: The prepend_text of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + :type: str + """ + + self._prepend_text = prepend_text + + @property + def input_file_bytes(self): + """Gets the input_file_bytes of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + + Optional: Bytes of the input file to operate on # noqa: E501 + + :return: The input_file_bytes of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + :rtype: str + """ + return self._input_file_bytes + + @input_file_bytes.setter + def input_file_bytes(self, input_file_bytes): + """Sets the input_file_bytes of this DocxSetFooterAddPageNumberRequest. + + Optional: Bytes of the input file to operate on # noqa: E501 + + :param input_file_bytes: The input_file_bytes of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + :type: str + """ + if input_file_bytes is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', input_file_bytes): # noqa: E501 + raise ValueError(r"Invalid value for `input_file_bytes`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + + self._input_file_bytes = input_file_bytes + + @property + def input_file_url(self): + """Gets the input_file_url of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + + Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public). # noqa: E501 + + :return: The input_file_url of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + :rtype: str + """ + return self._input_file_url + + @input_file_url.setter + def input_file_url(self, input_file_url): + """Sets the input_file_url of this DocxSetFooterAddPageNumberRequest. + + Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public). # noqa: E501 + + :param input_file_url: The input_file_url of this DocxSetFooterAddPageNumberRequest. # noqa: E501 + :type: str + """ + + self._input_file_url = input_file_url + + 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(DocxSetFooterAddPageNumberRequest, 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, DocxSetFooterAddPageNumberRequest): + 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/docs/DocxSetFooterAddPageNumberRequest.md b/docs/DocxSetFooterAddPageNumberRequest.md new file mode 100644 index 0000000..64b6803 --- /dev/null +++ b/docs/DocxSetFooterAddPageNumberRequest.md @@ -0,0 +1,12 @@ +# DocxSetFooterAddPageNumberRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prepend_text** | **str** | | [optional] +**input_file_bytes** | **str** | Optional: Bytes of the input file to operate on | [optional] +**input_file_url** | **str** | Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public). | [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/EditDocumentApi.md b/docs/EditDocumentApi.md index e23a447..c412574 100644 --- a/docs/EditDocumentApi.md +++ b/docs/EditDocumentApi.md @@ -18,6 +18,7 @@ Method | HTTP request | Description [**edit_document_docx_remove_object**](EditDocumentApi.md#edit_document_docx_remove_object) | **POST** /convert/edit/docx/remove-object | Delete any object in a DOCX [**edit_document_docx_replace**](EditDocumentApi.md#edit_document_docx_replace) | **POST** /convert/edit/docx/replace-all | Replace string in DOCX [**edit_document_docx_set_footer**](EditDocumentApi.md#edit_document_docx_set_footer) | **POST** /convert/edit/docx/set-footer | Set the footer in a DOCX +[**edit_document_docx_set_footer_add_page_number**](EditDocumentApi.md#edit_document_docx_set_footer_add_page_number) | **POST** /convert/edit/docx/set-footer/add-page-number | Add page number to footer in a DOCX [**edit_document_docx_set_header**](EditDocumentApi.md#edit_document_docx_set_header) | **POST** /convert/edit/docx/set-header | Set the header in a DOCX [**edit_document_finish_editing**](EditDocumentApi.md#edit_document_finish_editing) | **POST** /convert/edit/finish-editing | Download result from document editing [**edit_document_pptx_replace**](EditDocumentApi.md#edit_document_pptx_replace) | **POST** /convert/edit/pptx/replace-all | Replace string in PPTX @@ -785,6 +786,60 @@ 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) +# **edit_document_docx_set_footer_add_page_number** +> DocxSetFooterResponse edit_document_docx_set_footer_add_page_number(req_config) + +Add page number to footer in a DOCX + +Set the footer in a Word Document (DOCX) to contain a page number + +### 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.EditDocumentApi(cloudmersive_convert_api_client.ApiClient(configuration)) +req_config = cloudmersive_convert_api_client.DocxSetFooterAddPageNumberRequest() # DocxSetFooterAddPageNumberRequest | + +try: + # Add page number to footer in a DOCX + api_response = api_instance.edit_document_docx_set_footer_add_page_number(req_config) + pprint(api_response) +except ApiException as e: + print("Exception when calling EditDocumentApi->edit_document_docx_set_footer_add_page_number: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **req_config** | [**DocxSetFooterAddPageNumberRequest**](DocxSetFooterAddPageNumberRequest.md)| | + +### Return type + +[**DocxSetFooterResponse**](DocxSetFooterResponse.md) + +### Authorization + +[Apikey](../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded + - **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) + # **edit_document_docx_set_header** > DocxSetHeaderResponse edit_document_docx_set_header(req_config) diff --git a/packageconfig.json b/packageconfig.json index ce4cf7d..2cb78f9 100644 --- a/packageconfig.json +++ b/packageconfig.json @@ -1,6 +1,6 @@ { "projectName" : "cloudmersive_convert_api_client", "packageName" : "cloudmersive_convert_api_client", - "packageVersion": "2.1.1", + "packageVersion": "2.1.2", "packageUrl": "https://www.cloudmersive.com/convert-api" } \ No newline at end of file diff --git a/setup.py b/setup.py index ac0d7ed..be6d9f2 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.1.1" +VERSION = "2.1.2" # To install the library, run the following # # python setup.py install diff --git a/test/test_docx_set_footer_add_page_number_request.py b/test/test_docx_set_footer_add_page_number_request.py new file mode 100644 index 0000000..dc4d21a --- /dev/null +++ b/test/test_docx_set_footer_add_page_number_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_set_footer_add_page_number_request import DocxSetFooterAddPageNumberRequest # noqa: E501 +from cloudmersive_convert_api_client.rest import ApiException + + +class TestDocxSetFooterAddPageNumberRequest(unittest.TestCase): + """DocxSetFooterAddPageNumberRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDocxSetFooterAddPageNumberRequest(self): + """Test DocxSetFooterAddPageNumberRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudmersive_convert_api_client.models.docx_set_footer_add_page_number_request.DocxSetFooterAddPageNumberRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()