@@ -260,4 +260,38 @@ public static CreateKeyResult CreateTrialKey(String token, CreateTrialKeyModel m
260260
261261 return HelperMethods .SendRequestToWebAPI ("key/createtrialkey" , model , extraParams , CreateKeyResult .class , error );
262262 }
263+
264+ /**
265+ * This method will extend a license by a certain amount of days. If the key algorithm in the product is SKGL,
266+ * the key string will be changed if necessary. Otherwise, if SKM15 is used, the key will stay the same.
267+ * More about the way this method works in Remarks.
268+ * @param token The access token with 'CreateTrialKey' permission.
269+ * @param model Method parameters.
270+ * @param error The error object whose Message field will be populated if an error has occurred. Please initialize
271+ * this parameter, i.e. define <code>APIError error = new APIError();</code> and then pass
272+ * <code>error</code> into this parameter.
273+ * @return True if successful and false otherwise.
274+ */
275+ public static boolean ExtendLicense (String token , ExtendLicenseModel model , APIError error ) {
276+ Map <String , String > extraParams = new HashMap <>();
277+ extraParams .put ("token" , token );
278+
279+ BasicResult result = HelperMethods .SendRequestToWebAPI ("key/extendlicense" , model , extraParams , BasicResult .class , error );
280+
281+ if (result == null || result .result == 1 ) {
282+ if (result != null ) {
283+ if (error != null ) {
284+ error .message = result .message ;
285+ error .errorType = ErrorType .WebAPIError ;
286+ }
287+ } else {
288+ if (error != null ) {
289+ error .errorType = ErrorType .WebAPIError ;
290+ }
291+ }
292+ return false ;
293+ }
294+
295+ return true ;
296+ }
263297}
0 commit comments