@@ -663,6 +663,122 @@ def post_export_with_http_info(self, file, object_type, format, **kwargs):
663
663
_request_timeout = params .get ('_request_timeout' ),
664
664
collection_formats = collection_formats )
665
665
666
+ def post_import (self , file , import_data , ** kwargs ):
667
+ """
668
+ This method makes a synchronous HTTP request by default. To make an
669
+ asynchronous HTTP request, please define a `callback` function
670
+ to be invoked when receiving the response.
671
+ >>> def callback_function(response):
672
+ >>> pprint(response)
673
+ >>>
674
+ >>> thread = api.post_import(file, import_data, callback=callback_function)
675
+
676
+ :param callback function: The callback function
677
+ for asynchronous request. (optional)
678
+ :param file file: File to upload (required)
679
+ :param ImportOption import_data: (required)
680
+ :return: FilesResult
681
+ If the method is called asynchronously,
682
+ returns the request thread.
683
+ """
684
+ kwargs ['_return_http_data_only' ] = True
685
+ self .check_access_token ()
686
+ if kwargs .get ('callback' ):
687
+ return self .post_import_with_http_info (file , import_data , ** kwargs )
688
+ else :
689
+ (data ) = self .post_import_with_http_info (file , import_data , ** kwargs )
690
+ return data
691
+
692
+ def post_import_with_http_info (self , file , import_data , ** kwargs ):
693
+ """
694
+ This method makes a synchronous HTTP request by default. To make an
695
+ asynchronous HTTP request, please define a `callback` function
696
+ to be invoked when receiving the response.
697
+ >>> def callback_function(response):
698
+ >>> pprint(response)
699
+ >>>
700
+ >>> thread = api.post_import_with_http_info(file, import_data, callback=callback_function)
701
+
702
+ :param callback function: The callback function
703
+ for asynchronous request. (optional)
704
+ :param file file: File to upload (required)
705
+ :param ImportOption import_data: (required)
706
+ :return: FilesResult
707
+ If the method is called asynchronously,
708
+ returns the request thread.
709
+ """
710
+
711
+ all_params = ['file' , 'import_data' ]
712
+ all_params .append ('callback' )
713
+ all_params .append ('_return_http_data_only' )
714
+ all_params .append ('_preload_content' )
715
+ all_params .append ('_request_timeout' )
716
+
717
+ params = locals ()
718
+ for key , val in iteritems (params ['kwargs' ]):
719
+ if key not in all_params :
720
+ raise TypeError (
721
+ "Got an unexpected keyword argument '%s'"
722
+ " to method post_import" % key
723
+ )
724
+ params [key ] = val
725
+ del params ['kwargs' ]
726
+ # verify the required parameter 'file' is set
727
+ if ('file' not in params ) or (params ['file' ] is None ):
728
+ raise ValueError ("Missing the required parameter `file` when calling `post_import`" )
729
+ # verify the required parameter 'import_data' is set
730
+ if ('import_data' not in params ) or (params ['import_data' ] is None ):
731
+ raise ValueError ("Missing the required parameter `import_data` when calling `post_import`" )
732
+
733
+
734
+ collection_formats = {}
735
+
736
+ path_params = {}
737
+
738
+ query_params = []
739
+
740
+ header_params = {}
741
+
742
+ form_params = []
743
+ local_var_files = {}
744
+ if 'file' in params :
745
+
746
+ if isinstance (params ['file' ],dict ):
747
+ for filename , filecontext in params ['file' ].items ():
748
+ local_var_files [filename ] = filecontext
749
+ else :
750
+ local_var_files ['file' ] = params ['file' ]
751
+
752
+
753
+ body_params = None
754
+ if 'import_data' in params :
755
+ body_params = params ['import_data' ]
756
+ # HTTP header `Accept`
757
+ header_params ['Accept' ] = self .api_client .\
758
+ select_header_accept (['application/json' ])
759
+
760
+ # HTTP header `Content-Type`
761
+ header_params ['Content-Type' ] = self .api_client .\
762
+ select_header_content_type (['multipart/form-data' ])
763
+
764
+ # Authentication setting
765
+ auth_settings = []
766
+
767
+ return self .api_client .call_api ('/cells/import' , 'POST' ,
768
+ path_params ,
769
+ query_params ,
770
+ header_params ,
771
+ body = body_params ,
772
+ post_params = form_params ,
773
+ files = local_var_files ,
774
+ response_type = 'FilesResult' ,
775
+ auth_settings = auth_settings ,
776
+ callback = params .get ('callback' ),
777
+ _return_http_data_only = params .get ('_return_http_data_only' ),
778
+ _preload_content = params .get ('_preload_content' , True ),
779
+ _request_timeout = params .get ('_request_timeout' ),
780
+ collection_formats = collection_formats )
781
+
666
782
def post_merge (self , file , ** kwargs ):
667
783
"""
668
784
This method makes a synchronous HTTP request by default. To make an
0 commit comments