Skip to content

Commit

Permalink
SDK regenerated by CI server [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dynabic-billing-team committed Nov 28, 2023
1 parent fcd5386 commit 4e5ff42
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 72 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Feel free to explore the [Developer's Guide](https://docs.aspose.cloud/display/w

- Properties Name, Text, StartRange, EndRange marked as required for InsertBookmark operation.
- Implemented DeleteOfficeMathObjects operation to delete all office math objects from document.
- Parameter ProtectionRequest was removed from the UnprotectDocument operation. Now removing protection from a document does not require a password.
- Model ProtectionRequest marked as deprecated, please use ProtectionRequestV2 instead for perform ProtectDocument operation. To change the password or protection type of protected document, the old password is no required.


## Enhancements in Version 23.11
Expand Down
4 changes: 2 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4621,7 +4621,7 @@ export class WordsApi implements Encryptor {
}

/**
* Adds protection to the document.
* Changes the document protection. The previous protection will be overwritten if it exist.
* @param requestObj contains request parameters
*/
public async protectDocument(requestObj: model.ProtectDocumentRequest): Promise< model.WordsIncomingMessage< model.ProtectionDataResponse > > {
Expand All @@ -4639,7 +4639,7 @@ export class WordsApi implements Encryptor {
}

/**
* Adds protection to the document.
* Changes the document protection. The previous protection will be overwritten if it exist.
* @param requestObj contains request parameters
*/
public async protectDocumentOnline(requestObj: model.ProtectDocumentOnlineRequest): Promise< model.WordsIncomingMessage< model.ProtectDocumentOnlineResponse > > {
Expand Down
65 changes: 16 additions & 49 deletions src/model/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ import * as importedPreferredWidth from './preferredWidth';
import * as importedProtectionData from './protectionData';
import * as importedProtectionDataResponse from './protectionDataResponse';
import * as importedProtectionRequest from './protectionRequest';
import * as importedProtectionRequestBase from './protectionRequestBase';
import * as importedProtectionRequestV2 from './protectionRequestV2';
import * as importedPsSaveOptionsData from './psSaveOptionsData';
import * as importedPublicKeyResponse from './publicKeyResponse';
import * as importedRangeDocument from './rangeDocument';
Expand Down Expand Up @@ -489,6 +491,8 @@ export * from './preferredWidth';
export * from './protectionData';
export * from './protectionDataResponse';
export * from './protectionRequest';
export * from './protectionRequestBase';
export * from './protectionRequestV2';
export * from './psSaveOptionsData';
export * from './publicKeyResponse';
export * from './rangeDocument';
Expand Down Expand Up @@ -677,6 +681,8 @@ const enumsMap = {
"PdfSaveOptionsData.TextCompressionEnum": importedPdfSaveOptionsData.PdfSaveOptionsData.TextCompressionEnum,
"PdfSaveOptionsData.ZoomBehaviorEnum": importedPdfSaveOptionsData.PdfSaveOptionsData.ZoomBehaviorEnum,
"PreferredWidth.TypeEnum": importedPreferredWidth.PreferredWidth.TypeEnum,
"ProtectionData.ProtectionTypeEnum": importedProtectionData.ProtectionData.ProtectionTypeEnum,
"ProtectionRequestV2.ProtectionTypeEnum": importedProtectionRequestV2.ProtectionRequestV2.ProtectionTypeEnum,
"ReplaceRange.TextTypeEnum": importedReplaceRange.ReplaceRange.TextTypeEnum,
"ReportBuildOptions": importedReportBuildOptions.ReportBuildOptions,
"ReportEngineSettings.DataSourceTypeEnum": importedReportEngineSettings.ReportEngineSettings.DataSourceTypeEnum,
Expand Down Expand Up @@ -885,6 +891,7 @@ const typeMap = {
ProtectionData: importedProtectionData.ProtectionData,
ProtectionDataResponse: importedProtectionDataResponse.ProtectionDataResponse,
ProtectionRequest: importedProtectionRequest.ProtectionRequest,
ProtectionRequestV2: importedProtectionRequestV2.ProtectionRequestV2,
PsSaveOptionsData: importedPsSaveOptionsData.PsSaveOptionsData,
PublicKeyResponse: importedPublicKeyResponse.PublicKeyResponse,
RangeDocument: importedRangeDocument.RangeDocument,
Expand Down Expand Up @@ -34198,7 +34205,7 @@ export class OptimizeDocumentOnlineRequest implements RequestInterface {

/**
* Request model for ProtectDocument operation.
* Adds protection to the document.
* Changes the document protection. The previous protection will be overwritten if it exist.
*/
export class ProtectDocumentRequest implements RequestInterface {

Expand All @@ -34212,9 +34219,9 @@ export class ProtectDocumentRequest implements RequestInterface {
public name: string;

/**
* Protection request.
* Use ProtectionRequestV2 model to provide protection options.
*/
public protectionRequest: importedProtectionRequest.ProtectionRequest;
public protectionRequest: importedProtectionRequestBase.ProtectionRequestBase;

/**
* Original document folder.
Expand Down Expand Up @@ -34286,7 +34293,7 @@ export class ProtectDocumentRequest implements RequestInterface {
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "encryptedPassword", this.encryptedPassword, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "destFileName", this.destFileName, _encryptor);
if (this.protectionRequest !== undefined) {
let _obj = ObjectSerializer.serialize(this.protectionRequest, this.protectionRequest.constructor.name === "Object" ? "importedProtectionRequest.ProtectionRequest" : this.protectionRequest.constructor.name);
let _obj = ObjectSerializer.serialize(this.protectionRequest, this.protectionRequest.constructor.name === "Object" ? "importedProtectionRequestBase.ProtectionRequestBase" : this.protectionRequest.constructor.name);
formParams.push(['ProtectionRequest', JSON.stringify(_obj), 'application/json']);
}

Expand Down Expand Up @@ -34333,7 +34340,7 @@ export class ProtectDocumentRequest implements RequestInterface {

/**
* Request model for ProtectDocumentOnline operation.
* Adds protection to the document.
* Changes the document protection. The previous protection will be overwritten if it exist.
*/
export class ProtectDocumentOnlineRequest implements RequestInterface {

Expand All @@ -34347,9 +34354,9 @@ export class ProtectDocumentOnlineRequest implements RequestInterface {
public document: Readable;

/**
* Protection request.
* Use ProtectionRequestV2 model to provide protection options.
*/
public protectionRequest: importedProtectionRequest.ProtectionRequest;
public protectionRequest: importedProtectionRequestBase.ProtectionRequestBase;

/**
* Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
Expand Down Expand Up @@ -34411,7 +34418,7 @@ export class ProtectDocumentOnlineRequest implements RequestInterface {
formParams.push(['Document', this.document, 'application/octet-stream']);
}
if (this.protectionRequest !== undefined) {
let _obj = ObjectSerializer.serialize(this.protectionRequest, this.protectionRequest.constructor.name === "Object" ? "importedProtectionRequest.ProtectionRequest" : this.protectionRequest.constructor.name);
let _obj = ObjectSerializer.serialize(this.protectionRequest, this.protectionRequest.constructor.name === "Object" ? "importedProtectionRequestBase.ProtectionRequestBase" : this.protectionRequest.constructor.name);
formParams.push(['ProtectionRequest', JSON.stringify(_obj), 'application/json']);
}

Expand Down Expand Up @@ -38731,11 +38738,6 @@ export class UnprotectDocumentRequest implements RequestInterface {
*/
public name: string;

/**
* Protection request.
*/
public protectionRequest: importedProtectionRequest.ProtectionRequest;

/**
* Original document folder.
*/
Expand Down Expand Up @@ -38788,27 +38790,12 @@ export class UnprotectDocumentRequest implements RequestInterface {
if (this.name === null) {
throw new Error('Required parameter "this.name" was null when calling unprotectDocument.');
}
// verify required parameter 'this.protectionRequest' is not undefined
if (this.protectionRequest === undefined) {
throw new Error('Required parameter "this.protectionRequest" was undefined when calling unprotectDocument.');
}

// verify required parameter 'this.protectionRequest' is not null
if (this.protectionRequest === null) {
throw new Error('Required parameter "this.protectionRequest" was null when calling unprotectDocument.');
}
this.protectionRequest?.validate();

localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "folder", this.folder, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "storage", this.storage, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "loadEncoding", this.loadEncoding, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "password", this.password, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "encryptedPassword", this.encryptedPassword, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "destFileName", this.destFileName, _encryptor);
if (this.protectionRequest !== undefined) {
let _obj = ObjectSerializer.serialize(this.protectionRequest, this.protectionRequest.constructor.name === "Object" ? "importedProtectionRequest.ProtectionRequest" : this.protectionRequest.constructor.name);
formParams.push(['ProtectionRequest', JSON.stringify(_obj), 'application/json']);
}

for (let fileContent of filesContent) {
formParams.push([fileContent.getReference(), fileContent.getContent(), 'application/octet-stream']);
Expand Down Expand Up @@ -38866,11 +38853,6 @@ export class UnprotectDocumentOnlineRequest implements RequestInterface {
*/
public document: Readable;

/**
* Protection request.
*/
public protectionRequest: importedProtectionRequest.ProtectionRequest;

/**
* Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
*/
Expand Down Expand Up @@ -38912,28 +38894,13 @@ export class UnprotectDocumentOnlineRequest implements RequestInterface {
if (this.document === null) {
throw new Error('Required parameter "this.document" was null when calling unprotectDocumentOnline.');
}
// verify required parameter 'this.protectionRequest' is not undefined
if (this.protectionRequest === undefined) {
throw new Error('Required parameter "this.protectionRequest" was undefined when calling unprotectDocumentOnline.');
}

// verify required parameter 'this.protectionRequest' is not null
if (this.protectionRequest === null) {
throw new Error('Required parameter "this.protectionRequest" was null when calling unprotectDocumentOnline.');
}
this.protectionRequest?.validate();

localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "loadEncoding", this.loadEncoding, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "password", this.password, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "encryptedPassword", this.encryptedPassword, _encryptor);
localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "destFileName", this.destFileName, _encryptor);
if (this.document !== undefined) {
formParams.push(['Document', this.document, 'application/octet-stream']);
}
if (this.protectionRequest !== undefined) {
let _obj = ObjectSerializer.serialize(this.protectionRequest, this.protectionRequest.constructor.name === "Object" ? "importedProtectionRequest.ProtectionRequest" : this.protectionRequest.constructor.name);
formParams.push(['ProtectionRequest', JSON.stringify(_obj), 'application/json']);
}

for (let fileContent of filesContent) {
formParams.push([fileContent.getReference(), fileContent.getContent(), 'application/octet-stream']);
Expand Down Expand Up @@ -46627,7 +46594,7 @@ export class InsertWatermarkTextOnlineResponse {

/**
* Response model for ProtectDocumentOnline operation.
* Adds protection to the document.
* Changes the document protection. The previous protection will be overwritten if it exist.
*/
export class ProtectDocumentOnlineResponse {
/**
Expand Down
24 changes: 22 additions & 2 deletions src/model/protectionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class ProtectionData implements ModelInterface {
{
name: "protectionType",
baseName: "ProtectionType",
type: "string",
type: "ProtectionData.ProtectionTypeEnum",
}
];

Expand All @@ -56,7 +56,7 @@ export class ProtectionData implements ModelInterface {
/**
* Gets or sets type of the protection.
*/
public protectionType: string;
public protectionType: ProtectionData.ProtectionTypeEnum;

public constructor(init?: Partial< ProtectionData >) {
Object.assign(this, init);
Expand All @@ -66,6 +66,26 @@ export class ProtectionData implements ModelInterface {
}

public validate() {
if (this.protectionType === null || this.protectionType === undefined)
{
throw new Error('Property ProtectionType in ProtectionData is required.');
}
}
}

/**
* Enums for ProtectionData
*/
// tslint:disable:quotemark
// tslint:disable-next-line:no-namespace
export namespace ProtectionData {
export enum ProtectionTypeEnum {
AllowOnlyRevisions = 'AllowOnlyRevisions' as any,
AllowOnlyComments = 'AllowOnlyComments' as any,
AllowOnlyFormFields = 'AllowOnlyFormFields' as any,
ReadOnly = 'ReadOnly' as any,
NoProtection = 'NoProtection' as any
}
}
// tslint:enable:quotemark

9 changes: 7 additions & 2 deletions src/model/protectionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@

import { AttributeInfo } from '../internal/attributeInfo';
import { ModelInterface } from './modelInterface';
import { ProtectionRequestBase } from './protectionRequestBase';

export const importsMapProtectionRequest = {
ProtectionRequestBase,
};

/**
* Request on changing of protection.
* @deprecated ProtectionRequest is deprecated and remains for backwards compatibility only.
*/
export class ProtectionRequest implements ModelInterface {
export class ProtectionRequest extends ProtectionRequestBase {
/**
* Attribute type map
*/
Expand All @@ -60,7 +63,7 @@ export class ProtectionRequest implements ModelInterface {
* Returns attribute type map
*/
public static getAttributeTypeMap() {
return ProtectionRequest.attributeTypeMap;
return super.getAttributeTypeMap().concat(ProtectionRequest.attributeTypeMap);
}

/**
Expand All @@ -79,13 +82,15 @@ export class ProtectionRequest implements ModelInterface {
public protectionType: string;

public constructor(init?: Partial< ProtectionRequest >) {
super(init);
Object.assign(this, init);
}

public collectFilesContent(_resultFilesContent: Array<any>) {
}

public validate() {
super.validate();
if (this.password === null || this.password === undefined)
{
throw new Error('Property Password in ProtectionRequest is required.');
Expand Down
62 changes: 62 additions & 0 deletions src/model/protectionRequestBase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* --------------------------------------------------------------------------------
* <copyright company="Aspose" file="protectionRequestBase.ts">
* Copyright (c) 2023 Aspose.Words for Cloud
* </copyright>
* <summary>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* </summary>
* --------------------------------------------------------------------------------
*/

import { AttributeInfo } from '../internal/attributeInfo';
import { ModelInterface } from './modelInterface';

export const importsMapProtectionRequestBase = {
};

/**
* Request on changing of protection.
*/
export abstract class ProtectionRequestBase implements ModelInterface {
/**
* Attribute type map
*/
public static attributeTypeMap: Array<AttributeInfo> = [
];

/**
* Returns attribute type map
*/
public static getAttributeTypeMap() {
return ProtectionRequestBase.attributeTypeMap;
}


public constructor(init?: Partial< ProtectionRequestBase >) {
Object.assign(this, init);
}

public collectFilesContent(_resultFilesContent: Array<any>) {
}

public validate() {
}
}

Loading

0 comments on commit 4e5ff42

Please sign in to comment.