@@ -57,8 +57,15 @@ def __downcase_first_letter(self, s):
57
57
def __request_token (self ):
58
58
config = self .api_client .configuration
59
59
api_version = config .api_version
60
+ request_url = ''
61
+ host = ''
60
62
config .api_version = ''
61
- request_url = "connect/token"
63
+ if config .auth_url is not None :
64
+ host = config .host
65
+ config .host = config .auth_url
66
+ else :
67
+ request_url = "connect/token"
68
+
62
69
form_params = [('grant_type' , 'client_credentials' ), ('client_id' , config .api_key ['app_sid' ]),
63
70
('client_secret' , config .api_key ['api_key' ])]
64
71
@@ -72,6 +79,8 @@ def __request_token(self):
72
79
response_type = 'object' ,
73
80
files = {}, _return_http_data_only = True )
74
81
access_token = data ['access_token' ] if six .PY3 else data ['access_token' ].encode ('utf8' )
82
+ if config .auth_url is not None :
83
+ config .host = host
75
84
self .api_client .configuration .access_token = access_token
76
85
self .api_client .configuration .api_version = api_version
77
86
@@ -8869,8 +8878,129 @@ def post_task_recurring_info_with_http_info(self, request, **kwargs): # noqa: E
8869
8878
_request_timeout = params .get ('_request_timeout' ),
8870
8879
collection_formats = collection_formats )
8871
8880
8881
+ def post_tasks (self , request , ** kwargs ): # noqa: E501
8882
+ """Create multiple tasks by single request. # noqa: E501
8883
+
8884
+ This method makes a synchronous HTTP request by default. To make an
8885
+ asynchronous HTTP request, please pass is_async=True
8886
+
8887
+ :param is_async bool
8888
+ :param name str : The name of the file. (required)
8889
+ :param requests list[TaskCreationRequest] : Requests to create tasks. (required)
8890
+ :param file_name str : The name of the project document to save changes to.
8891
+ :param storage str : The document storage.
8892
+ :param folder str : The document folder.
8893
+ :return: TaskItemsResponse
8894
+ If the method is called asynchronously,
8895
+ returns the request thread.
8896
+ """
8897
+ kwargs ['_return_http_data_only' ] = True
8898
+ try :
8899
+ if kwargs .get ('is_async' ):
8900
+ return self .post_tasks_with_http_info (request , ** kwargs ) # noqa: E501
8901
+ (data ) = self .post_tasks_with_http_info (request , ** kwargs ) # noqa: E501
8902
+ return data
8903
+ except ApiException as e :
8904
+ if e .status == 401 :
8905
+ self .__request_token ()
8906
+ if kwargs .get ('is_async' ):
8907
+ return self .post_tasks_with_http_info (request , ** kwargs ) # noqa: E501
8908
+ (data ) = self .post_tasks_with_http_info (request , ** kwargs ) # noqa: E501
8909
+ return data
8910
+
8911
+ def post_tasks_with_http_info (self , request , ** kwargs ): # noqa: E501
8912
+ """Create multiple tasks by single request. # noqa: E501
8913
+
8914
+ This method makes a synchronous HTTP request by default. To make an
8915
+ asynchronous HTTP request, please pass is_async=True
8916
+
8917
+ :param is_async bool
8918
+ :param request post_tasks_request object with parameters
8919
+ :return: TaskItemsResponse
8920
+ If the method is called asynchronously,
8921
+ returns the request thread.
8922
+ """
8923
+
8924
+ params = locals ()
8925
+ params ['is_async' ] = ''
8926
+ params ['_return_http_data_only' ] = False
8927
+ params ['_preload_content' ] = True
8928
+ params ['_request_timeout' ] = ''
8929
+ for key , val in six .iteritems (params ['kwargs' ]):
8930
+ if key not in params :
8931
+ raise TypeError (
8932
+ "Got an unexpected keyword argument '%s'"
8933
+ " to method post_tasks" % key
8934
+ )
8935
+ params [key ] = val
8936
+ del params ['kwargs' ]
8937
+ # verify the required parameter 'name' is set
8938
+ if request .name is None :
8939
+ raise ValueError ("Missing the required parameter `name` when calling `post_tasks`" ) # noqa: E501
8940
+ # verify the required parameter 'requests' is set
8941
+ if request .requests is None :
8942
+ raise ValueError ("Missing the required parameter `requests` when calling `post_tasks`" ) # noqa: E501
8943
+
8944
+ collection_formats = {}
8945
+ path = '/tasks/{name}/tasks/batch'
8946
+ path_params = {}
8947
+ if request .name is not None :
8948
+ path_params [self .__downcase_first_letter ('name' )] = request .name # noqa: E501
8949
+
8950
+ query_params = []
8951
+ if '{' + self .__downcase_first_letter ('fileName' ) + '}' in path :
8952
+ path = path .replace ('{' + self .__downcase_first_letter ('fileName' + '}' ), request .file_name if request .file_name is not None else '' )
8953
+ else :
8954
+ if request .file_name is not None :
8955
+ query_params .append ((self .__downcase_first_letter ('fileName' ), request .file_name )) # noqa: E501
8956
+ if '{' + self .__downcase_first_letter ('storage' ) + '}' in path :
8957
+ path = path .replace ('{' + self .__downcase_first_letter ('storage' + '}' ), request .storage if request .storage is not None else '' )
8958
+ else :
8959
+ if request .storage is not None :
8960
+ query_params .append ((self .__downcase_first_letter ('storage' ), request .storage )) # noqa: E501
8961
+ if '{' + self .__downcase_first_letter ('folder' ) + '}' in path :
8962
+ path = path .replace ('{' + self .__downcase_first_letter ('folder' + '}' ), request .folder if request .folder is not None else '' )
8963
+ else :
8964
+ if request .folder is not None :
8965
+ query_params .append ((self .__downcase_first_letter ('folder' ), request .folder )) # noqa: E501
8966
+
8967
+ header_params = {}
8968
+
8969
+ form_params = []
8970
+ local_var_files = []
8971
+
8972
+ body_params = None
8973
+ if request .requests is not None :
8974
+ body_params = request .requests
8975
+ # HTTP header `Accept`
8976
+ header_params ['Accept' ] = self .api_client .select_header_accept (
8977
+ ['application/json' ]) # noqa: E501
8978
+
8979
+ # HTTP header `Content-Type`
8980
+ header_params ['Content-Type' ] = self .api_client .select_header_content_type ( # noqa: E501
8981
+ ['application/json' ]) # noqa: E501
8982
+
8983
+ # Authentication setting
8984
+ auth_settings = ['JWT' ] # noqa: E501
8985
+
8986
+ return self .api_client .call_api (
8987
+ path , 'POST' ,
8988
+ path_params ,
8989
+ query_params ,
8990
+ header_params ,
8991
+ body = body_params ,
8992
+ post_params = form_params ,
8993
+ files = local_var_files ,
8994
+ response_type = 'TaskItemsResponse' , # noqa: E501
8995
+ auth_settings = auth_settings ,
8996
+ is_async = params .get ('is_async' ),
8997
+ _return_http_data_only = params .get ('_return_http_data_only' ),
8998
+ _preload_content = params .get ('_preload_content' , True ),
8999
+ _request_timeout = params .get ('_request_timeout' ),
9000
+ collection_formats = collection_formats )
9001
+
8872
9002
def put_move_task (self , request , ** kwargs ): # noqa: E501
8873
- """Move one task to another parent task # noqa: E501
9003
+ """Move one task to another parent task. # noqa: E501
8874
9004
8875
9005
This method makes a synchronous HTTP request by default. To make an
8876
9006
asynchronous HTTP request, please pass is_async=True
@@ -8901,7 +9031,7 @@ def put_move_task(self, request, **kwargs): # noqa: E501
8901
9031
return data
8902
9032
8903
9033
def put_move_task_with_http_info (self , request , ** kwargs ): # noqa: E501
8904
- """Move one task to another parent task # noqa: E501
9034
+ """Move one task to another parent task. # noqa: E501
8905
9035
8906
9036
This method makes a synchronous HTTP request by default. To make an
8907
9037
asynchronous HTTP request, please pass is_async=True
0 commit comments