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 May 16, 2024
1 parent 1f0530c commit 36b7495
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 118 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ Feel free to explore the [Developer's Guide](https://docs.aspose.cloud/display/w
- Add & remove watermarks and protection.
- Read & write access to Document Object Model.

## Enhancements in Version 24.5

- Added an url parameter to InsertImage / UpdateImage methods. It allows to link to an image from a web URL.


## Enhancements in Version 24.4

- Added the 'MergeWithNext' method to merge a section with the next one.
Expand Down
88 changes: 50 additions & 38 deletions src/model/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28571,20 +28571,15 @@ export class InsertDrawingObjectRequest implements RequestInterface {
*/
public drawingObject: importedDrawingObjectInsert.DrawingObjectInsert;

/**
* The path to the node in the document tree.
*/
public nodePath: string;

/**
* File with image.
*/
public imageFile: Readable;

/**
* The link to the image.
* The path to the node in the document tree.
*/
public url: string;
public nodePath: string;

/**
* Original document folder.
Expand Down Expand Up @@ -28658,9 +28653,17 @@ export class InsertDrawingObjectRequest implements RequestInterface {
if (this.drawingObject === null) {
throw new Error('Required parameter "this.drawingObject" was null when calling insertDrawingObject.');
}
// verify required parameter 'this.imageFile' is not undefined
if (this.imageFile === undefined) {
throw new Error('Required parameter "this.imageFile" was undefined when calling insertDrawingObject.');
}

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

localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "url", this.url, _encryptor);
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);
Expand Down Expand Up @@ -28741,20 +28744,15 @@ export class InsertDrawingObjectOnlineRequest implements RequestInterface {
*/
public drawingObject: importedDrawingObjectInsert.DrawingObjectInsert;

/**
* The path to the node in the document tree.
*/
public nodePath: string;

/**
* File with image.
*/
public imageFile: Readable;

/**
* The link to the image.
* The path to the node in the document tree.
*/
public url: string;
public nodePath: string;

/**
* Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
Expand Down Expand Up @@ -28817,9 +28815,17 @@ export class InsertDrawingObjectOnlineRequest implements RequestInterface {
if (this.drawingObject === null) {
throw new Error('Required parameter "this.drawingObject" was null when calling insertDrawingObjectOnline.');
}
// verify required parameter 'this.imageFile' is not undefined
if (this.imageFile === undefined) {
throw new Error('Required parameter "this.imageFile" was undefined when calling insertDrawingObjectOnline.');
}

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

localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "url", this.url, _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);
Expand Down Expand Up @@ -41653,6 +41659,11 @@ export class UpdateDrawingObjectRequest implements RequestInterface {
*/
public drawingObject: importedDrawingObjectUpdate.DrawingObjectUpdate;

/**
* File with image.
*/
public imageFile: Readable;

/**
* Object index.
*/
Expand All @@ -41663,16 +41674,6 @@ export class UpdateDrawingObjectRequest implements RequestInterface {
*/
public nodePath: string;

/**
* File with image.
*/
public imageFile: Readable;

/**
* The link to the image.
*/
public url: string;

/**
* Original document folder.
*/
Expand Down Expand Up @@ -41746,6 +41747,15 @@ export class UpdateDrawingObjectRequest implements RequestInterface {
if (this.drawingObject === null) {
throw new Error('Required parameter "this.drawingObject" was null when calling updateDrawingObject.');
}
// verify required parameter 'this.imageFile' is not undefined
if (this.imageFile === undefined) {
throw new Error('Required parameter "this.imageFile" was undefined when calling updateDrawingObject.');
}

// verify required parameter 'this.imageFile' is not null
if (this.imageFile === null) {
throw new Error('Required parameter "this.imageFile" was null when calling updateDrawingObject.');
}
// verify required parameter 'this.index' is not undefined
if (this.index === undefined) {
throw new Error('Required parameter "this.index" was undefined when calling updateDrawingObject.');
Expand All @@ -41757,7 +41767,6 @@ export class UpdateDrawingObjectRequest implements RequestInterface {
}
this.drawingObject?.validate();

localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "url", this.url, _encryptor);
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);
Expand Down Expand Up @@ -41838,6 +41847,11 @@ export class UpdateDrawingObjectOnlineRequest implements RequestInterface {
*/
public drawingObject: importedDrawingObjectUpdate.DrawingObjectUpdate;

/**
* File with image.
*/
public imageFile: Readable;

/**
* Object index.
*/
Expand All @@ -41848,16 +41862,6 @@ export class UpdateDrawingObjectOnlineRequest implements RequestInterface {
*/
public nodePath: string;

/**
* File with image.
*/
public imageFile: Readable;

/**
* The link to the image.
*/
public url: string;

/**
* Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
*/
Expand Down Expand Up @@ -41920,6 +41924,15 @@ export class UpdateDrawingObjectOnlineRequest implements RequestInterface {
if (this.drawingObject === null) {
throw new Error('Required parameter "this.drawingObject" was null when calling updateDrawingObjectOnline.');
}
// verify required parameter 'this.imageFile' is not undefined
if (this.imageFile === undefined) {
throw new Error('Required parameter "this.imageFile" was undefined when calling updateDrawingObjectOnline.');
}

// verify required parameter 'this.imageFile' is not null
if (this.imageFile === null) {
throw new Error('Required parameter "this.imageFile" was null when calling updateDrawingObjectOnline.');
}
// verify required parameter 'this.index' is not undefined
if (this.index === undefined) {
throw new Error('Required parameter "this.index" was undefined when calling updateDrawingObjectOnline.');
Expand All @@ -41931,7 +41944,6 @@ export class UpdateDrawingObjectOnlineRequest implements RequestInterface {
}
this.drawingObject?.validate();

localVarPath = await addQueryParameterToUrl(localVarPath, queryParameters, "url", this.url, _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);
Expand Down
75 changes: 0 additions & 75 deletions test/drawing/drawingObjectsTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,46 +552,6 @@ describe("drawingObjects", () => {
});
});

// Test for adding a link to a drawing object.
describe("insertDrawingObjectLink test", () => {
it("should return response with code 200", () => {
const wordsApi = BaseTest.initializeWordsApi();
const remoteFileName = "TestInsetDrawingObject.docx";

return wordsApi.uploadFileToStorage(
remoteDataFolder + "/" + remoteFileName,
BaseTest.localBaseTestDataFolder + localFile
).then((result0) => {
expect(result0.response.statusMessage).to.equal("OK");
const requestDrawingObject = new model.DrawingObjectInsert({
height: 0,
left: 0,
top: 0,
width: 0,
relativeHorizontalPosition: model.DrawingObjectInsert.RelativeHorizontalPositionEnum.Margin,
relativeVerticalPosition: model.DrawingObjectInsert.RelativeVerticalPositionEnum.Margin,
wrapType: model.DrawingObjectInsert.WrapTypeEnum.Inline
})
const request = new model.InsertDrawingObjectRequest({
name: remoteFileName,
drawingObject: requestDrawingObject,
url: "https://products.aspose.com/words/static/img/aspose_words_cloud-for-net.png",
nodePath: "",
folder: remoteDataFolder
});

// Act
return wordsApi.insertDrawingObject(request)
.then((resultApi) => {
// Assert
expect(resultApi.response.statusCode).to.equal(200);
});

});

});
});

// Test for deleting drawing object.
describe("deleteDrawingObject test", () => {
it("should return response with code 200", () => {
Expand Down Expand Up @@ -769,39 +729,4 @@ describe("drawingObjects", () => {

});
});

// Test for updating drawing object to a link to it.
describe("updateDrawingObjectLink test", () => {
it("should return response with code 200", () => {
const wordsApi = BaseTest.initializeWordsApi();
const remoteFileName = "TestUpdateDrawingObjectLink.docx";

return wordsApi.uploadFileToStorage(
remoteDataFolder + "/" + remoteFileName,
BaseTest.localBaseTestDataFolder + localFile
).then((result0) => {
expect(result0.response.statusMessage).to.equal("OK");
const requestDrawingObject = new model.DrawingObjectUpdate({
left: 0
})
const request = new model.UpdateDrawingObjectRequest({
name: remoteFileName,
drawingObject: requestDrawingObject,
url: "https://products.aspose.com/words/static/img/aspose_words_cloud-for-net.png",
index: 0,
nodePath: "",
folder: remoteDataFolder
});

// Act
return wordsApi.updateDrawingObject(request)
.then((resultApi) => {
// Assert
expect(resultApi.response.statusCode).to.equal(200);
});

});

});
});
});

0 comments on commit 36b7495

Please sign in to comment.