Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(options?: any) {
options = options || {};
super();
const schema = schemaDiagnosticInfo;
/* istanbul ignore next */
if (parameters.debugSchemaHelper) {
check_options_correctness_against_schema(this, schema, options);
}
this.symbolicId = initialize_field(schema.fields[0], options.symbolicId);
this.namespaceURI = initialize_field(schema.fields[1], options.namespaceURI);
this.locale = initialize_field(schema.fields[2], options.locale);
this.localizedText = initialize_field(schema.fields[3], options.localizedText);
this.additionalInfo = initialize_field(schema.fields[4], options.additionalInfo);
this.innerStatusCode = initialize_field(schema.fields[5], options.innerStatusCode);
this.innerDiagnosticInfo = initialize_field(schema.fields[6], options.innerDiagnosticInfo);
}
constructor(options?: AcknowledgeMessageOptions) {
options = options || {};
super();
const schema = schemaAcknowledgeMessage;
/* istanbul ignore next */
if (parameters.debugSchemaHelper) {
check_options_correctness_against_schema(this, schema, options);
}
this.protocolVersion = initialize_field(schema.fields[0], options.protocolVersion);
this.receiveBufferSize = initialize_field(schema.fields[1], options.receiveBufferSize);
this.sendBufferSize = initialize_field(schema.fields[2], options.sendBufferSize);
this.maxMessageSize = initialize_field(schema.fields[3], options.maxMessageSize);
this.maxChunkCount = initialize_field(schema.fields[4], options.maxChunkCount);
}
constructor(options: any, schema: StructuredTypeSchema, typeDictionary: TypeDictionary) {
super();
assert(schema, "expecting a schema here ");
assert(typeDictionary, "expecting a typeDic");
options = options || {};
this.__schema = schema;
check_options_correctness_against_schema(this, this.schema, options);
let uniqueFieldHasBeenFound = false;
let switchFieldName = "";
// finding fields that are in options but not in schema!
for (const field of this.schema.fields) {
const name = field.name;
if (field.switchValue === undefined) {
// this is the switch value field
switchFieldName = field.name;
continue;
}
assert(switchFieldName.length > 0, "It seems that there is no switch field in union schema");
assert(field.switchValue !== undefined, "union schema must only have one switched value field");
// dealing with optional fields
constructor(options?: DataValueOptions) {
super();
const schema = schemaDataValue;
options = options || {};
/* istanbul ignore next */
if (parameters.debugSchemaHelper) {
check_options_correctness_against_schema(this, schema, options);
}
if (options === null) {
this.value = new Variant({ dataType: DataType.Null });
}
/**
* @property value
* @type {Variant}
* @default null
*/
if (options.value === undefined || options.value === null) {
this.value = new Variant({ dataType: DataType.Null });
} else {
this.value = (options.value) ? new Variant(options.value) : new Variant({ dataType: DataType.Null });
}
constructor(options?: LocalizedTextOptions) {
super();
const schema = schemaLocalizedText;
options = options || {};
/* istanbul ignore next */
if (parameters.debugSchemaHelper) {
check_options_correctness_against_schema(this, schema, options);
}
/**
* @property locale
* @type {UAString}
*/
this.locale = initialize_field(schema.fields[0], options.locale);
/**
* @property text
* @type {UAString}
*/
this.text = initialize_field(schema.fields[1], options.text);
}
constructor(options?: QualifiedNameOptions) {
super();
const schema = QualifiedName.schema;
options = options || {};
/* istanbul ignore next */
if (parameters.debugSchemaHelper) {
check_options_correctness_against_schema(this, schema, options);
}
/**
* @property namespaceIndex
* @type {Int32}
*/
this.namespaceIndex = initialize_field(schema.fields[0], options.namespaceIndex);
/**
* @property name
* @type {UAString}
*/
this.name = initialize_field(schema.fields[1], options.name);
}
constructor(options?: { statusCode?: StatusCode, reason?: string}) {
options = options || {};
const schema = schemaTCPErrorMessage;
super();
/* istanbul ignore next */
if (parameters.debugSchemaHelper) {
check_options_correctness_against_schema(this, schema, options);
}
this.statusCode = initialize_field(schema.fields[0], options.statusCode);
this.reason = initialize_field(schema.fields[1], options.reason);
}
constructor(options?: HelloMessageOptions) {
options = options || {};
super();
const schema = schemaHelloMessage;
/* istanbul ignore next */
if (parameters.debugSchemaHelper) {
check_options_correctness_against_schema(this, schema, options);
}
this.protocolVersion = initialize_field(schema.fields[0], options.protocolVersion);
this.receiveBufferSize = initialize_field(schema.fields[1], options.receiveBufferSize);
this.sendBufferSize = initialize_field(schema.fields[2], options.sendBufferSize);
this.maxMessageSize = initialize_field(schema.fields[3], options.maxMessageSize);
this.maxChunkCount = initialize_field(schema.fields[4], options.maxChunkCount);
this.endpointUrl = initialize_field(schema.fields[5], options.endpointUrl);
}
constructor(options?: any) {
options = options || {};
super();
const schema = schemaAsymmetricAlgorithmSecurityHeader;
/* istanbul ignore next */
if (parameters.debugSchemaHelper) {
check_options_correctness_against_schema(this, schema, options);
}
this.securityPolicyUri = initialize_field(schema.fields[0], options.securityPolicyUri);
this.senderCertificate = initialize_field(schema.fields[1], options.senderCertificate);
this.receiverCertificateThumbprint = initialize_field(schema.fields[2], options.receiverCertificateThumbprint);
}
constructor(options: any, schema: StructuredTypeSchema, typeDictionary: TypeDictionary) {
assert(schema, "expecting a schema here ");
assert(typeDictionary, "expecting a typeDic");
super(options);
options = options || {};
this.__schema = schema;
this._typeDictionary = typeDictionary;
check_options_correctness_against_schema(this, this.schema, options);
initializeFields(this as any, options, this.schema, typeDictionary);
}