Skip to content

Commit fa506fe

Browse files
Merge pull request #5 from kaferi/master
Updated to 18.7
2 parents 9a6ec91 + 6d2ce11 commit fa506fe

File tree

113 files changed

+13042
-13113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+13042
-13113
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.mht -crlf -diff

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Aspose.Pdf for Cloud
2-
[Aspose.Pdf for Cloud](https://products.aspose.cloud/pdf/cloud) is a true REST API that enables you to perform a wide range of document processing operations including creation, manipulation, conversion and rendering of Pdf documents in the cloud.
1+
# Aspose.PDF Cloud
2+
[Aspose.PDF Cloud](https://products.aspose.cloud/pdf/cloud) is a true REST API that enables you to perform a wide range of document processing operations including creation, manipulation, conversion and rendering of Pdf documents in the cloud.
33

4-
Our Cloud SDKs are wrappers around REST API in various programming languages, allowing you to process documents in language of your choice quickly and easily, gaining all benefits of strong types and IDE highlights. This repository contains new generation SDKs for Aspose.Pdf for Cloud and examples.
4+
Our Cloud SDKs are wrappers around REST API in various programming languages, allowing you to process documents in language of your choice quickly and easily, gaining all benefits of strong types and IDE highlights. This repository contains new generation SDKs for Aspose.PDF Cloud and examples.
55

66
These SDKs are now fully supported. If you have any questions, see any bugs or have enhancement request, feel free to reach out to us at [Free Support Forums](https://forum.aspose.cloud/c/pdf).
77

@@ -41,7 +41,7 @@ class SdkUsage(object):
4141
Aspose PDF SDK includes a suite of unit tests within the "test" subdirectory. These Unit Tests also serves as examples of how to use the Aspose PDF SDK.
4242

4343
## Licensing
44-
All Aspose.Pdf for Cloud SDKs are licensed under [MIT License](LICENSE).
44+
All Aspose.PDF Cloud SDKs are licensed under [MIT License](LICENSE).
4545

4646
## Resources
4747
+ [**Website**](https://www.aspose.cloud)

__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
Aspose.PDF for Cloud API Reference
4+
Aspose.PDF Cloud API Reference
55
66
7-
Copyright (c) 2018 Aspose.Pdf for Cloud
7+
Copyright (c) 2018 Aspose.PDF Cloud
88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
1010
in the Software without restriction, including without limitation the rights
@@ -25,7 +25,6 @@
2525
2626
OpenAPI spec version: 1.1
2727
28-
Generated by: https://github.com/swagger-api/swagger-codegen.git
2928
"""
3029

3130

asposepdfcloud/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
Aspose.PDF for Cloud API Reference
4+
Aspose.PDF Cloud API Reference
55
66
7-
Copyright (c) 2018 Aspose.Pdf for Cloud
7+
Copyright (c) 2018 Aspose.PDF Cloud
88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
1010
in the Software without restriction, including without limitation the rights
@@ -25,7 +25,6 @@
2525
2626
OpenAPI spec version: 1.1
2727
28-
Generated by: https://github.com/swagger-api/swagger-codegen.git
2928
"""
3029

3130

asposepdfcloud/api_client.py

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# coding: utf-8
22
"""
3-
Aspose.PDF for Cloud API Reference
3+
Aspose.PDF Cloud API Reference
44
55
6-
Copyright (c) 2018 Aspose.Pdf for Cloud
6+
Copyright (c) 2018 Aspose.PDF Cloud
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal
99
in the Software without restriction, including without limitation the rights
@@ -24,7 +24,6 @@
2424
2525
OpenAPI spec version: 1.1
2626
27-
Generated by: https://github.com/swagger-api/swagger-codegen.git
2827
"""
2928

3029
from __future__ import absolute_import
@@ -37,6 +36,7 @@
3736
import threading
3837

3938
from datetime import date, datetime
39+
from asposepdfcloud.models.http_status_code import HttpStatusCode
4040

4141
# python 2 and python 3 compatibility library
4242
from six import PY3, integer_types, iteritems, text_type
@@ -186,13 +186,24 @@ def __call_api(self, resource_path, method,
186186
self.__add_o_auth_token(header_params)
187187

188188

189-
# perform request and return response
190-
response_data = self.request(method, url,
191-
query_params=query_params,
192-
headers=header_params,
193-
post_params=post_params, body=body,
194-
_preload_content=_preload_content,
195-
_request_timeout=_request_timeout)
189+
try:
190+
# perform request and return response
191+
response_data = self.request(method, url,
192+
query_params=query_params,
193+
headers=header_params,
194+
post_params=post_params, body=body,
195+
_preload_content=_preload_content,
196+
_request_timeout=_request_timeout)
197+
except ApiException as error:
198+
if error.status == HttpStatusCode.UNAUTHORIZED:
199+
self.__refresh_token()
200+
self.__add_o_auth_token(header_params)
201+
response_data = self.request(method, url,
202+
query_params=query_params,
203+
headers=header_params,
204+
post_params=post_params, body=body,
205+
_preload_content=_preload_content,
206+
_request_timeout=_request_timeout)
196207

197208
self.last_response = response_data
198209

@@ -243,7 +254,36 @@ def __request_token(self):
243254

244255
data = json.loads(str(response_data.data))
245256
config.access_token = data['access_token']
257+
config.refresh_token = data['refresh_token']
258+
259+
def __refresh_token(self):
260+
config = Configuration()
261+
262+
# header parameters
263+
header_params = {"Content-Type" : "application/x-www-form-urlencoded"}
264+
265+
method = 'POST'
266+
267+
# post params
268+
post_params = {
269+
"grant_type" : "refresh_token",
270+
"refresh_token" : config.refresh_token
271+
}
272+
273+
# resource path
274+
resource_path = "/oauth2/token"
275+
276+
# request url
277+
url = self.host.replace("/v1.1", "") + resource_path
278+
279+
# perform request and return response
280+
response_data = self.request(method, url,
281+
headers=header_params,
282+
post_params=post_params)
246283

284+
data = json.loads(str(response_data.data))
285+
config.access_token = data['access_token']
286+
config.refresh_token = data['refresh_token']
247287

248288
def __add_o_auth_token(self, header_params):
249289
config = Configuration()

asposepdfcloud/apis/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
Aspose.PDF for Cloud API Reference
4+
Aspose.PDF Cloud API Reference
55
66
7-
Copyright (c) 2018 Aspose.Pdf for Cloud
7+
Copyright (c) 2018 Aspose.PDF Cloud
88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
1010
in the Software without restriction, including without limitation the rights
@@ -25,7 +25,6 @@
2525
2626
OpenAPI spec version: 1.1
2727
28-
Generated by: https://github.com/swagger-api/swagger-codegen.git
2928
"""
3029

3130

asposepdfcloud/apis/pdf_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
Aspose.PDF for Cloud API Reference
4+
Aspose.PDF Cloud API Reference
55

66

7-
Copyright (c) 2018 Aspose.Pdf for Cloud
7+
Copyright (c) 2018 Aspose.PDF Cloud
88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
1010
in the Software without restriction, including without limitation the rights
@@ -25,7 +25,6 @@
2525

2626
OpenAPI spec version: 1.1
2727

28-
Generated by: https://github.com/swagger-api/swagger-codegen.git
2928
"""
3029

3130

asposepdfcloud/configuration.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
Aspose.PDF for Cloud API Reference
4+
Aspose.PDF Cloud API Reference
55
66
7-
Copyright (c) 2018 Aspose.Pdf for Cloud
7+
Copyright (c) 2018 Aspose.PDF Cloud
88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
1010
in the Software without restriction, including without limitation the rights
@@ -25,7 +25,6 @@
2525
2626
OpenAPI spec version: 1.1
2727
28-
Generated by: https://github.com/swagger-api/swagger-codegen.git
2928
"""
3029

3130

@@ -68,16 +67,13 @@ def __init__(self):
6867
self.api_client = None
6968
# Temp file folder for downloading files
7069
self.temp_folder_path = None
71-
72-
# Authentication Settings
73-
# App Key
74-
self.app_key = ""
75-
# App Key
76-
self.app_sid = ""
7770

7871
# access token for OAuth
7972
self.access_token = ""
8073

74+
# refresh token for OAuth
75+
self.refresh_token = ""
76+
8177
# Logging Settings
8278
self.logger = {}
8379
self.logger["package_logger"] = logging.getLogger("swagger_client")
@@ -206,5 +202,5 @@ def to_debug_report(self):
206202
"OS: {env}\n"\
207203
"Python Version: {pyversion}\n"\
208204
"Version of the API: 1.1\n"\
209-
"SDK Package Version: 18.6.0".\
205+
"SDK Package Version: 18.7.0".\
210206
format(env=sys.platform, pyversion=sys.version)

asposepdfcloud/models/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
Aspose.PDF for Cloud API Reference
4+
Aspose.PDF Cloud API Reference
55
66
7-
Copyright (c) 2018 Aspose.Pdf for Cloud
7+
Copyright (c) 2018 Aspose.PDF Cloud
88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
1010
in the Software without restriction, including without limitation the rights
@@ -25,7 +25,6 @@
2525
2626
OpenAPI spec version: 1.1
2727
28-
Generated by: https://github.com/swagger-api/swagger-codegen.git
2928
"""
3029

3130

asposepdfcloud/models/annotation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
Aspose.PDF for Cloud API Reference
4+
Aspose.PDF Cloud API Reference
55
66
7-
Copyright (c) 2018 Aspose.Pdf for Cloud
7+
Copyright (c) 2018 Aspose.PDF Cloud
88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
1010
in the Software without restriction, including without limitation the rights
@@ -25,7 +25,6 @@
2525
2626
OpenAPI spec version: 1.1
2727
28-
Generated by: https://github.com/swagger-api/swagger-codegen.git
2928
"""
3029

3130

0 commit comments

Comments
 (0)