@@ -1960,4 +1960,300 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
19601960 apiClient .executeAsync (call , localVarReturnType , callback );
19611961 return call ;
19621962 }
1963+
1964+ /**
1965+ * Build call for postCompress
1966+ * @param file File to upload (required)
1967+ * @param CompressLevel (required)
1968+ * @param progressListener Progress listener
1969+ * @param progressRequestListener Progress request listener
1970+ * @return Call to execute
1971+ * @throws ApiException If fail to serialize the request body object
1972+ */
1973+ public com .squareup .okhttp .Call postCompressCall (HashMap <String ,File > file , Integer CompressLevel , final ProgressResponseBody .ProgressListener progressListener , final ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
1974+ Object localVarPostBody = null ;
1975+
1976+ // create path and map variables
1977+ String localVarPath = "/cells/compress" ;
1978+
1979+ List <Pair > localVarQueryParams = new ArrayList <Pair >();
1980+ if (CompressLevel != null )
1981+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "CompressLevel" , CompressLevel ));
1982+
1983+ Map <String , String > localVarHeaderParams = new HashMap <String , String >();
1984+
1985+ Map <String , Object > localVarFormParams = new HashMap <String , Object >();
1986+ if (file != null ){
1987+ for (String key : file .keySet ()) {
1988+ localVarFormParams .put (key ,file .get (key ));
1989+ }
1990+ }
1991+ final String [] localVarAccepts = {
1992+ "application/json"
1993+ };
1994+ final String localVarAccept = apiClient .selectHeaderAccept (localVarAccepts );
1995+ if (localVarAccept != null ) localVarHeaderParams .put ("Accept" , localVarAccept );
1996+
1997+ final String [] localVarContentTypes = {
1998+ "multipart/form-data"
1999+ };
2000+ final String localVarContentType = apiClient .selectHeaderContentType (localVarContentTypes );
2001+ localVarHeaderParams .put ("Content-Type" , localVarContentType );
2002+
2003+ if (progressListener != null ) {
2004+ apiClient .getHttpClient ().networkInterceptors ().add (new com .squareup .okhttp .Interceptor () {
2005+ @ Override
2006+ public com .squareup .okhttp .Response intercept (com .squareup .okhttp .Interceptor .Chain chain ) throws IOException {
2007+ com .squareup .okhttp .Response originalResponse = chain .proceed (chain .request ());
2008+ return originalResponse .newBuilder ()
2009+ .body (new ProgressResponseBody (originalResponse .body (), progressListener ))
2010+ .build ();
2011+ }
2012+ });
2013+ }
2014+
2015+ String [] localVarAuthNames = new String [] { };
2016+ return apiClient .buildCall (localVarPath , "POST" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAuthNames , progressRequestListener );
2017+ }
2018+
2019+ @ SuppressWarnings ("rawtypes" )
2020+ private com .squareup .okhttp .Call postCompressValidateBeforeCall (HashMap <String ,File > file , Integer CompressLevel , final ProgressResponseBody .ProgressListener progressListener , final ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
2021+
2022+ // verify the required parameter 'file' is set
2023+ if (file == null ) {
2024+ throw new ApiException ("Missing the required parameter 'file' when calling postCompress(Async)" );
2025+ }
2026+
2027+ // verify the required parameter 'datasource' is set
2028+ if (CompressLevel == null ) {
2029+ throw new ApiException ("Missing the required parameter 'CompressLevel' when calling postCompress(Async)" );
2030+ }
2031+
2032+
2033+ com .squareup .okhttp .Call call = postCompressCall (file , CompressLevel , progressListener , progressRequestListener );
2034+ return call ;
2035+
2036+ }
2037+
2038+ /**
2039+ *
2040+ *
2041+ * @param file File to upload (required)
2042+ * @param CompressLevel (required)
2043+ * @return FilesResult
2044+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
2045+ */
2046+ public FilesResult postCompress (HashMap <String ,File > file , Integer CompressLevel ) throws ApiException {
2047+ ApiResponse <FilesResult > resp = postCompressWithHttpInfo (file ,CompressLevel );
2048+ return resp .getData ();
2049+ }
2050+
2051+ /**
2052+ *
2053+ *
2054+ * @param file File to upload (required)
2055+ * @param CompressLevel (required)
2056+ * @return ApiResponse<FilesResult>
2057+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
2058+ */
2059+ public ApiResponse <FilesResult > postCompressWithHttpInfo (HashMap <String ,File > file , Integer CompressLevel ) throws ApiException {
2060+ com .squareup .okhttp .Call call = postCompressValidateBeforeCall (file , CompressLevel , null , null );
2061+ Type localVarReturnType = new TypeToken <FilesResult >(){}.getType ();
2062+ return apiClient .execute (call , localVarReturnType );
2063+ }
2064+
2065+ /**
2066+ * (asynchronously)
2067+ *
2068+ * @param file File to upload (required)
2069+ * @param CompressLevel (required)
2070+ * @param callback The callback to be executed when the API call finishes
2071+ * @return The request call
2072+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
2073+ */
2074+ public com .squareup .okhttp .Call postCompressAsync (HashMap <String ,File > file , Integer CompressLevel , final ApiCallback <FilesResult > callback ) throws ApiException {
2075+
2076+ ProgressResponseBody .ProgressListener progressListener = null ;
2077+ ProgressRequestBody .ProgressRequestListener progressRequestListener = null ;
2078+
2079+ if (callback != null ) {
2080+ progressListener = new ProgressResponseBody .ProgressListener () {
2081+ @ Override
2082+ public void update (long bytesRead , long contentLength , boolean done ) {
2083+ callback .onDownloadProgress (bytesRead , contentLength , done );
2084+ }
2085+ };
2086+
2087+ progressRequestListener = new ProgressRequestBody .ProgressRequestListener () {
2088+ @ Override
2089+ public void onRequestProgress (long bytesWritten , long contentLength , boolean done ) {
2090+ callback .onUploadProgress (bytesWritten , contentLength , done );
2091+ }
2092+ };
2093+ }
2094+
2095+ com .squareup .okhttp .Call call = postCompressValidateBeforeCall (file , CompressLevel , progressListener , progressRequestListener );
2096+ Type localVarReturnType = new TypeToken <FilesResult >(){}.getType ();
2097+ apiClient .executeAsync (call , localVarReturnType , callback );
2098+ return call ;
2099+ }
2100+
2101+
2102+ /**
2103+ * Build call for postReplace
2104+ * @param file File to upload (required)
2105+ * @param text (required)
2106+ * @param newtext (required)
2107+ * @param password
2108+ * @param sheetname
2109+ * @param progressListener Progress listener
2110+ * @param progressRequestListener Progress request listener
2111+ * @return Call to execute
2112+ * @throws ApiException If fail to serialize the request body object
2113+ */
2114+ public com .squareup .okhttp .Call postReplaceCall (HashMap <String ,File > file , String text , String newtext ,String password , String sheetname , final ProgressResponseBody .ProgressListener progressListener , final ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
2115+ Object localVarPostBody = null ;
2116+
2117+ // create path and map variables
2118+ String localVarPath = "/cells/compress" ;
2119+
2120+ List <Pair > localVarQueryParams = new ArrayList <Pair >();
2121+ if (text != null )
2122+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "text" , text ));
2123+ if (newtext != null )
2124+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "newtext" , newtext ));
2125+ if (password != null )
2126+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "password" , password ));
2127+ if (sheetname != null )
2128+ localVarQueryParams .addAll (apiClient .parameterToPairs ("" , "sheetname" , sheetname ));
2129+ Map <String , String > localVarHeaderParams = new HashMap <String , String >();
2130+
2131+ Map <String , Object > localVarFormParams = new HashMap <String , Object >();
2132+ if (file != null ){
2133+ for (String key : file .keySet ()) {
2134+ localVarFormParams .put (key ,file .get (key ));
2135+ }
2136+ }
2137+ final String [] localVarAccepts = {
2138+ "application/json"
2139+ };
2140+ final String localVarAccept = apiClient .selectHeaderAccept (localVarAccepts );
2141+ if (localVarAccept != null ) localVarHeaderParams .put ("Accept" , localVarAccept );
2142+
2143+ final String [] localVarContentTypes = {
2144+ "multipart/form-data"
2145+ };
2146+ final String localVarContentType = apiClient .selectHeaderContentType (localVarContentTypes );
2147+ localVarHeaderParams .put ("Content-Type" , localVarContentType );
2148+
2149+ if (progressListener != null ) {
2150+ apiClient .getHttpClient ().networkInterceptors ().add (new com .squareup .okhttp .Interceptor () {
2151+ @ Override
2152+ public com .squareup .okhttp .Response intercept (com .squareup .okhttp .Interceptor .Chain chain ) throws IOException {
2153+ com .squareup .okhttp .Response originalResponse = chain .proceed (chain .request ());
2154+ return originalResponse .newBuilder ()
2155+ .body (new ProgressResponseBody (originalResponse .body (), progressListener ))
2156+ .build ();
2157+ }
2158+ });
2159+ }
2160+
2161+ String [] localVarAuthNames = new String [] { };
2162+ return apiClient .buildCall (localVarPath , "POST" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAuthNames , progressRequestListener );
2163+ }
2164+
2165+ @ SuppressWarnings ("rawtypes" )
2166+ private com .squareup .okhttp .Call postReplaceValidateBeforeCall (HashMap <String ,File > file , String text , String newtext ,String password , String sheetname , final ProgressResponseBody .ProgressListener progressListener , final ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
2167+
2168+ // verify the required parameter 'file' is set
2169+ if (file == null ) {
2170+ throw new ApiException ("Missing the required parameter 'file' when calling postReplace(Async)" );
2171+ }
2172+
2173+ // verify the required parameter 'datasource' is set
2174+ if (text == null ) {
2175+ throw new ApiException ("Missing the required parameter 'text' when calling postReplace(Async)" );
2176+ }
2177+ // verify the required parameter 'datasource' is set
2178+ if (newtext == null ) {
2179+ throw new ApiException ("Missing the required parameter 'newtext' when calling postReplace(Async)" );
2180+ }
2181+
2182+ com .squareup .okhttp .Call call = postReplaceCall (file , text ,newtext ,password ,sheetname , progressListener , progressRequestListener );
2183+ return call ;
2184+
2185+ }
2186+
2187+ /**
2188+ *
2189+ *
2190+ * @param file File to upload (required)
2191+ * @param text (required)
2192+ * @param newtext (required)
2193+ * @param password
2194+ * @param sheetname
2195+ * @return FilesResult
2196+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
2197+ */
2198+ public FilesResult postReplace (HashMap <String ,File > file , String text , String newtext ,String password , String sheetname ) throws ApiException {
2199+ ApiResponse <FilesResult > resp = postReplaceWithHttpInfo (file ,text ,newtext ,password ,sheetname );
2200+ return resp .getData ();
2201+ }
2202+
2203+ /**
2204+ *
2205+ *
2206+ * @param file File to upload (required)
2207+ * @param text (required)
2208+ * @param newtext (required)
2209+ * @param password
2210+ * @param sheetname
2211+ * @return ApiResponse<FilesResult>
2212+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
2213+ */
2214+ public ApiResponse <FilesResult > postReplaceWithHttpInfo (HashMap <String ,File > file , String text , String newtext ,String password , String sheetname ) throws ApiException {
2215+ com .squareup .okhttp .Call call = postReplaceValidateBeforeCall (file , text ,newtext ,password ,sheetname , null , null );
2216+ Type localVarReturnType = new TypeToken <FilesResult >(){}.getType ();
2217+ return apiClient .execute (call , localVarReturnType );
2218+ }
2219+
2220+ /**
2221+ * (asynchronously)
2222+ *
2223+ * @param file File to upload (required)
2224+ * @param text (required)
2225+ * @param newtext (required)
2226+ * @param password
2227+ * @param sheetname
2228+ * @param callback The callback to be executed when the API call finishes
2229+ * @return The request call
2230+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
2231+ */
2232+ public com .squareup .okhttp .Call postReplaceAsync (HashMap <String ,File > file , String text , String newtext ,String password , String sheetname , final ApiCallback <FilesResult > callback ) throws ApiException {
2233+
2234+ ProgressResponseBody .ProgressListener progressListener = null ;
2235+ ProgressRequestBody .ProgressRequestListener progressRequestListener = null ;
2236+
2237+ if (callback != null ) {
2238+ progressListener = new ProgressResponseBody .ProgressListener () {
2239+ @ Override
2240+ public void update (long bytesRead , long contentLength , boolean done ) {
2241+ callback .onDownloadProgress (bytesRead , contentLength , done );
2242+ }
2243+ };
2244+
2245+ progressRequestListener = new ProgressRequestBody .ProgressRequestListener () {
2246+ @ Override
2247+ public void onRequestProgress (long bytesWritten , long contentLength , boolean done ) {
2248+ callback .onUploadProgress (bytesWritten , contentLength , done );
2249+ }
2250+ };
2251+ }
2252+
2253+ com .squareup .okhttp .Call call = postReplaceValidateBeforeCall (file , text ,newtext ,password ,sheetname , progressListener , progressRequestListener );
2254+ Type localVarReturnType = new TypeToken <FilesResult >(){}.getType ();
2255+ apiClient .executeAsync (call , localVarReturnType , callback );
2256+ return call ;
2257+ }
2258+
19632259}
0 commit comments