UNPKG

@opentap/runner-client

Version:

This is the web client for the OpenTAP Runner.

1,579 lines 117 kB
export class Image { constructor(data) { this.packages = []; this.repositories = []; if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.name = _data['Name']; if (Array.isArray(_data['Packages'])) { this.packages = []; for (const item of _data['Packages']) this.packages.push(PackageSpecifier.fromJS(item)); } if (Array.isArray(_data['Repositories'])) { this.repositories = []; for (const item of _data['Repositories']) this.repositories.push(item); } this.id = _data['Id']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new Image(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Name'] = this.name; if (Array.isArray(this.packages)) { data['Packages'] = []; for (const item of this.packages) data['Packages'].push(item.toJSON()); } if (Array.isArray(this.repositories)) { data['Repositories'] = []; for (const item of this.repositories) data['Repositories'].push(item); } data['Id'] = this.id; return data; } } export class PackageSpecifier { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.name = _data['Name']; this.version = _data['Version']; this.architecture = _data['Architecture']; this.oS = _data['OS']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new PackageSpecifier(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Name'] = this.name; data['Version'] = this.version; data['Architecture'] = this.architecture; data['OS'] = this.oS; return data; } } export class ErrorResponse { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.type = _data['Type']; this.message = _data['Message']; this.parameter = _data['Parameter']; this.source = _data['Source']; this.stackTrace = _data['StackTrace']; this.inner = _data['Inner'] ? ErrorResponse.fromJS(_data['Inner']) : undefined; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ErrorResponse(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Type'] = this.type; data['Message'] = this.message; data['Parameter'] = this.parameter; data['Source'] = this.source; data['StackTrace'] = this.stackTrace; data['Inner'] = this.inner ? this.inner.toJSON() : undefined; return data; } } export class NoResponderError extends ErrorResponse { constructor() { super({ message: 'No responders.' }); } static fromJS() { return new NoResponderError(); } } export class ImageResolveErrorResponse extends ErrorResponse { constructor(data) { super(data); } init(_data) { super.init(_data); if (_data) { this.dotGraph = _data['DotGraph']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ImageResolveErrorResponse(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['DotGraph'] = this.dotGraph; super.toJSON(data); return data; } } export class Session { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { var _a; if (_data) { this.subject = _data['Subject']; this.id = _data['Id']; this.imageId = _data['ImageId']; this.sessionState = (_a = _data['SessionState']) !== null && _a !== void 0 ? _a : _data['sessionState']; this.testPlanRunId = _data['TestPlanRunId']; this.startedBy = _data['StartedBy']; this.metadata = _data['Metadata']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new Session(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Subject'] = this.subject; data['Id'] = this.id; data['ImageId'] = this.imageId; data['SessionState'] = this.sessionState; data['TestPlanRunId'] = this.testPlanRunId; data['StartedBy'] = this.startedBy; data['Metadata'] = this.metadata; return data; } } export class Links { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.editor = _data['Editor']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new Links(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Editor'] = this.editor; return data; } } export class ComponentSettingsBase { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } this._discriminator = 'ComponentSettingsBase'; } init(_data) { if (_data) { this.name = _data['Name']; this.groupName = _data['GroupName']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; if (data['ComponentSettingsType'] === 'ComponentSettingsIdentifier') { const result = new ComponentSettingsIdentifier(); result.init(data); return result; } if (data['ComponentSettingsType'] === 'ComponentSettingsList') { const result = new ComponentSettingsList(); result.init(data); return result; } if (data['ComponentSettingsType'] === 'ComponentSettings') { const result = new ComponentSettings(); result.init(data); return result; } throw new Error("The abstract class 'ComponentSettingsBase' cannot be instantiated."); } toJSON(data) { data = typeof data === 'object' ? data : {}; data['ComponentSettingsType'] = this._discriminator; data['Name'] = this.name; data['GroupName'] = this.groupName; return data; } } export class ComponentSettingsIdentifier extends ComponentSettingsBase { constructor(data) { super(data); this._discriminator = 'ComponentSettingsIdentifier'; } init(_data) { super.init(_data); } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ComponentSettingsIdentifier(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; super.toJSON(data); return data; } } /** The supported layout modes. */ export var DisplayMode; (function (DisplayMode) { DisplayMode["MasterDetail"] = "MasterDetail"; DisplayMode["DataGrid"] = "DataGrid"; })(DisplayMode || (DisplayMode = {})); export class ComponentSettingsList extends ComponentSettingsBase { constructor(data) { super(data); this._discriminator = 'ComponentSettingsList'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['Items'])) { this.items = []; for (const item of _data['Items']) this.items.push(ComponentSettingsListItem.fromJS(item)); } this.displayMode = _data['DisplayMode']; this.itemType = _data['ItemType']; this.itemTypeDisplayName = _data['ItemTypeDisplayName']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ComponentSettingsList(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.items)) { data['Items'] = []; for (const item of this.items) data['Items'].push(item.toJSON()); } data['DisplayMode'] = this.displayMode; data['ItemType'] = this.itemType; data['ItemTypeDisplayName'] = this.itemTypeDisplayName; super.toJSON(data); return data; } } export class AnnotatedObject { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.visualStatus = _data['VisualStatus'] ? VisualStatus.fromJS(_data['VisualStatus']) : undefined; this.valueType = _data['ValueType']; this.display = _data['Display'] ? DisplayAttribute.fromJS(_data['Display']) : undefined; this.metaData = _data['MetaData'] ? MetaData.fromJS(_data['MetaData']) : undefined; this.externalParameter = _data['ExternalParameter'] ? ExternalParameter.fromJS(_data['ExternalParameter']) : undefined; this.unitAttribute = _data['UnitAttribute'] ? UnitAttribute.fromJS(_data['UnitAttribute']) : undefined; } } static fromJS(data) { // eslint-disable-next-line @typescript-eslint/no-unused-vars data = typeof data === 'object' ? data : {}; throw new Error("The abstract class 'AnnotatedObject' cannot be instantiated."); } toJSON(data) { data = typeof data === 'object' ? data : {}; data['VisualStatus'] = this.visualStatus ? this.visualStatus.toJSON() : undefined; data['ValueType'] = this.valueType; data['Display'] = this.display ? this.display.toJSON() : undefined; data['MetaData'] = this.metaData ? this.metaData.toJSON() : undefined; data['ExternalParameter'] = this.externalParameter ? this.externalParameter.toJSON() : undefined; data['UnitAttribute'] = this.unitAttribute ? this.unitAttribute.toJSON() : undefined; return data; } } export class ComponentSettingsListItem extends AnnotatedObject { constructor(data) { super(data); } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['Settings'])) { this.settings = []; for (const item of _data['Settings']) this.settings.push(Setting.fromJS(item)); } this.name = _data['Name']; this.enabledResource = _data['EnabledResource']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ComponentSettingsListItem(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.settings)) { data['Settings'] = []; for (const item of this.settings) data['Settings'].push(item.toJSON()); } data['Name'] = this.name; data['EnabledResource'] = this.enabledResource; super.toJSON(data); return data; } } export class Setting extends AnnotatedObject { constructor(data) { super(data); this._discriminator = 'Setting'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['Errors'])) { this.errors = []; for (const item of _data['Errors']) this.errors.push(item); } this.layout = _data['Layout'] ? Layout.fromJS(_data['Layout']) : undefined; this.columnDisplayName = _data['ColumnDisplayName'] ? ColumnDisplayName.fromJS(_data['ColumnDisplayName']) : undefined; this.valueDescription = _data['ValueDescription']; this.propertyName = _data['PropertyName']; this.submit = _data['Submit']; if (Array.isArray(_data['Icons'])) { this.icons = []; for (const item of _data['Icons']) this.icons.push(Icon.fromJS(item)); } } } static fromJS(data) { data = typeof data === 'object' ? data : {}; if (data['ControlType'] === 'ButtonControl') { const result = new ButtonControl(); result.init(data); return result; } if (data['ControlType'] === 'ButtonsControl') { const result = new ButtonsControl(); result.init(data); return result; } if (data['ControlType'] === 'CheckBoxControl') { const result = new CheckBoxControl(); result.init(data); return result; } if (data['ControlType'] === 'DataGridReferenceControl') { const result = new DataGridReferenceControl(); result.init(data); return result; } if (data['ControlType'] === 'DataGridControl') { const result = new DataGridControl(); result.init(data); return result; } if (data['ControlType'] === 'TextBoxControl') { const result = new TextBoxControl(); result.init(data); return result; } if (data['ControlType'] === 'ComboBoxControl') { const result = new ComboBoxControl(); result.init(data); return result; } if (data['ControlType'] === 'FilePathControl') { const result = new FilePathControl(); result.init(data); return result; } if (data['ControlType'] === 'DirectoryPathControl') { const result = new DirectoryPathControl(); result.init(data); return result; } if (data['ControlType'] === 'EnabledControl') { const result = new EnabledControl(); result.init(data); return result; } if (data['ControlType'] === 'DropdownControl') { const result = new DropdownControl(); result.init(data); return result; } if (data['ControlType'] === 'MultiSelectControl') { const result = new MultiSelectControl(); result.init(data); return result; } if (data['ControlType'] === 'PasswordControl') { const result = new PasswordControl(); result.init(data); return result; } if (data['ControlType'] === 'PictureControl') { const result = new PictureControl(); result.init(data); return result; } if (data['ControlType'] === 'PluginTypeSelectorControl') { const result = new PluginTypeSelectorControl(); result.init(data); return result; } const result = new Setting(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['ControlType'] = this._discriminator; if (Array.isArray(this.errors)) { data['Errors'] = []; for (const item of this.errors) data['Errors'].push(item); } data['Layout'] = this.layout ? this.layout.toJSON() : undefined; data['ColumnDisplayName'] = this.columnDisplayName ? this.columnDisplayName.toJSON() : undefined; data['ValueDescription'] = this.valueDescription; data['PropertyName'] = this.propertyName; data['Submit'] = this.submit; if (Array.isArray(this.icons)) { data['Icons'] = []; for (const item of this.icons) data['Icons'].push(item.toJSON()); } super.toJSON(data); return data; } } export class Layout { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.mode = _data['Mode']; this.rowHeight = _data['RowHeight']; this.maxRowHeight = _data['MaxRowHeight']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new Layout(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Mode'] = this.mode; data['RowHeight'] = this.rowHeight; data['MaxRowHeight'] = this.maxRowHeight; return data; } } /** The supported layout modes. */ export var LayoutMode; (function (LayoutMode) { LayoutMode["Normal"] = "Normal"; LayoutMode["FullRow"] = "FullRow"; LayoutMode["FloatBottom"] = "FloatBottom"; })(LayoutMode || (LayoutMode = {})); export class ColumnDisplayName { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.columnName = _data['ColumnName']; this.order = _data['Order']; this.isReadOnly = _data['IsReadOnly']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ColumnDisplayName(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['ColumnName'] = this.columnName; data['Order'] = this.order; data['IsReadOnly'] = this.isReadOnly; return data; } } export class Icon { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.iconName = _data['IconName']; this.invoke = _data['Invoke']; this.stepReference = _data['StepReference']; this.propertyReference = _data['PropertyReference']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new Icon(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['IconName'] = this.iconName; data['Invoke'] = this.invoke; data['StepReference'] = this.stepReference; data['PropertyReference'] = this.propertyReference; return data; } } export class UnitAttribute { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.unit = _data['Unit']; this.preScaling = _data['PreScaling']; this.stringFormat = _data['StringFormat']; this.useRanges = _data['UseRanges']; this.useEngineeringPrefix = _data['UseEngineeringPrefix']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new UnitAttribute(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Unit'] = this.unit; data['PreScaling'] = this.preScaling; data['StringFormat'] = this.stringFormat; data['UseRanges'] = this.useRanges; data['UseEngineeringPrefix'] = this.useEngineeringPrefix; return data; } } export class VisualStatus { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.isReadOnly = _data['IsReadOnly']; this.isVisible = _data['IsVisible']; this.isEnabled = _data['IsEnabled']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new VisualStatus(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['IsReadOnly'] = this.isReadOnly; data['IsVisible'] = this.isVisible; data['IsEnabled'] = this.isEnabled; return data; } } export class DisplayAttribute { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.description = _data['Description']; if (Array.isArray(_data['Group'])) { this.group = []; for (const item of _data['Group']) this.group.push(item); } this.name = _data['Name']; this.order = _data['Order']; this.collapsed = _data['Collapsed']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new DisplayAttribute(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Description'] = this.description; if (Array.isArray(this.group)) { data['Group'] = []; for (const item of this.group) data['Group'].push(item); } data['Name'] = this.name; data['Order'] = this.order; data['Collapsed'] = this.collapsed; return data; } } export class MetaData { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.name = _data['Name']; this.macroName = _data['MacroName']; this.group = _data['Group']; this.frozen = _data['Frozen']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new MetaData(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Name'] = this.name; data['MacroName'] = this.macroName; data['Group'] = this.group; data['Frozen'] = this.frozen; return data; } } export class ExternalParameter { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.name = _data['Name']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ExternalParameter(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Name'] = this.name; return data; } } export class ButtonControl extends Setting { constructor(data) { super(data); this._discriminator = 'ButtonControl'; } init(_data) { super.init(_data); if (_data) { this.invokeMethod = _data['InvokeMethod']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ButtonControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['InvokeMethod'] = this.invokeMethod; super.toJSON(data); return data; } } export class ButtonsControl extends Setting { constructor(data) { super(data); this._discriminator = 'ButtonsControl'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['AvailableValues'])) { this.availableValues = []; for (const item of _data['AvailableValues']) this.availableValues.push(AvailableValue.fromJS(item)); } this.selectedIndex = _data['SelectedIndex']; this.invokeMethod = _data['InvokeMethod']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ButtonsControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.availableValues)) { data['AvailableValues'] = []; for (const item of this.availableValues) data['AvailableValues'].push(item.toJSON()); } data['SelectedIndex'] = this.selectedIndex; data['InvokeMethod'] = this.invokeMethod; super.toJSON(data); return data; } } export class AvailableValue { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.name = _data['Name']; this.description = _data['Description']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new AvailableValue(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Name'] = this.name; data['Description'] = this.description; return data; } } export class CheckBoxControl extends Setting { constructor(data) { super(data); this._discriminator = 'CheckBoxControl'; } init(_data) { super.init(_data); if (_data) { this.boolValue = _data['BoolValue']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new CheckBoxControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['BoolValue'] = this.boolValue; super.toJSON(data); return data; } } export class DataGridReferenceControl extends Setting { constructor(data) { super(data); this._discriminator = 'DataGridReferenceControl'; } init(_data) { super.init(_data); } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new DataGridReferenceControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; super.toJSON(data); return data; } } export class DataGridControl extends Setting { constructor(data) { super(data); this._discriminator = 'DataGridControl'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['Items'])) { this.items = []; for (const item of _data['Items']) this.items.push(item); } this.fixedSize = _data['FixedSize']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new DataGridControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.items)) { data['Items'] = []; for (const item of this.items) data['Items'].push(item); } data['FixedSize'] = this.fixedSize; super.toJSON(data); return data; } } export class TextBoxControl extends Setting { constructor(data) { super(data); this._discriminator = 'TextBoxControl'; } init(_data) { super.init(_data); if (_data) { this.stringValue = _data['StringValue']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; if (data['ControlType'] === 'ComboBoxControl') { const result = new ComboBoxControl(); result.init(data); return result; } const result = new TextBoxControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['StringValue'] = this.stringValue; super.toJSON(data); return data; } } export class ComboBoxControl extends TextBoxControl { constructor(data) { super(data); this._discriminator = 'ComboBoxControl'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['SuggestedValues'])) { this.suggestedValues = []; for (const item of _data['SuggestedValues']) this.suggestedValues.push(item); } } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ComboBoxControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.suggestedValues)) { data['SuggestedValues'] = []; for (const item of this.suggestedValues) data['SuggestedValues'].push(item); } super.toJSON(data); return data; } } export class FilePathControl extends Setting { constructor(data) { super(data); this._discriminator = 'FilePathControl'; } init(_data) { super.init(_data); if (_data) { this.stringValue = _data['StringValue']; this.fileExtension = _data['FileExtension']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new FilePathControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['StringValue'] = this.stringValue; data['FileExtension'] = this.fileExtension; super.toJSON(data); return data; } } export class DirectoryPathControl extends Setting { constructor(data) { super(data); this._discriminator = 'DirectoryPathControl'; } init(_data) { super.init(_data); if (_data) { this.stringValue = _data['StringValue']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new DirectoryPathControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['StringValue'] = this.stringValue; super.toJSON(data); return data; } } export class EnabledControl extends Setting { constructor(data) { super(data); this._discriminator = 'EnabledControl'; } init(_data) { super.init(_data); if (_data) { this.isEnabled = _data['IsEnabled']; this.value = _data['Value'] ? Setting.fromJS(_data['Value']) : undefined; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new EnabledControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['IsEnabled'] = this.isEnabled; data['Value'] = this.value ? this.value.toJSON() : undefined; super.toJSON(data); return data; } } export class DropdownControl extends Setting { constructor(data) { super(data); this._discriminator = 'DropdownControl'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['AvailableValues'])) { this.availableValues = []; for (const item of _data['AvailableValues']) this.availableValues.push(AvailableValue.fromJS(item)); } this.selectedIndex = _data['SelectedIndex']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new DropdownControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.availableValues)) { data['AvailableValues'] = []; for (const item of this.availableValues) data['AvailableValues'].push(item.toJSON()); } data['SelectedIndex'] = this.selectedIndex; super.toJSON(data); return data; } } export class MultiSelectControl extends Setting { constructor(data) { super(data); this._discriminator = 'MultiSelectControl'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['AvailableValues'])) { this.availableValues = []; for (const item of _data['AvailableValues']) this.availableValues.push(AvailableValue.fromJS(item)); } if (Array.isArray(_data['SelectedIndex'])) { this.selectedIndex = []; for (const item of _data['SelectedIndex']) this.selectedIndex.push(item); } } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new MultiSelectControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.availableValues)) { data['AvailableValues'] = []; for (const item of this.availableValues) data['AvailableValues'].push(item.toJSON()); } if (Array.isArray(this.selectedIndex)) { data['SelectedIndex'] = []; for (const item of this.selectedIndex) data['SelectedIndex'].push(item); } super.toJSON(data); return data; } } export class PasswordControl extends Setting { constructor(data) { super(data); this._discriminator = 'PasswordControl'; } init(_data) { super.init(_data); if (_data) { this.password = _data['Password']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new PasswordControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Password'] = this.password; super.toJSON(data); return data; } } export class PictureControl extends Setting { constructor(data) { super(data); this._discriminator = 'PictureControl'; } init(_data) { super.init(_data); if (_data) { this.description = _data['Description']; this.mimeType = _data['MimeType']; this.resource = _data['Resource'] ? Resource.fromJS(_data['Resource']) : undefined; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new PictureControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Description'] = this.description; data['MimeType'] = this.mimeType; data['Resource'] = this.resource ? this.resource.toJSON() : undefined; super.toJSON(data); return data; } } export class PluginTypeSelectorControl extends Setting { constructor(data) { super(data); this.availableValues = []; this._discriminator = 'PluginTypeSelectorControl'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['AvailableValues'])) { this.availableValues = []; for (const item of _data['AvailableValues']) this.availableValues.push(AvailableValue.fromJS(item)); } this.selectedIndex = _data['SelectedIndex']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new PluginTypeSelectorControl(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.availableValues)) { data['AvailableValues'] = []; for (const item of this.availableValues) data['AvailableValues'].push(item.toJSON()); } data['SelectedIndex'] = this.selectedIndex; super.toJSON(data); return data; } } export class Resource { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.source = _data['Source']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new Resource(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Source'] = this.source; return data; } } export class FileDescriptor { constructor(fileSize, chunkSize) { var _a; if (chunkSize === 0) { throw Error('chunkSize cannot set to 0'); } this.fileSize = fileSize; this.chunkSize = chunkSize; this.numberOfChunks = Math.floor((((_a = this.fileSize) !== null && _a !== void 0 ? _a : 0) + this.chunkSize - 1) / this.chunkSize); } init(_data) { if (_data) { this.numberOfChunks = _data['NumberOfChunks']; this.fileSize = _data['FileSize']; this.chunkSize = _data['ChunkSize']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new FileDescriptor(0, 512000); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['NumberOfChunks'] = this.numberOfChunks; data['FileSize'] = this.fileSize; data['ChunkSize'] = this.chunkSize; return data; } } export class ComponentSettings extends ComponentSettingsBase { constructor(data) { super(data); this._discriminator = 'ComponentSettings'; } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['Settings'])) { this.settings = []; for (const item of _data['Settings']) this.settings.push(Setting.fromJS(item)); } } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ComponentSettings(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.settings)) { data['Settings'] = []; for (const item of this.settings) data['Settings'].push(item.toJSON()); } super.toJSON(data); return data; } } export class ListItemType { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.typeName = _data['TypeName']; this.typeDisplay = _data['TypeDisplay'] ? DisplayAttribute.fromJS(_data['TypeDisplay']) : undefined; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ListItemType(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['TypeName'] = this.typeName; data['TypeDisplay'] = this.typeDisplay ? this.typeDisplay.toJSON() : undefined; return data; } } export class ProfileGroup { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { if (Array.isArray(_data['Profiles'])) { this.profiles = []; for (const item of _data['Profiles']) this.profiles.push(item); } this.currentProfile = _data['CurrentProfile']; this.groupName = _data['GroupName']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new ProfileGroup(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.profiles)) { data['Profiles'] = []; for (const item of this.profiles) data['Profiles'].push(item); } data['CurrentProfile'] = this.currentProfile; data['GroupName'] = this.groupName; return data; } } export class RepositoryPackageReference { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.name = _data['Name']; this.version = _data['Version']; this.repository = _data['Repository']; this.path = _data['Path']; this.pathId = _data['PathId']; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new RepositoryPackageReference(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Name'] = this.name; data['Version'] = this.version; data['Repository'] = this.repository; data['Path'] = this.path; data['PathId'] = this.pathId; return data; } } export class RepositoryPackageDefinition extends RepositoryPackageReference { constructor(data) { super(data); } init(_data) { super.init(_data); if (_data) { if (Array.isArray(_data['Tags'])) { this.tags = []; for (const item of _data['Tags']) this.tags.push(item); } } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new RepositoryPackageDefinition(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; if (Array.isArray(this.tags)) { data['Tags'] = []; for (const item of this.tags) data['Tags'].push(item); } super.toJSON(data); return data; } } export class RepositorySettingsPackageDefinition extends RepositoryPackageDefinition { constructor(data) { super(data); } init(_data) { super.init(_data); } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new RepositorySettingsPackageDefinition(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; super.toJSON(data); return data; } } export class GetTestPlanReferenceResponse { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.testPlanReference = _data['TestPlanReference'] ? RepositoryPackageReference.fromJS(_data['TestPlanReference']) : undefined; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new GetTestPlanReferenceResponse(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['TestPlanReference'] = this.testPlanReference ? this.testPlanReference.toJSON() : undefined; return data; } } export class SaveTestPlanToRepositoryResponse { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.testPlanReference = _data['TestPlanReference'] ? RepositoryPackageReference.fromJS(_data['TestPlanReference']) : undefined; } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new SaveTestPlanToRepositoryResponse(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['TestPlanReference'] = this.testPlanReference ? this.testPlanReference.toJSON() : undefined; return data; } } export class SettingsTapPackage { constructor(data) { if (data) { for (const property in data) { if (Object.prototype.hasOwnProperty.call(data, property)) this[property] = data[property]; } } } init(_data) { if (_data) { this.name = _data['Name']; this.version = _data['Version']; this.tags = _data['Tags']; this.group = _data['Group']; this.owner = _data['Owner']; this.infoLink = _data['InfoLink']; this.description = _data['Description']; if (Array.isArray(_data['Files'])) { this.files = []; for (const item of _data['Files']) this.files.push(item); } if (Array.isArray(_data['SettingsTypes'])) { this.settingsTypes = []; for (const item of _data['SettingsTypes']) this.settingsTypes.push(item); } } } static fromJS(data) { data = typeof data === 'object' ? data : {}; const result = new SettingsTapPackage(); result.init(data); return result; } toJSON(data) { data = typeof data === 'object' ? data : {}; data['Name'] = this.name; data