/** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.19.1 * source: testsystem/v1/entities/test_suite.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../common/common"; import * as dependency_2 from "./test_case"; import * as dependency_3 from "./../../../google/protobuf/timestamp"; import * as dependency_4 from "./../../../google/protobuf/duration"; import * as pb_1 from "google-protobuf"; export namespace testsystem.v1.entities { export enum SuiteType { ROOT = 0, PROJECT = 1, SUBSUITE = 2, FILE = 3 } export class TestSuiteRun extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; name?: string; description?: string; run_id?: string; start_time?: dependency_3.google.protobuf.Timestamp; end_time?: dependency_3.google.protobuf.Timestamp; duration?: dependency_4.google.protobuf.Duration; status?: dependency_1.testsystem.v1.common.TestStatus; metadata?: Map; location?: string; type?: SuiteType; parent_suite_id?: string; test_case_ids?: string[]; sub_suite_ids?: string[]; project?: string; initiated_by?: string; author?: string; owner?: string; test_cases?: dependency_2.testsystem.v1.entities.TestCaseRun[]; sub_suites?: TestSuiteRun[]; execution_id?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [13, 14, 19, 20], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; } if ("name" in data && data.name != undefined) { this.name = data.name; } if ("description" in data && data.description != undefined) { this.description = data.description; } if ("run_id" in data && data.run_id != undefined) { this.run_id = data.run_id; } if ("start_time" in data && data.start_time != undefined) { this.start_time = data.start_time; } if ("end_time" in data && data.end_time != undefined) { this.end_time = data.end_time; } if ("duration" in data && data.duration != undefined) { this.duration = data.duration; } if ("status" in data && data.status != undefined) { this.status = data.status; } if ("metadata" in data && data.metadata != undefined) { this.metadata = data.metadata; } if ("location" in data && data.location != undefined) { this.location = data.location; } if ("type" in data && data.type != undefined) { this.type = data.type; } if ("parent_suite_id" in data && data.parent_suite_id != undefined) { this.parent_suite_id = data.parent_suite_id; } if ("test_case_ids" in data && data.test_case_ids != undefined) { this.test_case_ids = data.test_case_ids; } if ("sub_suite_ids" in data && data.sub_suite_ids != undefined) { this.sub_suite_ids = data.sub_suite_ids; } if ("project" in data && data.project != undefined) { this.project = data.project; } if ("initiated_by" in data && data.initiated_by != undefined) { this.initiated_by = data.initiated_by; } if ("author" in data && data.author != undefined) { this.author = data.author; } if ("owner" in data && data.owner != undefined) { this.owner = data.owner; } if ("test_cases" in data && data.test_cases != undefined) { this.test_cases = data.test_cases; } if ("sub_suites" in data && data.sub_suites != undefined) { this.sub_suites = data.sub_suites; } if ("execution_id" in data && data.execution_id != undefined) { this.execution_id = data.execution_id; } } if (!this.metadata) this.metadata = new Map(); } get id() { return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get name() { return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set name(value: string) { pb_1.Message.setField(this, 2, value); } get description() { return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set description(value: string) { pb_1.Message.setField(this, 3, value); } get run_id() { return pb_1.Message.getFieldWithDefault(this, 4, "") as string; } set run_id(value: string) { pb_1.Message.setField(this, 4, value); } get start_time() { return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5) as dependency_3.google.protobuf.Timestamp; } set start_time(value: dependency_3.google.protobuf.Timestamp) { pb_1.Message.setWrapperField(this, 5, value); } get has_start_time() { return pb_1.Message.getField(this, 5) != null; } get end_time() { return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 6) as dependency_3.google.protobuf.Timestamp; } set end_time(value: dependency_3.google.protobuf.Timestamp) { pb_1.Message.setWrapperField(this, 6, value); } get has_end_time() { return pb_1.Message.getField(this, 6) != null; } get duration() { return pb_1.Message.getWrapperField(this, dependency_4.google.protobuf.Duration, 7) as dependency_4.google.protobuf.Duration; } set duration(value: dependency_4.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 7, value); } get has_duration() { return pb_1.Message.getField(this, 7) != null; } get status() { return pb_1.Message.getFieldWithDefault(this, 8, dependency_1.testsystem.v1.common.TestStatus.UNKNOWN) as dependency_1.testsystem.v1.common.TestStatus; } set status(value: dependency_1.testsystem.v1.common.TestStatus) { pb_1.Message.setField(this, 8, value); } get metadata() { return pb_1.Message.getField(this, 9) as any as Map; } set metadata(value: Map) { pb_1.Message.setField(this, 9, value as any); } get location() { return pb_1.Message.getFieldWithDefault(this, 10, "") as string; } set location(value: string) { pb_1.Message.setField(this, 10, value); } get type() { return pb_1.Message.getFieldWithDefault(this, 11, SuiteType.ROOT) as SuiteType; } set type(value: SuiteType) { pb_1.Message.setField(this, 11, value); } get parent_suite_id() { return pb_1.Message.getFieldWithDefault(this, 12, "") as string; } set parent_suite_id(value: string) { pb_1.Message.setField(this, 12, value); } get test_case_ids() { return pb_1.Message.getFieldWithDefault(this, 13, []) as string[]; } set test_case_ids(value: string[]) { pb_1.Message.setField(this, 13, value); } get sub_suite_ids() { return pb_1.Message.getFieldWithDefault(this, 14, []) as string[]; } set sub_suite_ids(value: string[]) { pb_1.Message.setField(this, 14, value); } get project() { return pb_1.Message.getFieldWithDefault(this, 15, "") as string; } set project(value: string) { pb_1.Message.setField(this, 15, value); } get initiated_by() { return pb_1.Message.getFieldWithDefault(this, 16, "") as string; } set initiated_by(value: string) { pb_1.Message.setField(this, 16, value); } get author() { return pb_1.Message.getFieldWithDefault(this, 17, "") as string; } set author(value: string) { pb_1.Message.setField(this, 17, value); } get owner() { return pb_1.Message.getFieldWithDefault(this, 18, "") as string; } set owner(value: string) { pb_1.Message.setField(this, 18, value); } get test_cases() { return pb_1.Message.getRepeatedWrapperField(this, dependency_2.testsystem.v1.entities.TestCaseRun, 19) as dependency_2.testsystem.v1.entities.TestCaseRun[]; } set test_cases(value: dependency_2.testsystem.v1.entities.TestCaseRun[]) { pb_1.Message.setRepeatedWrapperField(this, 19, value); } get sub_suites() { return pb_1.Message.getRepeatedWrapperField(this, TestSuiteRun, 20) as TestSuiteRun[]; } set sub_suites(value: TestSuiteRun[]) { pb_1.Message.setRepeatedWrapperField(this, 20, value); } get execution_id() { return pb_1.Message.getFieldWithDefault(this, 21, "") as string; } set execution_id(value: string) { pb_1.Message.setField(this, 21, value); } static fromObject(data: { id?: string; name?: string; description?: string; run_id?: string; start_time?: ReturnType; end_time?: ReturnType; duration?: ReturnType; status?: dependency_1.testsystem.v1.common.TestStatus; metadata?: { [key: string]: string; }; location?: string; type?: SuiteType; parent_suite_id?: string; test_case_ids?: string[]; sub_suite_ids?: string[]; project?: string; initiated_by?: string; author?: string; owner?: string; test_cases?: ReturnType[]; sub_suites?: ReturnType[]; execution_id?: string; }): TestSuiteRun { const message = new TestSuiteRun({}); if (data.id != null) { message.id = data.id; } if (data.name != null) { message.name = data.name; } if (data.description != null) { message.description = data.description; } if (data.run_id != null) { message.run_id = data.run_id; } if (data.start_time != null) { message.start_time = dependency_3.google.protobuf.Timestamp.fromObject(data.start_time); } if (data.end_time != null) { message.end_time = dependency_3.google.protobuf.Timestamp.fromObject(data.end_time); } if (data.duration != null) { message.duration = dependency_4.google.protobuf.Duration.fromObject(data.duration); } if (data.status != null) { message.status = data.status; } if (typeof data.metadata == "object") { message.metadata = new Map(Object.entries(data.metadata)); } if (data.location != null) { message.location = data.location; } if (data.type != null) { message.type = data.type; } if (data.parent_suite_id != null) { message.parent_suite_id = data.parent_suite_id; } if (data.test_case_ids != null) { message.test_case_ids = data.test_case_ids; } if (data.sub_suite_ids != null) { message.sub_suite_ids = data.sub_suite_ids; } if (data.project != null) { message.project = data.project; } if (data.initiated_by != null) { message.initiated_by = data.initiated_by; } if (data.author != null) { message.author = data.author; } if (data.owner != null) { message.owner = data.owner; } if (data.test_cases != null) { message.test_cases = data.test_cases.map(item => dependency_2.testsystem.v1.entities.TestCaseRun.fromObject(item)); } if (data.sub_suites != null) { message.sub_suites = data.sub_suites.map(item => TestSuiteRun.fromObject(item)); } if (data.execution_id != null) { message.execution_id = data.execution_id; } return message; } toObject() { const data: { id?: string; name?: string; description?: string; run_id?: string; start_time?: ReturnType; end_time?: ReturnType; duration?: ReturnType; status?: dependency_1.testsystem.v1.common.TestStatus; metadata?: { [key: string]: string; }; location?: string; type?: SuiteType; parent_suite_id?: string; test_case_ids?: string[]; sub_suite_ids?: string[]; project?: string; initiated_by?: string; author?: string; owner?: string; test_cases?: ReturnType[]; sub_suites?: ReturnType[]; execution_id?: string; } = {}; if (this.id != null) { data.id = this.id; } if (this.name != null) { data.name = this.name; } if (this.description != null) { data.description = this.description; } if (this.run_id != null) { data.run_id = this.run_id; } if (this.start_time != null) { data.start_time = this.start_time.toObject(); } if (this.end_time != null) { data.end_time = this.end_time.toObject(); } if (this.duration != null) { data.duration = this.duration.toObject(); } if (this.status != null) { data.status = this.status; } if (this.metadata != null) { data.metadata = (Object.fromEntries)(this.metadata); } if (this.location != null) { data.location = this.location; } if (this.type != null) { data.type = this.type; } if (this.parent_suite_id != null) { data.parent_suite_id = this.parent_suite_id; } if (this.test_case_ids != null) { data.test_case_ids = this.test_case_ids; } if (this.sub_suite_ids != null) { data.sub_suite_ids = this.sub_suite_ids; } if (this.project != null) { data.project = this.project; } if (this.initiated_by != null) { data.initiated_by = this.initiated_by; } if (this.author != null) { data.author = this.author; } if (this.owner != null) { data.owner = this.owner; } if (this.test_cases != null) { data.test_cases = this.test_cases.map((item: dependency_2.testsystem.v1.entities.TestCaseRun) => item.toObject()); } if (this.sub_suites != null) { data.sub_suites = this.sub_suites.map((item: TestSuiteRun) => item.toObject()); } if (this.execution_id != null) { data.execution_id = this.execution_id; } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.id.length) writer.writeString(1, this.id); if (this.name.length) writer.writeString(2, this.name); if (this.description.length) writer.writeString(3, this.description); if (this.run_id.length) writer.writeString(4, this.run_id); if (this.has_start_time) writer.writeMessage(5, this.start_time, () => this.start_time.serialize(writer)); if (this.has_end_time) writer.writeMessage(6, this.end_time, () => this.end_time.serialize(writer)); if (this.has_duration) writer.writeMessage(7, this.duration, () => this.duration.serialize(writer)); if (this.status != dependency_1.testsystem.v1.common.TestStatus.UNKNOWN) writer.writeEnum(8, this.status); for (const [key, value] of this.metadata) { writer.writeMessage(9, this.metadata, () => { writer.writeString(1, key); writer.writeString(2, value); }); } if (this.location.length) writer.writeString(10, this.location); if (this.type != SuiteType.ROOT) writer.writeEnum(11, this.type); if (this.parent_suite_id.length) writer.writeString(12, this.parent_suite_id); if (this.test_case_ids.length) writer.writeRepeatedString(13, this.test_case_ids); if (this.sub_suite_ids.length) writer.writeRepeatedString(14, this.sub_suite_ids); if (this.project.length) writer.writeString(15, this.project); if (this.initiated_by.length) writer.writeString(16, this.initiated_by); if (this.author.length) writer.writeString(17, this.author); if (this.owner.length) writer.writeString(18, this.owner); if (this.test_cases.length) writer.writeRepeatedMessage(19, this.test_cases, (item: dependency_2.testsystem.v1.entities.TestCaseRun) => item.serialize(writer)); if (this.sub_suites.length) writer.writeRepeatedMessage(20, this.sub_suites, (item: TestSuiteRun) => item.serialize(writer)); if (this.execution_id.length) writer.writeString(21, this.execution_id); if (!w) return writer.getResultBuffer(); } static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TestSuiteRun { const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TestSuiteRun(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: message.id = reader.readString(); break; case 2: message.name = reader.readString(); break; case 3: message.description = reader.readString(); break; case 4: message.run_id = reader.readString(); break; case 5: reader.readMessage(message.start_time, () => message.start_time = dependency_3.google.protobuf.Timestamp.deserialize(reader)); break; case 6: reader.readMessage(message.end_time, () => message.end_time = dependency_3.google.protobuf.Timestamp.deserialize(reader)); break; case 7: reader.readMessage(message.duration, () => message.duration = dependency_4.google.protobuf.Duration.deserialize(reader)); break; case 8: message.status = reader.readEnum(); break; case 9: reader.readMessage(message, () => pb_1.Map.deserializeBinary(message.metadata as any, reader, reader.readString, reader.readString)); break; case 10: message.location = reader.readString(); break; case 11: message.type = reader.readEnum(); break; case 12: message.parent_suite_id = reader.readString(); break; case 13: pb_1.Message.addToRepeatedField(message, 13, reader.readString()); break; case 14: pb_1.Message.addToRepeatedField(message, 14, reader.readString()); break; case 15: message.project = reader.readString(); break; case 16: message.initiated_by = reader.readString(); break; case 17: message.author = reader.readString(); break; case 18: message.owner = reader.readString(); break; case 19: reader.readMessage(message.test_cases, () => pb_1.Message.addToRepeatedWrapperField(message, 19, dependency_2.testsystem.v1.entities.TestCaseRun.deserialize(reader), dependency_2.testsystem.v1.entities.TestCaseRun)); break; case 20: reader.readMessage(message.sub_suites, () => pb_1.Message.addToRepeatedWrapperField(message, 20, TestSuiteRun.deserialize(reader), TestSuiteRun)); break; case 21: message.execution_id = reader.readString(); break; default: reader.skipField(); } } return message; } serializeBinary(): Uint8Array { return this.serialize(); } static deserializeBinary(bytes: Uint8Array): TestSuiteRun { return TestSuiteRun.deserialize(bytes); } } }