@@ -1621,3 +1621,253 @@ def post_watermark_with_http_info(self, file, text, color, **kwargs):
16211621 _preload_content = params .get ('_preload_content' , True ),
16221622 _request_timeout = params .get ('_request_timeout' ),
16231623 collection_formats = collection_formats )
1624+
1625+ def post_compress (self , file , compress_level , ** kwargs ):
1626+ """
1627+ This method makes a synchronous HTTP request by default. To make an
1628+ asynchronous HTTP request, please define a `callback` function
1629+ to be invoked when receiving the response.
1630+ >>> def callback_function(response):
1631+ >>> pprint(response)
1632+ >>>
1633+ >>> thread = api.post_compress(file, compress_level, callback=callback_function)
1634+
1635+ :param callback function: The callback function
1636+ for asynchronous request. (optional)
1637+ :param file file: File to upload (required)
1638+ :param int compress_level: (required)
1639+ :return: FilesResult
1640+ If the method is called asynchronously,
1641+ returns the request thread.
1642+ """
1643+ kwargs ['_return_http_data_only' ] = True
1644+ self .check_access_token ()
1645+ if kwargs .get ('callback' ):
1646+ return self .post_compress_with_http_info (file , compress_level , ** kwargs )
1647+ else :
1648+ (data ) = self .post_compress_with_http_info (file , compress_level , ** kwargs )
1649+ return data
1650+
1651+ def post_compress_with_http_info (self , file , compress_level , ** kwargs ):
1652+ """
1653+ This method makes a synchronous HTTP request by default. To make an
1654+ asynchronous HTTP request, please define a `callback` function
1655+ to be invoked when receiving the response.
1656+ >>> def callback_function(response):
1657+ >>> pprint(response)
1658+ >>>
1659+ >>> thread = api.post_compress_with_http_info(file, compress_level, callback=callback_function)
1660+
1661+ :param callback function: The callback function
1662+ for asynchronous request. (optional)
1663+ :param file file: File to upload (required)
1664+ :param int compress_level: (required)
1665+ :return: FilesResult
1666+ If the method is called asynchronously,
1667+ returns the request thread.
1668+ """
1669+
1670+ all_params = ['file' , 'compress_level' ]
1671+ all_params .append ('callback' )
1672+ all_params .append ('_return_http_data_only' )
1673+ all_params .append ('_preload_content' )
1674+ all_params .append ('_request_timeout' )
1675+
1676+ params = locals ()
1677+ for key , val in iteritems (params ['kwargs' ]):
1678+ if key not in all_params :
1679+ raise TypeError (
1680+ "Got an unexpected keyword argument '%s'"
1681+ " to method post_compress" % key
1682+ )
1683+ params [key ] = val
1684+ del params ['kwargs' ]
1685+ # verify the required parameter 'file' is set
1686+ if ('file' not in params ) or (params ['file' ] is None ):
1687+ raise ValueError ("Missing the required parameter `file` when calling `post_compress`" )
1688+ # verify the required parameter 'compress_level' is set
1689+ if ('compress_level' not in params ) or (params ['compress_level' ] is None ):
1690+ raise ValueError ("Missing the required parameter `compress_level` when calling `post_compress`" )
1691+
1692+
1693+
1694+ collection_formats = {}
1695+
1696+ path_params = {}
1697+
1698+ query_params = []
1699+ if 'compress_level' in params :
1700+ query_params .append (('compressLevel' , params ['compress_level' ]))
1701+
1702+
1703+ header_params = {}
1704+
1705+ form_params = []
1706+ local_var_files = {}
1707+ if 'file' in params :
1708+
1709+ if isinstance (params ['file' ],dict ):
1710+ for filename , filecontext in params ['file' ].items ():
1711+ local_var_files [filename ] = filecontext
1712+ else :
1713+ local_var_files ['File' ] = params ['file' ]
1714+
1715+
1716+ body_params = None
1717+ # HTTP header `Accept`
1718+ header_params ['Accept' ] = self .api_client .\
1719+ select_header_accept (['application/json' ])
1720+
1721+ # HTTP header `Content-Type`
1722+ header_params ['Content-Type' ] = self .api_client .\
1723+ select_header_content_type (['multipart/form-data' ])
1724+
1725+ # Authentication setting
1726+ auth_settings = []
1727+
1728+ return self .api_client .call_api ('/cells/compress' , 'POST' ,
1729+ path_params ,
1730+ query_params ,
1731+ header_params ,
1732+ body = body_params ,
1733+ post_params = form_params ,
1734+ files = local_var_files ,
1735+ response_type = 'FilesResult' ,
1736+ auth_settings = auth_settings ,
1737+ callback = params .get ('callback' ),
1738+ _return_http_data_only = params .get ('_return_http_data_only' ),
1739+ _preload_content = params .get ('_preload_content' , True ),
1740+ _request_timeout = params .get ('_request_timeout' ),
1741+ collection_formats = collection_formats )
1742+
1743+ def post_replace (self , file , text , newtext , ** kwargs ):
1744+ """
1745+ This method makes a synchronous HTTP request by default. To make an
1746+ asynchronous HTTP request, please define a `callback` function
1747+ to be invoked when receiving the response.
1748+ >>> def callback_function(response):
1749+ >>> pprint(response)
1750+ >>>
1751+ >>> thread = api.post_replace(file, text, color, callback=callback_function)
1752+
1753+ :param callback function: The callback function
1754+ for asynchronous request. (optional)
1755+ :param file file: File to upload (required)
1756+ :param str text: (required)
1757+ :param str newtext: (required)
1758+ :param str password: (optional)
1759+ :param str sheet_name: (optional)
1760+ :return: FilesResult
1761+ If the method is called asynchronously,
1762+ returns the request thread.
1763+ """
1764+ kwargs ['_return_http_data_only' ] = True
1765+ self .check_access_token ()
1766+ if kwargs .get ('callback' ):
1767+ return self .post_replace_with_http_info (file , text , newtext , ** kwargs )
1768+ else :
1769+ (data ) = self .post_replace_with_http_info (file , text , newtext , ** kwargs )
1770+ return data
1771+
1772+ def post_replace_with_http_info (self , file , text , newtext , ** kwargs ):
1773+ """
1774+ This method makes a synchronous HTTP request by default. To make an
1775+ asynchronous HTTP request, please define a `callback` function
1776+ to be invoked when receiving the response.
1777+ >>> def callback_function(response):
1778+ >>> pprint(response)
1779+ >>>
1780+ >>> thread = api.post_replace_with_http_info(file, text, newtext, callback=callback_function)
1781+
1782+ :param callback function: The callback function
1783+ for asynchronous request. (optional)
1784+ :param file file: File to upload (required)
1785+ :param str text: (required)
1786+ :param str newtext: (required)
1787+ :param str password: (optional)
1788+ :param str sheet_name: (optional)
1789+ :return: FilesResult
1790+ If the method is called asynchronously,
1791+ returns the request thread.
1792+ """
1793+
1794+ all_params = ['file' , 'text' , 'newtext' ,'password' ,'sheet_name' ]
1795+ all_params .append ('callback' )
1796+ all_params .append ('_return_http_data_only' )
1797+ all_params .append ('_preload_content' )
1798+ all_params .append ('_request_timeout' )
1799+
1800+ params = locals ()
1801+ for key , val in iteritems (params ['kwargs' ]):
1802+ if key not in all_params :
1803+ raise TypeError (
1804+ "Got an unexpected keyword argument '%s'"
1805+ " to method post_replace" % key
1806+ )
1807+ params [key ] = val
1808+ del params ['kwargs' ]
1809+ # verify the required parameter 'file' is set
1810+ if ('file' not in params ) or (params ['file' ] is None ):
1811+ raise ValueError ("Missing the required parameter `file` when calling `post_replace`" )
1812+ # verify the required parameter 'text' is set
1813+ if ('text' not in params ) or (params ['text' ] is None ):
1814+ raise ValueError ("Missing the required parameter `text` when calling `post_replace`" )
1815+ # verify the required parameter 'newtext' is set
1816+ if ('newtext' not in params ) or (params ['newtext' ] is None ):
1817+ raise ValueError ("Missing the required parameter `newtext` when calling `post_replace`" )
1818+
1819+
1820+ collection_formats = {}
1821+
1822+ path_params = {}
1823+
1824+ query_params = []
1825+ if 'text' in params :
1826+ query_params .append (('text' , params ['text' ]))
1827+ if 'newtext' in params :
1828+ query_params .append (('newtext' , params ['newtext' ]))
1829+ if 'password' in params :
1830+ query_params .append (('password' , params ['password' ]))
1831+ if 'sheet_name' in params :
1832+ query_params .append (('sheetname' , params ['sheet_name' ]))
1833+
1834+
1835+ header_params = {}
1836+
1837+ form_params = []
1838+ local_var_files = {}
1839+ if 'file' in params :
1840+
1841+ if isinstance (params ['file' ],dict ):
1842+ for filename , filecontext in params ['file' ].items ():
1843+ local_var_files [filename ] = filecontext
1844+ else :
1845+ local_var_files ['File' ] = params ['file' ]
1846+
1847+
1848+ body_params = None
1849+ # HTTP header `Accept`
1850+ header_params ['Accept' ] = self .api_client .\
1851+ select_header_accept (['application/json' ])
1852+
1853+ # HTTP header `Content-Type`
1854+ header_params ['Content-Type' ] = self .api_client .\
1855+ select_header_content_type (['multipart/form-data' ])
1856+
1857+ # Authentication setting
1858+ auth_settings = []
1859+
1860+ return self .api_client .call_api ('/cells/replace' , 'POST' ,
1861+ path_params ,
1862+ query_params ,
1863+ header_params ,
1864+ body = body_params ,
1865+ post_params = form_params ,
1866+ files = local_var_files ,
1867+ response_type = 'FilesResult' ,
1868+ auth_settings = auth_settings ,
1869+ callback = params .get ('callback' ),
1870+ _return_http_data_only = params .get ('_return_http_data_only' ),
1871+ _preload_content = params .get ('_preload_content' , True ),
1872+ _request_timeout = params .get ('_request_timeout' ),
1873+ collection_formats = collection_formats )
0 commit comments