/** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.19.1 * source: testsystem/v1/common/common.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace testsystem.v1.common { export enum TestStatus { UNKNOWN = 0, PASSED = 1, FAILED = 2, SKIPPED = 3, BROKEN = 4, TIMEDOUT = 5, INTERRUPTED = 6, RUNNING = 7, NOT_RUN = 8 } export class Attachment extends pb_1.Message { #one_of_decls: number[][] = [[3, 4]]; constructor(data?: any[] | ({ name?: string; mime_type?: string; } & (({ content?: Uint8Array; uri?: never; } | { content?: never; uri?: string; })))) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; } if ("mime_type" in data && data.mime_type != undefined) { this.mime_type = data.mime_type; } if ("content" in data && data.content != undefined) { this.content = data.content; } if ("uri" in data && data.uri != undefined) { this.uri = data.uri; } } } get name() { return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } get mime_type() { return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set mime_type(value: string) { pb_1.Message.setField(this, 2, value); } get content() { return pb_1.Message.getFieldWithDefault(this, 3, new Uint8Array(0)) as Uint8Array; } set content(value: Uint8Array) { pb_1.Message.setOneofField(this, 3, this.#one_of_decls[0], value); } get has_content() { return pb_1.Message.getField(this, 3) != null; } get uri() { return pb_1.Message.getFieldWithDefault(this, 4, "") as string; } set uri(value: string) { pb_1.Message.setOneofField(this, 4, this.#one_of_decls[0], value); } get has_uri() { return pb_1.Message.getField(this, 4) != null; } get payload() { const cases: { [index: number]: "none" | "content" | "uri"; } = { 0: "none", 3: "content", 4: "uri" }; return cases[pb_1.Message.computeOneofCase(this, [3, 4])]; } static fromObject(data: { name?: string; mime_type?: string; content?: Uint8Array; uri?: string; }): Attachment { const message = new Attachment({}); if (data.name != null) { message.name = data.name; } if (data.mime_type != null) { message.mime_type = data.mime_type; } if (data.content != null) { message.content = data.content; } if (data.uri != null) { message.uri = data.uri; } return message; } toObject() { const data: { name?: string; mime_type?: string; content?: Uint8Array; uri?: string; } = {}; if (this.name != null) { data.name = this.name; } if (this.mime_type != null) { data.mime_type = this.mime_type; } if (this.content != null) { data.content = this.content; } if (this.uri != null) { data.uri = this.uri; } 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.name.length) writer.writeString(1, this.name); if (this.mime_type.length) writer.writeString(2, this.mime_type); if (this.has_content) writer.writeBytes(3, this.content); if (this.has_uri) writer.writeString(4, this.uri); if (!w) return writer.getResultBuffer(); } static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Attachment { const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Attachment(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: message.name = reader.readString(); break; case 2: message.mime_type = reader.readString(); break; case 3: message.content = reader.readBytes(); break; case 4: message.uri = reader.readString(); break; default: reader.skipField(); } } return message; } serializeBinary(): Uint8Array { return this.serialize(); } static deserializeBinary(bytes: Uint8Array): Attachment { return Attachment.deserialize(bytes); } } }