|
1 | 1 | /* |
2 | 2 | * The MIT License (MIT) |
3 | 3 | * |
4 | | -* Copyright (c) 2003-2021 Aspose Pty Ltd |
| 4 | +* Copyright (c) 2003-2022 Aspose Pty Ltd |
5 | 5 | * |
6 | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | 7 | * of this software and associated documentation files (the "Software"), to deal |
@@ -639,6 +639,63 @@ export class InfoApi { |
639 | 639 | return Promise.resolve(result); |
640 | 640 | } |
641 | 641 |
|
| 642 | +} |
| 643 | +/** |
| 644 | + * GroupDocs.Editor Cloud API |
| 645 | + */ |
| 646 | +export class LicenseApi { |
| 647 | + |
| 648 | + /** |
| 649 | + * Creates new instance of LicenseApi |
| 650 | + * @param appSid Application identifier (App SID). |
| 651 | + * @param appKey Application private key (App Key). |
| 652 | + */ |
| 653 | + public static fromKeys(appSid: string, appKey: string) { |
| 654 | + const config = new Configuration(appSid, appKey); |
| 655 | + return new LicenseApi(config); |
| 656 | + } |
| 657 | + |
| 658 | + /** |
| 659 | + * Creates new instance of LicenseApi |
| 660 | + * @param config API configuration. |
| 661 | + */ |
| 662 | + public static fromConfig(config: Configuration) { |
| 663 | + return new LicenseApi(config); |
| 664 | + } |
| 665 | + |
| 666 | + /** |
| 667 | + * Configuration |
| 668 | + */ |
| 669 | + private configuration: Configuration; |
| 670 | + |
| 671 | + /** |
| 672 | + * @param config Configuration. |
| 673 | + */ |
| 674 | + private constructor(config: Configuration) { |
| 675 | + this.configuration = config; |
| 676 | + } |
| 677 | + |
| 678 | + /** |
| 679 | + * Get license consumption |
| 680 | + * @param requestObj contains request parameters |
| 681 | + */ |
| 682 | + public async getConsumptionCredit(): Promise<model.ConsumptionResult> { |
| 683 | + |
| 684 | + const localVarPath = this.configuration.getServerUrl() + "/editor/consumption"; |
| 685 | + const queryParameters: any = {}; |
| 686 | + |
| 687 | + const requestOptions: request.Options = { |
| 688 | + method: "GET", |
| 689 | + qs: queryParameters, |
| 690 | + uri: localVarPath, |
| 691 | + json: true, |
| 692 | + }; |
| 693 | + |
| 694 | + const response = await invokeApiMethod(requestOptions, this.configuration); |
| 695 | + const result = Serializer.deserialize(response.body, "ConsumptionResult"); |
| 696 | + return Promise.resolve(result); |
| 697 | + } |
| 698 | + |
642 | 699 | } |
643 | 700 | /** |
644 | 701 | * GroupDocs.Editor Cloud API |
|
0 commit comments