Skip to content

Commit 3c855d5

Browse files
authored
v5.4.0 (#15)
- Add a new endpoint 'document move to folder'
1 parent 69731f9 commit 3c855d5

File tree

7 files changed

+230
-5
lines changed

7 files changed

+230
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Class | Method | HTTP request | Description
9898
*DocumentsApi* | [**delete_document**](docs/DocumentsApi.md#delete_document) | **DELETE** /public/v1/documents/{id} | Delete document by id
9999
*DocumentsApi* | [**delete_linked_object**](docs/DocumentsApi.md#delete_linked_object) | **DELETE** /public/v1/documents/{id}/linked-objects/{linked_object_id} | Delete Linked Object
100100
*DocumentsApi* | [**details_document**](docs/DocumentsApi.md#details_document) | **GET** /public/v1/documents/{id}/details | Document details
101+
*DocumentsApi* | [**document_move_to_folder**](docs/DocumentsApi.md#document_move_to_folder) | **DELETE** /public/v1/documents/{id}/move-to-folder/{folder_id} | Document move to folder
101102
*DocumentsApi* | [**download_document**](docs/DocumentsApi.md#download_document) | **GET** /public/v1/documents/{id}/download | Document download
102103
*DocumentsApi* | [**download_protected_document**](docs/DocumentsApi.md#download_protected_document) | **GET** /public/v1/documents/{id}/download-protected | Download document protected
103104
*DocumentsApi* | [**list_documents**](docs/DocumentsApi.md#list_documents) | **GET** /public/v1/documents | List documents

docs/DocumentsApi.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Method | HTTP request | Description
1111
[**delete_document**](DocumentsApi.md#delete_document) | **DELETE** /public/v1/documents/{id} | Delete document by id
1212
[**delete_linked_object**](DocumentsApi.md#delete_linked_object) | **DELETE** /public/v1/documents/{id}/linked-objects/{linked_object_id} | Delete Linked Object
1313
[**details_document**](DocumentsApi.md#details_document) | **GET** /public/v1/documents/{id}/details | Document details
14+
[**document_move_to_folder**](DocumentsApi.md#document_move_to_folder) | **DELETE** /public/v1/documents/{id}/move-to-folder/{folder_id} | Document move to folder
1415
[**download_document**](DocumentsApi.md#download_document) | **GET** /public/v1/documents/{id}/download | Document download
1516
[**download_protected_document**](DocumentsApi.md#download_protected_document) | **GET** /public/v1/documents/{id}/download-protected | Download document protected
1617
[**list_documents**](DocumentsApi.md#list_documents) | **GET** /public/v1/documents | List documents
@@ -745,6 +746,90 @@ Name | Type | Description | Notes
745746

746747
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
747748

749+
# **document_move_to_folder**
750+
> document_move_to_folder(id, folder_id)
751+
752+
Document move to folder
753+
754+
### Example
755+
756+
* Api Key Authentication (apiKey):
757+
* OAuth Authentication (oauth2):
758+
759+
```python
760+
import pandadoc_client
761+
from pandadoc_client.api import documents_api
762+
from pprint import pprint
763+
764+
# Defining the host is optional and defaults to https://api.pandadoc.com
765+
# See configuration.py for a list of all supported configuration parameters.
766+
configuration = pandadoc_client.Configuration(
767+
host="https://api.pandadoc.com",
768+
)
769+
770+
# The client must configure the authentication and authorization parameters
771+
# in accordance with the API server security policy.
772+
# Examples for each auth method are provided below, use the example that
773+
# satisfies your auth use case.
774+
775+
# Configure API key authorization: apiKey
776+
configuration.api_key['apiKey'] = 'YOUR_API_KEY'
777+
configuration.api_key_prefix['apiKey'] = 'API-Key'
778+
779+
# Configure OAuth2 access token for authorization: oauth2
780+
# configuration = pandadoc_client.Configuration(
781+
# host="https://api.pandadoc.com",
782+
# )
783+
# configuration.access_token = 'YOUR_ACCESS_TOKEN'
784+
785+
# Enter a context with an instance of the API client
786+
with pandadoc_client.ApiClient(configuration) as api_client:
787+
# Create an instance of the API class
788+
api_instance = documents_api.DocumentsApi(api_client)
789+
id = "ZPeAfcpzr9aiVs5vqUf6jg" # str | Specify document ID.
790+
folder_id = "ZPeAfcpzr9aiVs5vqUf6jg" # str | Specify folder ID.
791+
792+
# example passing only required values which don't have defaults set
793+
try:
794+
# Document move to folder
795+
api_instance.document_move_to_folder(id, folder_id)
796+
except pandadoc_client.ApiException as e:
797+
print("Exception when calling DocumentsApi->document_move_to_folder: %s\n" % e)
798+
```
799+
800+
### Parameters
801+
802+
Name | Type | Description | Notes
803+
------------- | ------------- | ------------- | -------------
804+
**id** | **str**| Specify document ID. |
805+
**folder_id** | **str**| Specify folder ID. |
806+
807+
### Return type
808+
809+
void (empty response body)
810+
811+
### Authorization
812+
813+
[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)
814+
815+
### HTTP request headers
816+
817+
- **Content-Type**: Not defined
818+
- **Accept**: application/json
819+
820+
821+
### HTTP response details
822+
823+
| Status code | Description | Response headers |
824+
|-------------|-------------|------------------|
825+
**204** | No content | - |
826+
**401** | Authentication error | - |
827+
**403** | Permission error | - |
828+
**404** | Not found | - |
829+
**429** | Too Many Requests | - |
830+
831+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
832+
748833
# **download_document**
749834
> file_type download_document(id)
750835

pandadoc_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010

1111

12-
__version__ = "5.3.0"
12+
__version__ = "5.4.0"
1313

1414
# import ApiClient
1515
from pandadoc_client.api_client import ApiClient

pandadoc_client/api/documents_api.py

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,64 @@ def __init__(self, api_client=None):
450450
},
451451
api_client=api_client
452452
)
453+
self.document_move_to_folder_endpoint = _Endpoint(
454+
settings={
455+
'response_type': None,
456+
'auth': [
457+
'apiKey',
458+
'oauth2'
459+
],
460+
'endpoint_path': '/public/v1/documents/{id}/move-to-folder/{folder_id}',
461+
'operation_id': 'document_move_to_folder',
462+
'http_method': 'DELETE',
463+
'servers': None,
464+
},
465+
params_map={
466+
'all': [
467+
'id',
468+
'folder_id',
469+
],
470+
'required': [
471+
'id',
472+
'folder_id',
473+
],
474+
'nullable': [
475+
],
476+
'enum': [
477+
],
478+
'validation': [
479+
]
480+
},
481+
root_map={
482+
'validations': {
483+
},
484+
'allowed_values': {
485+
},
486+
'openapi_types': {
487+
'id':
488+
(str,),
489+
'folder_id':
490+
(str,),
491+
},
492+
'attribute_map': {
493+
'id': 'id',
494+
'folder_id': 'folder_id',
495+
},
496+
'location_map': {
497+
'id': 'path',
498+
'folder_id': 'path',
499+
},
500+
'collection_format_map': {
501+
}
502+
},
503+
headers_map={
504+
'accept': [
505+
'application/json'
506+
],
507+
'content_type': [],
508+
},
509+
api_client=api_client
510+
)
453511
self.download_document_endpoint = _Endpoint(
454512
settings={
455513
'response_type': (file_type,),
@@ -1633,6 +1691,87 @@ def details_document(
16331691
id
16341692
return self.details_document_endpoint.call_with_http_info(**kwargs)
16351693

1694+
def document_move_to_folder(
1695+
self,
1696+
id,
1697+
folder_id,
1698+
**kwargs
1699+
):
1700+
"""Document move to folder # noqa: E501
1701+
1702+
This method makes a synchronous HTTP request by default. To make an
1703+
asynchronous HTTP request, please pass async_req=True
1704+
1705+
>>> thread = api.document_move_to_folder(id, folder_id, async_req=True)
1706+
>>> result = thread.get()
1707+
1708+
Args:
1709+
id (str): Specify document ID.
1710+
folder_id (str): Specify folder ID.
1711+
1712+
Keyword Args:
1713+
_return_http_data_only (bool): response data without head status
1714+
code and headers. Default is True.
1715+
_preload_content (bool): if False, the urllib3.HTTPResponse object
1716+
will be returned without reading/decoding response data.
1717+
Default is True.
1718+
_request_timeout (int/float/tuple): timeout setting for this request. If
1719+
one number provided, it will be total request timeout. It can also
1720+
be a pair (tuple) of (connection, read) timeouts.
1721+
Default is None.
1722+
_check_input_type (bool): specifies if type checking
1723+
should be done one the data sent to the server.
1724+
Default is True.
1725+
_check_return_type (bool): specifies if type checking
1726+
should be done one the data received from the server.
1727+
Default is True.
1728+
_spec_property_naming (bool): True if the variable names in the input data
1729+
are serialized names, as specified in the OpenAPI document.
1730+
False if the variable names in the input data
1731+
are pythonic names, e.g. snake case (default)
1732+
_content_type (str/None): force body content-type.
1733+
Default is None and content-type will be predicted by allowed
1734+
content-types and body.
1735+
_host_index (int/None): specifies the index of the server
1736+
that we want to use.
1737+
Default is read from the configuration.
1738+
async_req (bool): execute request asynchronously
1739+
1740+
Returns:
1741+
None
1742+
If the method is called asynchronously, returns the request
1743+
thread.
1744+
"""
1745+
kwargs['async_req'] = kwargs.get(
1746+
'async_req', False
1747+
)
1748+
kwargs['_return_http_data_only'] = kwargs.get(
1749+
'_return_http_data_only', True
1750+
)
1751+
kwargs['_preload_content'] = kwargs.get(
1752+
'_preload_content', True
1753+
)
1754+
kwargs['_request_timeout'] = kwargs.get(
1755+
'_request_timeout', None
1756+
)
1757+
kwargs['_check_input_type'] = kwargs.get(
1758+
'_check_input_type', True
1759+
)
1760+
kwargs['_check_return_type'] = kwargs.get(
1761+
'_check_return_type', True
1762+
)
1763+
kwargs['_spec_property_naming'] = kwargs.get(
1764+
'_spec_property_naming', False
1765+
)
1766+
kwargs['_content_type'] = kwargs.get(
1767+
'_content_type')
1768+
kwargs['_host_index'] = kwargs.get('_host_index')
1769+
kwargs['id'] = \
1770+
id
1771+
kwargs['folder_id'] = \
1772+
folder_id
1773+
return self.document_move_to_folder_endpoint.call_with_http_info(**kwargs)
1774+
16361775
def download_document(
16371776
self,
16381777
id,

pandadoc_client/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7575
self.default_headers[header_name] = header_value
7676
self.cookie = cookie
7777
# Set default User-Agent.
78-
self.user_agent = 'pandadoc_python_client/5.3.0'
78+
self.user_agent = 'pandadoc_python_client/5.4.0'
7979

8080
def __enter__(self):
8181
return self

pandadoc_client/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ def to_debug_report(self):
414414
return "Python SDK Debug Report:\n"\
415415
"OS: {env}\n"\
416416
"Python Version: {pyversion}\n"\
417-
"Version of the API: 5.3.0\n"\
418-
"SDK Package Version: 5.3.0".\
417+
"Version of the API: 5.4.0\n"\
418+
"SDK Package Version: 5.4.0".\
419419
format(env=sys.platform, pyversion=sys.version)
420420

421421
def get_host_settings(self):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
description = full_description[0:from_index] + full_description[to_index::]
1818

1919
NAME = "pandadoc-python-client"
20-
VERSION = "5.3.0"
20+
VERSION = "5.4.0"
2121
# To install the library, run the following
2222
#
2323
# python setup.py install

0 commit comments

Comments
 (0)