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 16, 2023
1 parent 9077f2a commit 8863d5c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ 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 23.12

- Properties Name, Text, StartRange, EndRange marked as required for InsertBookmark operation.


## Enhancements in Version 23.11

- Support of required properties in models.
Expand Down
44 changes: 38 additions & 6 deletions src/model/bookmarkInsert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,30 @@

import { AttributeInfo } from '../internal/attributeInfo';
import { ModelInterface } from './modelInterface';
import { BookmarkData } from './bookmarkData';
import { NewDocumentPosition } from './newDocumentPosition';

export const importsMapBookmarkInsert = {
BookmarkData,
NewDocumentPosition,
};

/**
* Represents a bookmark to insert.
*/
export class BookmarkInsert extends BookmarkData {
export class BookmarkInsert implements ModelInterface {
/**
* Attribute type map
*/
public static attributeTypeMap: Array<AttributeInfo> = [
{
name: "name",
baseName: "Name",
type: "string",
},
{
name: "text",
baseName: "Text",
type: "string",
},
{
name: "startRange",
baseName: "StartRange",
Expand All @@ -59,9 +67,19 @@ export class BookmarkInsert extends BookmarkData {
* Returns attribute type map
*/
public static getAttributeTypeMap() {
return super.getAttributeTypeMap().concat(BookmarkInsert.attributeTypeMap);
return BookmarkInsert.attributeTypeMap;
}

/**
* Gets or sets the name of the bookmark.
*/
public name: string;

/**
* Gets or sets text, enclosed in the bookmark.
*/
public text: string;

/**
* Gets or sets the link to start bookmark node.
*/
Expand All @@ -73,15 +91,29 @@ export class BookmarkInsert extends BookmarkData {
public endRange: NewDocumentPosition;

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

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

public validate() {
super.validate();
if (this.name === null || this.name === undefined)
{
throw new Error('Property Name in BookmarkInsert is required.');
}
if (this.text === null || this.text === undefined)
{
throw new Error('Property Text in BookmarkInsert is required.');
}
if (this.startRange === null || this.startRange === undefined)
{
throw new Error('Property StartRange in BookmarkInsert is required.');
}
if (this.endRange === null || this.endRange === undefined)
{
throw new Error('Property EndRange in BookmarkInsert is required.');
}

this.startRange?.validate();

Expand Down

0 comments on commit 8863d5c

Please sign in to comment.