spot-sdk-ts
Version:
TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics
1,145 lines • 68.6 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetEstopSystemStatusResponse = exports.GetEstopSystemStatusRequest = exports.SetEstopConfigResponse = exports.SetEstopConfigRequest = exports.GetEstopConfigResponse = exports.GetEstopConfigRequest = exports.DeregisterEstopEndpointResponse = exports.DeregisterEstopEndpointRequest = exports.RegisterEstopEndpointResponse = exports.RegisterEstopEndpointRequest = exports.EstopCheckInResponse = exports.EstopCheckInRequest = exports.EstopSystemStatus = exports.EstopEndpointWithStatus = exports.EstopConfig = exports.EstopEndpoint = exports.setEstopConfigResponse_StatusToJSON = exports.setEstopConfigResponse_StatusFromJSON = exports.SetEstopConfigResponse_Status = exports.deregisterEstopEndpointResponse_StatusToJSON = exports.deregisterEstopEndpointResponse_StatusFromJSON = exports.DeregisterEstopEndpointResponse_Status = exports.registerEstopEndpointResponse_StatusToJSON = exports.registerEstopEndpointResponse_StatusFromJSON = exports.RegisterEstopEndpointResponse_Status = exports.estopCheckInResponse_StatusToJSON = exports.estopCheckInResponse_StatusFromJSON = exports.EstopCheckInResponse_Status = exports.estopStopLevelToJSON = exports.estopStopLevelFromJSON = exports.EstopStopLevel = exports.protobufPackage = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const duration_1 = require("../../google/protobuf/duration");
const header_1 = require("./header");
const minimal_1 = __importDefault(require("protobufjs/minimal"));
exports.protobufPackage = "bosdyn.api";
/** The state of the E-Stop system. */
var EstopStopLevel;
(function (EstopStopLevel) {
/** ESTOP_LEVEL_UNKNOWN - Invalid stop level. */
EstopStopLevel[EstopStopLevel["ESTOP_LEVEL_UNKNOWN"] = 0] = "ESTOP_LEVEL_UNKNOWN";
/** ESTOP_LEVEL_CUT - Immediately cut power to the actuators. */
EstopStopLevel[EstopStopLevel["ESTOP_LEVEL_CUT"] = 1] = "ESTOP_LEVEL_CUT";
/** ESTOP_LEVEL_SETTLE_THEN_CUT - Prepare for loss of actuator power, then cut power. */
EstopStopLevel[EstopStopLevel["ESTOP_LEVEL_SETTLE_THEN_CUT"] = 2] = "ESTOP_LEVEL_SETTLE_THEN_CUT";
/** ESTOP_LEVEL_NONE - No-stop level. The endpoint believes the robot is safe to operate. */
EstopStopLevel[EstopStopLevel["ESTOP_LEVEL_NONE"] = 4] = "ESTOP_LEVEL_NONE";
EstopStopLevel[EstopStopLevel["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(EstopStopLevel = exports.EstopStopLevel || (exports.EstopStopLevel = {}));
function estopStopLevelFromJSON(object) {
switch (object) {
case 0:
case "ESTOP_LEVEL_UNKNOWN":
return EstopStopLevel.ESTOP_LEVEL_UNKNOWN;
case 1:
case "ESTOP_LEVEL_CUT":
return EstopStopLevel.ESTOP_LEVEL_CUT;
case 2:
case "ESTOP_LEVEL_SETTLE_THEN_CUT":
return EstopStopLevel.ESTOP_LEVEL_SETTLE_THEN_CUT;
case 4:
case "ESTOP_LEVEL_NONE":
return EstopStopLevel.ESTOP_LEVEL_NONE;
case -1:
case "UNRECOGNIZED":
default:
return EstopStopLevel.UNRECOGNIZED;
}
}
exports.estopStopLevelFromJSON = estopStopLevelFromJSON;
function estopStopLevelToJSON(object) {
switch (object) {
case EstopStopLevel.ESTOP_LEVEL_UNKNOWN:
return "ESTOP_LEVEL_UNKNOWN";
case EstopStopLevel.ESTOP_LEVEL_CUT:
return "ESTOP_LEVEL_CUT";
case EstopStopLevel.ESTOP_LEVEL_SETTLE_THEN_CUT:
return "ESTOP_LEVEL_SETTLE_THEN_CUT";
case EstopStopLevel.ESTOP_LEVEL_NONE:
return "ESTOP_LEVEL_NONE";
case EstopStopLevel.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.estopStopLevelToJSON = estopStopLevelToJSON;
var EstopCheckInResponse_Status;
(function (EstopCheckInResponse_Status) {
/** STATUS_UNKNOWN - Unknown error occurred. */
EstopCheckInResponse_Status[EstopCheckInResponse_Status["STATUS_UNKNOWN"] = 0] = "STATUS_UNKNOWN";
/** STATUS_OK - Valid challenge has been returned. */
EstopCheckInResponse_Status[EstopCheckInResponse_Status["STATUS_OK"] = 1] = "STATUS_OK";
/** STATUS_ENDPOINT_UNKNOWN - The endpoint specified in the request is not registered. */
EstopCheckInResponse_Status[EstopCheckInResponse_Status["STATUS_ENDPOINT_UNKNOWN"] = 2] = "STATUS_ENDPOINT_UNKNOWN";
/** STATUS_INCORRECT_CHALLENGE_RESPONSE - The challenge and/or response was incorrect. */
EstopCheckInResponse_Status[EstopCheckInResponse_Status["STATUS_INCORRECT_CHALLENGE_RESPONSE"] = 5] = "STATUS_INCORRECT_CHALLENGE_RESPONSE";
EstopCheckInResponse_Status[EstopCheckInResponse_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(EstopCheckInResponse_Status = exports.EstopCheckInResponse_Status || (exports.EstopCheckInResponse_Status = {}));
function estopCheckInResponse_StatusFromJSON(object) {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return EstopCheckInResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_OK":
return EstopCheckInResponse_Status.STATUS_OK;
case 2:
case "STATUS_ENDPOINT_UNKNOWN":
return EstopCheckInResponse_Status.STATUS_ENDPOINT_UNKNOWN;
case 5:
case "STATUS_INCORRECT_CHALLENGE_RESPONSE":
return EstopCheckInResponse_Status.STATUS_INCORRECT_CHALLENGE_RESPONSE;
case -1:
case "UNRECOGNIZED":
default:
return EstopCheckInResponse_Status.UNRECOGNIZED;
}
}
exports.estopCheckInResponse_StatusFromJSON = estopCheckInResponse_StatusFromJSON;
function estopCheckInResponse_StatusToJSON(object) {
switch (object) {
case EstopCheckInResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case EstopCheckInResponse_Status.STATUS_OK:
return "STATUS_OK";
case EstopCheckInResponse_Status.STATUS_ENDPOINT_UNKNOWN:
return "STATUS_ENDPOINT_UNKNOWN";
case EstopCheckInResponse_Status.STATUS_INCORRECT_CHALLENGE_RESPONSE:
return "STATUS_INCORRECT_CHALLENGE_RESPONSE";
case EstopCheckInResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.estopCheckInResponse_StatusToJSON = estopCheckInResponse_StatusToJSON;
var RegisterEstopEndpointResponse_Status;
(function (RegisterEstopEndpointResponse_Status) {
/** STATUS_UNKNOWN - An unknown / unexpected error occurred. */
RegisterEstopEndpointResponse_Status[RegisterEstopEndpointResponse_Status["STATUS_UNKNOWN"] = 0] = "STATUS_UNKNOWN";
/** STATUS_SUCCESS - Request succeeded. */
RegisterEstopEndpointResponse_Status[RegisterEstopEndpointResponse_Status["STATUS_SUCCESS"] = 1] = "STATUS_SUCCESS";
/** STATUS_ENDPOINT_MISMATCH - Target endpoint did not match. */
RegisterEstopEndpointResponse_Status[RegisterEstopEndpointResponse_Status["STATUS_ENDPOINT_MISMATCH"] = 2] = "STATUS_ENDPOINT_MISMATCH";
/** STATUS_CONFIG_MISMATCH - Registered to wrong configuration. */
RegisterEstopEndpointResponse_Status[RegisterEstopEndpointResponse_Status["STATUS_CONFIG_MISMATCH"] = 3] = "STATUS_CONFIG_MISMATCH";
/** STATUS_INVALID_ENDPOINT - New endpoint was invalid. */
RegisterEstopEndpointResponse_Status[RegisterEstopEndpointResponse_Status["STATUS_INVALID_ENDPOINT"] = 4] = "STATUS_INVALID_ENDPOINT";
RegisterEstopEndpointResponse_Status[RegisterEstopEndpointResponse_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(RegisterEstopEndpointResponse_Status = exports.RegisterEstopEndpointResponse_Status || (exports.RegisterEstopEndpointResponse_Status = {}));
function registerEstopEndpointResponse_StatusFromJSON(object) {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return RegisterEstopEndpointResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_SUCCESS":
return RegisterEstopEndpointResponse_Status.STATUS_SUCCESS;
case 2:
case "STATUS_ENDPOINT_MISMATCH":
return RegisterEstopEndpointResponse_Status.STATUS_ENDPOINT_MISMATCH;
case 3:
case "STATUS_CONFIG_MISMATCH":
return RegisterEstopEndpointResponse_Status.STATUS_CONFIG_MISMATCH;
case 4:
case "STATUS_INVALID_ENDPOINT":
return RegisterEstopEndpointResponse_Status.STATUS_INVALID_ENDPOINT;
case -1:
case "UNRECOGNIZED":
default:
return RegisterEstopEndpointResponse_Status.UNRECOGNIZED;
}
}
exports.registerEstopEndpointResponse_StatusFromJSON = registerEstopEndpointResponse_StatusFromJSON;
function registerEstopEndpointResponse_StatusToJSON(object) {
switch (object) {
case RegisterEstopEndpointResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case RegisterEstopEndpointResponse_Status.STATUS_SUCCESS:
return "STATUS_SUCCESS";
case RegisterEstopEndpointResponse_Status.STATUS_ENDPOINT_MISMATCH:
return "STATUS_ENDPOINT_MISMATCH";
case RegisterEstopEndpointResponse_Status.STATUS_CONFIG_MISMATCH:
return "STATUS_CONFIG_MISMATCH";
case RegisterEstopEndpointResponse_Status.STATUS_INVALID_ENDPOINT:
return "STATUS_INVALID_ENDPOINT";
case RegisterEstopEndpointResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.registerEstopEndpointResponse_StatusToJSON = registerEstopEndpointResponse_StatusToJSON;
var DeregisterEstopEndpointResponse_Status;
(function (DeregisterEstopEndpointResponse_Status) {
/** STATUS_UNKNOWN - An unknown / unexpected error occurred. */
DeregisterEstopEndpointResponse_Status[DeregisterEstopEndpointResponse_Status["STATUS_UNKNOWN"] = 0] = "STATUS_UNKNOWN";
/** STATUS_SUCCESS - Request succeeded. */
DeregisterEstopEndpointResponse_Status[DeregisterEstopEndpointResponse_Status["STATUS_SUCCESS"] = 1] = "STATUS_SUCCESS";
/** STATUS_ENDPOINT_MISMATCH - Target endpoint did not match. */
DeregisterEstopEndpointResponse_Status[DeregisterEstopEndpointResponse_Status["STATUS_ENDPOINT_MISMATCH"] = 2] = "STATUS_ENDPOINT_MISMATCH";
/** STATUS_CONFIG_MISMATCH - Registered to wrong configuration. */
DeregisterEstopEndpointResponse_Status[DeregisterEstopEndpointResponse_Status["STATUS_CONFIG_MISMATCH"] = 3] = "STATUS_CONFIG_MISMATCH";
/** STATUS_MOTORS_ON - You cannot deregister an endpoint while the motors are on. */
DeregisterEstopEndpointResponse_Status[DeregisterEstopEndpointResponse_Status["STATUS_MOTORS_ON"] = 4] = "STATUS_MOTORS_ON";
DeregisterEstopEndpointResponse_Status[DeregisterEstopEndpointResponse_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(DeregisterEstopEndpointResponse_Status = exports.DeregisterEstopEndpointResponse_Status || (exports.DeregisterEstopEndpointResponse_Status = {}));
function deregisterEstopEndpointResponse_StatusFromJSON(object) {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return DeregisterEstopEndpointResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_SUCCESS":
return DeregisterEstopEndpointResponse_Status.STATUS_SUCCESS;
case 2:
case "STATUS_ENDPOINT_MISMATCH":
return DeregisterEstopEndpointResponse_Status.STATUS_ENDPOINT_MISMATCH;
case 3:
case "STATUS_CONFIG_MISMATCH":
return DeregisterEstopEndpointResponse_Status.STATUS_CONFIG_MISMATCH;
case 4:
case "STATUS_MOTORS_ON":
return DeregisterEstopEndpointResponse_Status.STATUS_MOTORS_ON;
case -1:
case "UNRECOGNIZED":
default:
return DeregisterEstopEndpointResponse_Status.UNRECOGNIZED;
}
}
exports.deregisterEstopEndpointResponse_StatusFromJSON = deregisterEstopEndpointResponse_StatusFromJSON;
function deregisterEstopEndpointResponse_StatusToJSON(object) {
switch (object) {
case DeregisterEstopEndpointResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case DeregisterEstopEndpointResponse_Status.STATUS_SUCCESS:
return "STATUS_SUCCESS";
case DeregisterEstopEndpointResponse_Status.STATUS_ENDPOINT_MISMATCH:
return "STATUS_ENDPOINT_MISMATCH";
case DeregisterEstopEndpointResponse_Status.STATUS_CONFIG_MISMATCH:
return "STATUS_CONFIG_MISMATCH";
case DeregisterEstopEndpointResponse_Status.STATUS_MOTORS_ON:
return "STATUS_MOTORS_ON";
case DeregisterEstopEndpointResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.deregisterEstopEndpointResponse_StatusToJSON = deregisterEstopEndpointResponse_StatusToJSON;
var SetEstopConfigResponse_Status;
(function (SetEstopConfigResponse_Status) {
/** STATUS_UNKNOWN - An unknown / unexpected error occurred. */
SetEstopConfigResponse_Status[SetEstopConfigResponse_Status["STATUS_UNKNOWN"] = 0] = "STATUS_UNKNOWN";
/** STATUS_SUCCESS - Request succeeded. */
SetEstopConfigResponse_Status[SetEstopConfigResponse_Status["STATUS_SUCCESS"] = 1] = "STATUS_SUCCESS";
/** STATUS_INVALID_ID - Tried to replace a EstopConfig, but provided bad ID. */
SetEstopConfigResponse_Status[SetEstopConfigResponse_Status["STATUS_INVALID_ID"] = 2] = "STATUS_INVALID_ID";
/** STATUS_MOTORS_ON - You cannot set a configuration while the motors are on. */
SetEstopConfigResponse_Status[SetEstopConfigResponse_Status["STATUS_MOTORS_ON"] = 4] = "STATUS_MOTORS_ON";
SetEstopConfigResponse_Status[SetEstopConfigResponse_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(SetEstopConfigResponse_Status = exports.SetEstopConfigResponse_Status || (exports.SetEstopConfigResponse_Status = {}));
function setEstopConfigResponse_StatusFromJSON(object) {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return SetEstopConfigResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_SUCCESS":
return SetEstopConfigResponse_Status.STATUS_SUCCESS;
case 2:
case "STATUS_INVALID_ID":
return SetEstopConfigResponse_Status.STATUS_INVALID_ID;
case 4:
case "STATUS_MOTORS_ON":
return SetEstopConfigResponse_Status.STATUS_MOTORS_ON;
case -1:
case "UNRECOGNIZED":
default:
return SetEstopConfigResponse_Status.UNRECOGNIZED;
}
}
exports.setEstopConfigResponse_StatusFromJSON = setEstopConfigResponse_StatusFromJSON;
function setEstopConfigResponse_StatusToJSON(object) {
switch (object) {
case SetEstopConfigResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case SetEstopConfigResponse_Status.STATUS_SUCCESS:
return "STATUS_SUCCESS";
case SetEstopConfigResponse_Status.STATUS_INVALID_ID:
return "STATUS_INVALID_ID";
case SetEstopConfigResponse_Status.STATUS_MOTORS_ON:
return "STATUS_MOTORS_ON";
case SetEstopConfigResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.setEstopConfigResponse_StatusToJSON = setEstopConfigResponse_StatusToJSON;
function createBaseEstopEndpoint() {
return {
role: "",
name: "",
uniqueId: "",
timeout: undefined,
cutPowerTimeout: undefined,
};
}
exports.EstopEndpoint = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.role !== "") {
writer.uint32(10).string(message.role);
}
if (message.name !== "") {
writer.uint32(18).string(message.name);
}
if (message.uniqueId !== "") {
writer.uint32(26).string(message.uniqueId);
}
if (message.timeout !== undefined) {
duration_1.Duration.encode(message.timeout, writer.uint32(34).fork()).ldelim();
}
if (message.cutPowerTimeout !== undefined) {
duration_1.Duration.encode(message.cutPowerTimeout, writer.uint32(42).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEstopEndpoint();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.role = reader.string();
break;
case 2:
message.name = reader.string();
break;
case 3:
message.uniqueId = reader.string();
break;
case 4:
message.timeout = duration_1.Duration.decode(reader, reader.uint32());
break;
case 5:
message.cutPowerTimeout = duration_1.Duration.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
role: isSet(object.role) ? String(object.role) : "",
name: isSet(object.name) ? String(object.name) : "",
uniqueId: isSet(object.uniqueId) ? String(object.uniqueId) : "",
timeout: isSet(object.timeout)
? duration_1.Duration.fromJSON(object.timeout)
: undefined,
cutPowerTimeout: isSet(object.cutPowerTimeout)
? duration_1.Duration.fromJSON(object.cutPowerTimeout)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.role !== undefined && (obj.role = message.role);
message.name !== undefined && (obj.name = message.name);
message.uniqueId !== undefined && (obj.uniqueId = message.uniqueId);
message.timeout !== undefined &&
(obj.timeout = message.timeout
? duration_1.Duration.toJSON(message.timeout)
: undefined);
message.cutPowerTimeout !== undefined &&
(obj.cutPowerTimeout = message.cutPowerTimeout
? duration_1.Duration.toJSON(message.cutPowerTimeout)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseEstopEndpoint();
message.role = object.role ?? "";
message.name = object.name ?? "";
message.uniqueId = object.uniqueId ?? "";
message.timeout =
object.timeout !== undefined && object.timeout !== null
? duration_1.Duration.fromPartial(object.timeout)
: undefined;
message.cutPowerTimeout =
object.cutPowerTimeout !== undefined && object.cutPowerTimeout !== null
? duration_1.Duration.fromPartial(object.cutPowerTimeout)
: undefined;
return message;
},
};
function createBaseEstopConfig() {
return { endpoints: [], uniqueId: "" };
}
exports.EstopConfig = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.endpoints) {
exports.EstopEndpoint.encode(v, writer.uint32(10).fork()).ldelim();
}
if (message.uniqueId !== "") {
writer.uint32(18).string(message.uniqueId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEstopConfig();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.endpoints.push(exports.EstopEndpoint.decode(reader, reader.uint32()));
break;
case 2:
message.uniqueId = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
endpoints: Array.isArray(object?.endpoints)
? object.endpoints.map((e) => exports.EstopEndpoint.fromJSON(e))
: [],
uniqueId: isSet(object.uniqueId) ? String(object.uniqueId) : "",
};
},
toJSON(message) {
const obj = {};
if (message.endpoints) {
obj.endpoints = message.endpoints.map((e) => e ? exports.EstopEndpoint.toJSON(e) : undefined);
}
else {
obj.endpoints = [];
}
message.uniqueId !== undefined && (obj.uniqueId = message.uniqueId);
return obj;
},
fromPartial(object) {
const message = createBaseEstopConfig();
message.endpoints =
object.endpoints?.map((e) => exports.EstopEndpoint.fromPartial(e)) || [];
message.uniqueId = object.uniqueId ?? "";
return message;
},
};
function createBaseEstopEndpointWithStatus() {
return {
endpoint: undefined,
stopLevel: 0,
timeSinceValidResponse: undefined,
};
}
exports.EstopEndpointWithStatus = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.endpoint !== undefined) {
exports.EstopEndpoint.encode(message.endpoint, writer.uint32(10).fork()).ldelim();
}
if (message.stopLevel !== 0) {
writer.uint32(16).int32(message.stopLevel);
}
if (message.timeSinceValidResponse !== undefined) {
duration_1.Duration.encode(message.timeSinceValidResponse, writer.uint32(26).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEstopEndpointWithStatus();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.endpoint = exports.EstopEndpoint.decode(reader, reader.uint32());
break;
case 2:
message.stopLevel = reader.int32();
break;
case 3:
message.timeSinceValidResponse = duration_1.Duration.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
endpoint: isSet(object.endpoint)
? exports.EstopEndpoint.fromJSON(object.endpoint)
: undefined,
stopLevel: isSet(object.stopLevel)
? estopStopLevelFromJSON(object.stopLevel)
: 0,
timeSinceValidResponse: isSet(object.timeSinceValidResponse)
? duration_1.Duration.fromJSON(object.timeSinceValidResponse)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.endpoint !== undefined &&
(obj.endpoint = message.endpoint
? exports.EstopEndpoint.toJSON(message.endpoint)
: undefined);
message.stopLevel !== undefined &&
(obj.stopLevel = estopStopLevelToJSON(message.stopLevel));
message.timeSinceValidResponse !== undefined &&
(obj.timeSinceValidResponse = message.timeSinceValidResponse
? duration_1.Duration.toJSON(message.timeSinceValidResponse)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseEstopEndpointWithStatus();
message.endpoint =
object.endpoint !== undefined && object.endpoint !== null
? exports.EstopEndpoint.fromPartial(object.endpoint)
: undefined;
message.stopLevel = object.stopLevel ?? 0;
message.timeSinceValidResponse =
object.timeSinceValidResponse !== undefined &&
object.timeSinceValidResponse !== null
? duration_1.Duration.fromPartial(object.timeSinceValidResponse)
: undefined;
return message;
},
};
function createBaseEstopSystemStatus() {
return { endpoints: [], stopLevel: 0, stopLevelDetails: "" };
}
exports.EstopSystemStatus = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.endpoints) {
exports.EstopEndpointWithStatus.encode(v, writer.uint32(26).fork()).ldelim();
}
if (message.stopLevel !== 0) {
writer.uint32(32).int32(message.stopLevel);
}
if (message.stopLevelDetails !== "") {
writer.uint32(42).string(message.stopLevelDetails);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEstopSystemStatus();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 3:
message.endpoints.push(exports.EstopEndpointWithStatus.decode(reader, reader.uint32()));
break;
case 4:
message.stopLevel = reader.int32();
break;
case 5:
message.stopLevelDetails = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
endpoints: Array.isArray(object?.endpoints)
? object.endpoints.map((e) => exports.EstopEndpointWithStatus.fromJSON(e))
: [],
stopLevel: isSet(object.stopLevel)
? estopStopLevelFromJSON(object.stopLevel)
: 0,
stopLevelDetails: isSet(object.stopLevelDetails)
? String(object.stopLevelDetails)
: "",
};
},
toJSON(message) {
const obj = {};
if (message.endpoints) {
obj.endpoints = message.endpoints.map((e) => e ? exports.EstopEndpointWithStatus.toJSON(e) : undefined);
}
else {
obj.endpoints = [];
}
message.stopLevel !== undefined &&
(obj.stopLevel = estopStopLevelToJSON(message.stopLevel));
message.stopLevelDetails !== undefined &&
(obj.stopLevelDetails = message.stopLevelDetails);
return obj;
},
fromPartial(object) {
const message = createBaseEstopSystemStatus();
message.endpoints =
object.endpoints?.map((e) => exports.EstopEndpointWithStatus.fromPartial(e)) ||
[];
message.stopLevel = object.stopLevel ?? 0;
message.stopLevelDetails = object.stopLevelDetails ?? "";
return message;
},
};
function createBaseEstopCheckInRequest() {
return {
header: undefined,
endpoint: undefined,
challenge: 0,
response: 0,
stopLevel: 0,
};
}
exports.EstopCheckInRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.endpoint !== undefined) {
exports.EstopEndpoint.encode(message.endpoint, writer.uint32(18).fork()).ldelim();
}
if (message.challenge !== 0) {
writer.uint32(24).uint64(message.challenge);
}
if (message.response !== 0) {
writer.uint32(32).uint64(message.response);
}
if (message.stopLevel !== 0) {
writer.uint32(40).int32(message.stopLevel);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEstopCheckInRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.RequestHeader.decode(reader, reader.uint32());
break;
case 2:
message.endpoint = exports.EstopEndpoint.decode(reader, reader.uint32());
break;
case 3:
message.challenge = longToNumber(reader.uint64());
break;
case 4:
message.response = longToNumber(reader.uint64());
break;
case 5:
message.stopLevel = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.RequestHeader.fromJSON(object.header)
: undefined,
endpoint: isSet(object.endpoint)
? exports.EstopEndpoint.fromJSON(object.endpoint)
: undefined,
challenge: isSet(object.challenge) ? Number(object.challenge) : 0,
response: isSet(object.response) ? Number(object.response) : 0,
stopLevel: isSet(object.stopLevel)
? estopStopLevelFromJSON(object.stopLevel)
: 0,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.RequestHeader.toJSON(message.header)
: undefined);
message.endpoint !== undefined &&
(obj.endpoint = message.endpoint
? exports.EstopEndpoint.toJSON(message.endpoint)
: undefined);
message.challenge !== undefined &&
(obj.challenge = Math.round(message.challenge));
message.response !== undefined &&
(obj.response = Math.round(message.response));
message.stopLevel !== undefined &&
(obj.stopLevel = estopStopLevelToJSON(message.stopLevel));
return obj;
},
fromPartial(object) {
const message = createBaseEstopCheckInRequest();
message.header =
object.header !== undefined && object.header !== null
? header_1.RequestHeader.fromPartial(object.header)
: undefined;
message.endpoint =
object.endpoint !== undefined && object.endpoint !== null
? exports.EstopEndpoint.fromPartial(object.endpoint)
: undefined;
message.challenge = object.challenge ?? 0;
message.response = object.response ?? 0;
message.stopLevel = object.stopLevel ?? 0;
return message;
},
};
function createBaseEstopCheckInResponse() {
return { header: undefined, request: undefined, challenge: 0, status: 0 };
}
exports.EstopCheckInResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.ResponseHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.request !== undefined) {
exports.EstopCheckInRequest.encode(message.request, writer.uint32(18).fork()).ldelim();
}
if (message.challenge !== 0) {
writer.uint32(24).uint64(message.challenge);
}
if (message.status !== 0) {
writer.uint32(32).int32(message.status);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEstopCheckInResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.ResponseHeader.decode(reader, reader.uint32());
break;
case 2:
message.request = exports.EstopCheckInRequest.decode(reader, reader.uint32());
break;
case 3:
message.challenge = longToNumber(reader.uint64());
break;
case 4:
message.status = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.ResponseHeader.fromJSON(object.header)
: undefined,
request: isSet(object.request)
? exports.EstopCheckInRequest.fromJSON(object.request)
: undefined,
challenge: isSet(object.challenge) ? Number(object.challenge) : 0,
status: isSet(object.status)
? estopCheckInResponse_StatusFromJSON(object.status)
: 0,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.ResponseHeader.toJSON(message.header)
: undefined);
message.request !== undefined &&
(obj.request = message.request
? exports.EstopCheckInRequest.toJSON(message.request)
: undefined);
message.challenge !== undefined &&
(obj.challenge = Math.round(message.challenge));
message.status !== undefined &&
(obj.status = estopCheckInResponse_StatusToJSON(message.status));
return obj;
},
fromPartial(object) {
const message = createBaseEstopCheckInResponse();
message.header =
object.header !== undefined && object.header !== null
? header_1.ResponseHeader.fromPartial(object.header)
: undefined;
message.request =
object.request !== undefined && object.request !== null
? exports.EstopCheckInRequest.fromPartial(object.request)
: undefined;
message.challenge = object.challenge ?? 0;
message.status = object.status ?? 0;
return message;
},
};
function createBaseRegisterEstopEndpointRequest() {
return {
header: undefined,
targetEndpoint: undefined,
targetConfigId: "",
newEndpoint: undefined,
};
}
exports.RegisterEstopEndpointRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.targetEndpoint !== undefined) {
exports.EstopEndpoint.encode(message.targetEndpoint, writer.uint32(18).fork()).ldelim();
}
if (message.targetConfigId !== "") {
writer.uint32(26).string(message.targetConfigId);
}
if (message.newEndpoint !== undefined) {
exports.EstopEndpoint.encode(message.newEndpoint, writer.uint32(34).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRegisterEstopEndpointRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.RequestHeader.decode(reader, reader.uint32());
break;
case 2:
message.targetEndpoint = exports.EstopEndpoint.decode(reader, reader.uint32());
break;
case 3:
message.targetConfigId = reader.string();
break;
case 4:
message.newEndpoint = exports.EstopEndpoint.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.RequestHeader.fromJSON(object.header)
: undefined,
targetEndpoint: isSet(object.targetEndpoint)
? exports.EstopEndpoint.fromJSON(object.targetEndpoint)
: undefined,
targetConfigId: isSet(object.targetConfigId)
? String(object.targetConfigId)
: "",
newEndpoint: isSet(object.newEndpoint)
? exports.EstopEndpoint.fromJSON(object.newEndpoint)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.RequestHeader.toJSON(message.header)
: undefined);
message.targetEndpoint !== undefined &&
(obj.targetEndpoint = message.targetEndpoint
? exports.EstopEndpoint.toJSON(message.targetEndpoint)
: undefined);
message.targetConfigId !== undefined &&
(obj.targetConfigId = message.targetConfigId);
message.newEndpoint !== undefined &&
(obj.newEndpoint = message.newEndpoint
? exports.EstopEndpoint.toJSON(message.newEndpoint)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseRegisterEstopEndpointRequest();
message.header =
object.header !== undefined && object.header !== null
? header_1.RequestHeader.fromPartial(object.header)
: undefined;
message.targetEndpoint =
object.targetEndpoint !== undefined && object.targetEndpoint !== null
? exports.EstopEndpoint.fromPartial(object.targetEndpoint)
: undefined;
message.targetConfigId = object.targetConfigId ?? "";
message.newEndpoint =
object.newEndpoint !== undefined && object.newEndpoint !== null
? exports.EstopEndpoint.fromPartial(object.newEndpoint)
: undefined;
return message;
},
};
function createBaseRegisterEstopEndpointResponse() {
return {
header: undefined,
request: undefined,
newEndpoint: undefined,
status: 0,
};
}
exports.RegisterEstopEndpointResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.ResponseHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.request !== undefined) {
exports.RegisterEstopEndpointRequest.encode(message.request, writer.uint32(18).fork()).ldelim();
}
if (message.newEndpoint !== undefined) {
exports.EstopEndpoint.encode(message.newEndpoint, writer.uint32(26).fork()).ldelim();
}
if (message.status !== 0) {
writer.uint32(32).int32(message.status);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRegisterEstopEndpointResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.ResponseHeader.decode(reader, reader.uint32());
break;
case 2:
message.request = exports.RegisterEstopEndpointRequest.decode(reader, reader.uint32());
break;
case 3:
message.newEndpoint = exports.EstopEndpoint.decode(reader, reader.uint32());
break;
case 4:
message.status = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.ResponseHeader.fromJSON(object.header)
: undefined,
request: isSet(object.request)
? exports.RegisterEstopEndpointRequest.fromJSON(object.request)
: undefined,
newEndpoint: isSet(object.newEndpoint)
? exports.EstopEndpoint.fromJSON(object.newEndpoint)
: undefined,
status: isSet(object.status)
? registerEstopEndpointResponse_StatusFromJSON(object.status)
: 0,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.ResponseHeader.toJSON(message.header)
: undefined);
message.request !== undefined &&
(obj.request = message.request
? exports.RegisterEstopEndpointRequest.toJSON(message.request)
: undefined);
message.newEndpoint !== undefined &&
(obj.newEndpoint = message.newEndpoint
? exports.EstopEndpoint.toJSON(message.newEndpoint)
: undefined);
message.status !== undefined &&
(obj.status = registerEstopEndpointResponse_StatusToJSON(message.status));
return obj;
},
fromPartial(object) {
const message = createBaseRegisterEstopEndpointResponse();
message.header =
object.header !== undefined && object.header !== null
? header_1.ResponseHeader.fromPartial(object.header)
: undefined;
message.request =
object.request !== undefined && object.request !== null
? exports.RegisterEstopEndpointRequest.fromPartial(object.request)
: undefined;
message.newEndpoint =
object.newEndpoint !== undefined && object.newEndpoint !== null
? exports.EstopEndpoint.fromPartial(object.newEndpoint)
: undefined;
message.status = object.status ?? 0;
return message;
},
};
function createBaseDeregisterEstopEndpointRequest() {
return { header: undefined, targetEndpoint: undefined, targetConfigId: "" };
}
exports.DeregisterEstopEndpointRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.targetEndpoint !== undefined) {
exports.EstopEndpoint.encode(message.targetEndpoint, writer.uint32(18).fork()).ldelim();
}
if (message.targetConfigId !== "") {
writer.uint32(26).string(message.targetConfigId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseDeregisterEstopEndpointRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.RequestHeader.decode(reader, reader.uint32());
break;
case 2:
message.targetEndpoint = exports.EstopEndpoint.decode(reader, reader.uint32());
break;
case 3:
message.targetConfigId = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.RequestHeader.fromJSON(object.header)
: undefined,
targetEndpoint: isSet(object.targetEndpoint)
? exports.EstopEndpoint.fromJSON(object.targetEndpoint)
: undefined,
targetConfigId: isSet(object.targetConfigId)
? String(object.targetConfigId)
: "",
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.RequestHeader.toJSON(message.header)
: undefined);
message.targetEndpoint !== undefined &&
(obj.targetEndpoint = message.targetEndpoint
? exports.EstopEndpoint.toJSON(message.targetEndpoint)
: undefined);
message.targetConfigId !== undefined &&
(obj.targetConfigId = message.targetConfigId);
return obj;
},
fromPartial(object) {
const message = createBaseDeregisterEstopEndpointRequest();
message.header =
object.header !== undefined && object.header !== null
? header_1.RequestHeader.fromPartial(object.header)
: undefined;
message.targetEndpoint =
object.targetEndpoint !== undefined && object.targetEndpoint !== null
? exports.EstopEndpoint.fromPartial(object.targetEndpoint)
: undefined;
message.targetConfigId = object.targetConfigId ?? "";
return message;
},
};
function createBaseDeregisterEstopEndpointResponse() {
return { header: undefined, request: undefined, status: 0 };
}
exports.DeregisterEstopEndpointResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.ResponseHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.request !== undefined) {
exports.DeregisterEstopEndpointRequest.encode(message.request, writer.uint32(18).fork()).ldelim();
}
if (message.status !== 0) {
writer.uint32(32).int32(message.status);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseDeregisterEstopEndpointResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.ResponseHeader.decode(reader, reader.uint32());
break;
case 2:
message.request = exports.DeregisterEstopEndpointRequest.decode(reader, reader.uint32());
break;
case 4:
message.status = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.ResponseHeader.fromJSON(object.header)
: undefined,
request: isSet(object.request)
? exports.DeregisterEstopEndpointRequest.fromJSON(object.request)
: undefined,
status: isSet(object.status)
? deregisterEstopEndpointResponse_StatusFromJSON(object.status)
: 0,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.ResponseHeader.toJSON(message.header)
: undefined);
message.request !== undefined &&
(obj.request = message.request
? exports.DeregisterEstopEndpointRequest.toJSON(message.request)
: undefined);
message.status !== undefined &&
(obj.status = deregisterEstopEndpointResponse_StatusToJSON(message.status));
return obj;
},
fromPartial(object) {
const message = createBaseDeregisterEstopEndpointResponse();
message.header =
object.header !== undefined && object.header !== null
? header_1.ResponseHeader.fromParti