@@ -674,14 +674,13 @@ def get_scripts_published_script_id_pages(self, script_id, **kwargs):
674674 :param callback function: The callback function
675675 for asynchronous request. (optional)
676676 :param str script_id: Script ID (required)
677- :param int foo:
678677 :param str script_data_version: Advanced usage - controls the data version of the script
679678 :return: list[Page]
680679 If the method is called asynchronously,
681680 returns the request thread.
682681 """
683682
684- all_params = ['script_id' , 'foo' , ' script_data_version' ]
683+ all_params = ['script_id' , 'script_data_version' ]
685684 all_params .append ('callback' )
686685
687686 params = locals ()
@@ -705,8 +704,6 @@ def get_scripts_published_script_id_pages(self, script_id, **kwargs):
705704 path_params ['scriptId' ] = params ['script_id' ]
706705
707706 query_params = {}
708- if 'foo' in params :
709- query_params ['foo' ] = params ['foo' ]
710707 if 'script_data_version' in params :
711708 query_params ['scriptDataVersion' ] = params ['script_data_version' ]
712709
@@ -912,3 +909,84 @@ def get_scripts_upload_status(self, upload_id, **kwargs):
912909 auth_settings = auth_settings ,
913910 callback = params .get ('callback' ))
914911 return response
912+
913+ def post_script_export (self , script_id , ** kwargs ):
914+ """
915+ Export a script via download service.
916+
917+
918+ This method makes a synchronous HTTP request by default. To make an
919+ asynchronous HTTP request, please define a `callback` function
920+ to be invoked when receiving the response.
921+ >>> def callback_function(response):
922+ >>> pprint(response)
923+ >>>
924+ >>> thread = api.post_script_export(script_id, callback=callback_function)
925+
926+ :param callback function: The callback function
927+ for asynchronous request. (optional)
928+ :param str script_id: Script ID (required)
929+ :param ExportScriptRequest body:
930+ :return: ExportScriptResponse
931+ If the method is called asynchronously,
932+ returns the request thread.
933+ """
934+
935+ all_params = ['script_id' , 'body' ]
936+ all_params .append ('callback' )
937+
938+ params = locals ()
939+ for key , val in iteritems (params ['kwargs' ]):
940+ if key not in all_params :
941+ raise TypeError (
942+ "Got an unexpected keyword argument '%s'"
943+ " to method post_script_export" % key
944+ )
945+ params [key ] = val
946+ del params ['kwargs' ]
947+
948+ # verify the required parameter 'script_id' is set
949+ if ('script_id' not in params ) or (params ['script_id' ] is None ):
950+ raise ValueError ("Missing the required parameter `script_id` when calling `post_script_export`" )
951+
952+
953+ resource_path = '/api/v2/scripts/{scriptId}/export' .replace ('{format}' , 'json' )
954+ path_params = {}
955+ if 'script_id' in params :
956+ path_params ['scriptId' ] = params ['script_id' ]
957+
958+ query_params = {}
959+
960+ header_params = {}
961+
962+ form_params = []
963+ local_var_files = {}
964+
965+ body_params = None
966+ if 'body' in params :
967+ body_params = params ['body' ]
968+
969+ # HTTP header `Accept`
970+ header_params ['Accept' ] = self .api_client .\
971+ select_header_accept (['application/json' ])
972+ if not header_params ['Accept' ]:
973+ del header_params ['Accept' ]
974+
975+ # HTTP header `Content-Type`
976+ header_params ['Content-Type' ] = self .api_client .\
977+ select_header_content_type (['application/json' ])
978+
979+ # Authentication setting
980+ auth_settings = ['PureCloud Auth' ]
981+
982+ response = self .api_client .call_api (resource_path , 'POST' ,
983+ path_params ,
984+ query_params ,
985+ header_params ,
986+ body = body_params ,
987+ post_params = form_params ,
988+ files = local_var_files ,
989+ response_type = 'ExportScriptResponse' ,
990+ auth_settings = auth_settings ,
991+ callback = params .get ('callback' ))
992+ return response
0 commit comments