Skip to content

Commit 5e6cca4

Browse files
committed
Release Aspose.Cells Cloud SDK 19.10
1 parent 8ef4120 commit 5e6cca4

27 files changed

+1224
-409
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Aspose.Cells Cloud SDK for Python [![NuGet](https://img.shields.io/nuget/v/Aspose.Cells-Cloud.svg)](https://www.nuget.org/packages/Aspose.Cells-Cloud/)
1+
# Aspose.Cells Cloud SDK for Python
22

33
- API version: 3.0
4-
- SDK version: 19.9
4+
- SDK version: 19.10
55

66
This repository contains Aspose.Cells Cloud SDK for Python source code. This SDK allows you to work with Aspose.Cells Cloud REST APIs in your Python applications quickly and easily, with zero initial cost.
77

asposecellscloud/api_client.py

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
8383
self.host = host
8484
self.cookie = cookie
8585
# Set default User-Agent.
86-
self.user_agent = 'Swagger-Codegen/19.9/python'
86+
self.user_agent = 'Swagger-Codegen/19.10/python'
8787

8888
@property
8989
def user_agent(self):
@@ -649,3 +649,95 @@ def __deserialize_model(self, data, klass):
649649
instance = klass(**kwargs)
650650

651651
return instance
652+
653+
def get_access_token(self, grant_type, client_id, client_secret, version, **kwargs):
654+
"""
655+
Get Access token
656+
This method makes a synchronous HTTP request by default. To make an
657+
asynchronous HTTP request, please define a `callback` function
658+
to be invoked when receiving the response.
659+
>>> def callback_function(response):
660+
>>> pprint(response)
661+
>>>
662+
>>> thread = api.o_auth_post_with_http_info(grant_type, client_id, client_secret, callback=callback_function)
663+
664+
:param callback function: The callback function
665+
for asynchronous request. (optional)
666+
:param str grant_type: Grant Type (required)
667+
:param str client_id: App SID (required)
668+
:param str client_secret: App Key (required)
669+
:return: AccessTokenResponse
670+
If the method is called asynchronously,
671+
returns the request thread.
672+
"""
673+
674+
all_params = ['grant_type', 'client_id', 'client_secret']
675+
all_params.append('callback')
676+
all_params.append('_return_http_data_only')
677+
all_params.append('_preload_content')
678+
all_params.append('_request_timeout')
679+
680+
params = locals()
681+
for key, val in iteritems(params['kwargs']):
682+
if key not in all_params:
683+
raise TypeError(
684+
"Got an unexpected keyword argument '%s'"
685+
" to method o_auth_post" % key
686+
)
687+
params[key] = val
688+
del params['kwargs']
689+
# verify the required parameter 'grant_type' is set
690+
if ('grant_type' not in params) or (params['grant_type'] is None):
691+
raise ValueError("Missing the required parameter `grant_type` when calling `o_auth_post`")
692+
# verify the required parameter 'client_id' is set
693+
if ('client_id' not in params) or (params['client_id'] is None):
694+
raise ValueError("Missing the required parameter `client_id` when calling `o_auth_post`")
695+
# verify the required parameter 'client_secret' is set
696+
if ('client_secret' not in params) or (params['client_secret'] is None):
697+
raise ValueError("Missing the required parameter `client_secret` when calling `o_auth_post`")
698+
oauthurl = '/connect/token'
699+
if version == 'v1.1':
700+
oauthurl = '/oauth2/token'
701+
702+
collection_formats = {}
703+
704+
path_params = {}
705+
706+
query_params = []
707+
708+
header_params = {}
709+
710+
form_params = []
711+
local_var_files = {}
712+
if 'grant_type' in params:
713+
form_params.append(('grant_type', params['grant_type']))
714+
if 'client_id' in params:
715+
form_params.append(('client_id', params['client_id']))
716+
if 'client_secret' in params:
717+
form_params.append(('client_secret', params['client_secret']))
718+
719+
body_params = None
720+
# HTTP header `Accept`
721+
header_params['Accept'] = self.select_header_accept(['application/json'])
722+
723+
# HTTP header `Content-Type`
724+
header_params['Content-Type'] = self.select_header_content_type(['application/x-www-form-urlencoded'])
725+
726+
# Authentication setting
727+
auth_settings = []
728+
729+
data = self.call_api(oauthurl, 'POST',
730+
path_params,
731+
query_params,
732+
header_params,
733+
body=body_params,
734+
post_params=form_params,
735+
files=local_var_files,
736+
response_type='AccessTokenResponse',
737+
auth_settings=auth_settings,
738+
callback=params.get('callback'),
739+
_return_http_data_only=params.get('_return_http_data_only'),
740+
_preload_content=params.get('_preload_content', True),
741+
_request_timeout=params.get('_request_timeout'),
742+
collection_formats=collection_formats)
743+
return data[0].access_token

0 commit comments

Comments
 (0)