Innovenergy_trunk/csharp/lib/Wireformat/ts/VictronV1/VictronTopologyV1.ts

105 lines
2.6 KiB
TypeScript

/* eslint-disable */
import Long from "long";
import _m0 from "protobufjs/minimal";
import { Device } from "../VictronV1/Device";
export const protobufPackage = "";
export interface VictronTopologyV1 {
root: Device | undefined;
}
function createBaseVictronTopologyV1(): VictronTopologyV1 {
return { root: undefined };
}
export const VictronTopologyV1 = {
encode(
message: VictronTopologyV1,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.root !== undefined) {
Device.encode(message.root, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): VictronTopologyV1 {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseVictronTopologyV1();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.root = Device.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): VictronTopologyV1 {
return {
root: isSet(object.root) ? Device.fromJSON(object.root) : undefined,
};
},
toJSON(message: VictronTopologyV1): unknown {
const obj: any = {};
message.root !== undefined &&
(obj.root = message.root ? Device.toJSON(message.root) : undefined);
return obj;
},
fromPartial<I extends Exact<DeepPartial<VictronTopologyV1>, I>>(
object: I
): VictronTopologyV1 {
const message = createBaseVictronTopologyV1();
message.root =
object.root !== undefined && object.root !== null
? Device.fromPartial(object.root)
: undefined;
return message;
},
};
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>
? Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & Record<
Exclude<keyof I, KeysOfUnion<P>>,
never
>;
if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}