@firestore-emulator/proto
Version:
Generated Firestore Protobufs For Firestore Emulator
74 lines (73 loc) • 2.41 kB
text/typescript
/**
* Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.19.1
* source: google/protobuf/field_mask.proto
* git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf";
export class FieldMask extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
paths?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("paths" in data && data.paths != undefined) {
this.paths = data.paths;
}
}
}
get paths() {
return pb_1.Message.getFieldWithDefault(this, 1, []) as string[];
}
set paths(value: string[]) {
pb_1.Message.setField(this, 1, value);
}
static fromObject(data: {
paths?: string[];
}): FieldMask {
const message = new FieldMask({});
if (data.paths != null) {
message.paths = data.paths;
}
return message;
}
toObject() {
const data: {
paths?: string[];
} = {};
if (this.paths != null) {
data.paths = this.paths;
}
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.paths.length)
writer.writeRepeatedString(1, this.paths);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FieldMask {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FieldMask();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
pb_1.Message.addToRepeatedField(message, 1, reader.readString());
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static override deserializeBinary(bytes: Uint8Array): FieldMask {
return FieldMask.deserialize(bytes);
}
}