"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecutionServiceClient = exports.ExecutionServiceService = exports.ListExecutionsResponse = exports.ListExecutionsRequest = exports.GetExecutionHistoryResponse = exports.GetExecutionHistoryRequest = exports.GetExecutionResponse = exports.GetExecutionRequest = exports.TerminateExecutionResponse = exports.TerminateExecutionRequest = exports.StopExecutionResponse = exports.StopExecutionRequest = exports.StartExecutionResponse = exports.StartExecutionRequest = exports.protobufPackage = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const grpc_js_1 = require("@grpc/grpc-js");
const minimal_1 = __importDefault(require("protobufjs/minimal"));
const execution_1 = require("../../../../../yandex/cloud/serverless/workflows/v1/execution");
const history_entry_1 = require("../../../../../yandex/cloud/serverless/workflows/v1/history_entry");
exports.protobufPackage = 'yandex.cloud.serverless.workflows.v1';
const baseStartExecutionRequest = { workflowId: '' };
exports.StartExecutionRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.workflowId !== '') {
            writer.uint32(10).string(message.workflowId);
        }
        if (message.input !== undefined) {
            execution_1.ExecutionInput.encode(message.input, 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 = Object.assign({}, baseStartExecutionRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.workflowId = reader.string();
                    break;
                case 3:
                    message.input = execution_1.ExecutionInput.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseStartExecutionRequest);
        message.workflowId =
            object.workflowId !== undefined && object.workflowId !== null
                ? String(object.workflowId)
                : '';
        message.input =
            object.input !== undefined && object.input !== null
                ? execution_1.ExecutionInput.fromJSON(object.input)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.workflowId !== undefined && (obj.workflowId = message.workflowId);
        message.input !== undefined &&
            (obj.input = message.input ? execution_1.ExecutionInput.toJSON(message.input) : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseStartExecutionRequest);
        message.workflowId = (_a = object.workflowId) !== null && _a !== void 0 ? _a : '';
        message.input =
            object.input !== undefined && object.input !== null
                ? execution_1.ExecutionInput.fromPartial(object.input)
                : undefined;
        return message;
    },
};
const baseStartExecutionResponse = { executionId: '' };
exports.StartExecutionResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.executionId !== '') {
            writer.uint32(10).string(message.executionId);
        }
        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 = Object.assign({}, baseStartExecutionResponse);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.executionId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseStartExecutionResponse);
        message.executionId =
            object.executionId !== undefined && object.executionId !== null
                ? String(object.executionId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.executionId !== undefined && (obj.executionId = message.executionId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseStartExecutionResponse);
        message.executionId = (_a = object.executionId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseStopExecutionRequest = { executionId: '' };
exports.StopExecutionRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.executionId !== '') {
            writer.uint32(10).string(message.executionId);
        }
        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 = Object.assign({}, baseStopExecutionRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.executionId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseStopExecutionRequest);
        message.executionId =
            object.executionId !== undefined && object.executionId !== null
                ? String(object.executionId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.executionId !== undefined && (obj.executionId = message.executionId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseStopExecutionRequest);
        message.executionId = (_a = object.executionId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseStopExecutionResponse = { executionId: '' };
exports.StopExecutionResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.executionId !== '') {
            writer.uint32(10).string(message.executionId);
        }
        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 = Object.assign({}, baseStopExecutionResponse);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.executionId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseStopExecutionResponse);
        message.executionId =
            object.executionId !== undefined && object.executionId !== null
                ? String(object.executionId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.executionId !== undefined && (obj.executionId = message.executionId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseStopExecutionResponse);
        message.executionId = (_a = object.executionId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseTerminateExecutionRequest = { executionId: '' };
exports.TerminateExecutionRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.executionId !== '') {
            writer.uint32(10).string(message.executionId);
        }
        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 = Object.assign({}, baseTerminateExecutionRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.executionId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseTerminateExecutionRequest);
        message.executionId =
            object.executionId !== undefined && object.executionId !== null
                ? String(object.executionId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.executionId !== undefined && (obj.executionId = message.executionId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseTerminateExecutionRequest);
        message.executionId = (_a = object.executionId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseTerminateExecutionResponse = { executionId: '' };
exports.TerminateExecutionResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.executionId !== '') {
            writer.uint32(10).string(message.executionId);
        }
        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 = Object.assign({}, baseTerminateExecutionResponse);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.executionId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseTerminateExecutionResponse);
        message.executionId =
            object.executionId !== undefined && object.executionId !== null
                ? String(object.executionId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.executionId !== undefined && (obj.executionId = message.executionId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseTerminateExecutionResponse);
        message.executionId = (_a = object.executionId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseGetExecutionRequest = { executionId: '' };
exports.GetExecutionRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.executionId !== '') {
            writer.uint32(10).string(message.executionId);
        }
        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 = Object.assign({}, baseGetExecutionRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.executionId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseGetExecutionRequest);
        message.executionId =
            object.executionId !== undefined && object.executionId !== null
                ? String(object.executionId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.executionId !== undefined && (obj.executionId = message.executionId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseGetExecutionRequest);
        message.executionId = (_a = object.executionId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseGetExecutionResponse = {};
exports.GetExecutionResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.execution !== undefined) {
            execution_1.Execution.encode(message.execution, writer.uint32(10).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 = Object.assign({}, baseGetExecutionResponse);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.execution = execution_1.Execution.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseGetExecutionResponse);
        message.execution =
            object.execution !== undefined && object.execution !== null
                ? execution_1.Execution.fromJSON(object.execution)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.execution !== undefined &&
            (obj.execution = message.execution ? execution_1.Execution.toJSON(message.execution) : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = Object.assign({}, baseGetExecutionResponse);
        message.execution =
            object.execution !== undefined && object.execution !== null
                ? execution_1.Execution.fromPartial(object.execution)
                : undefined;
        return message;
    },
};
const baseGetExecutionHistoryRequest = { executionId: '' };
exports.GetExecutionHistoryRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.executionId !== '') {
            writer.uint32(10).string(message.executionId);
        }
        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 = Object.assign({}, baseGetExecutionHistoryRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.executionId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseGetExecutionHistoryRequest);
        message.executionId =
            object.executionId !== undefined && object.executionId !== null
                ? String(object.executionId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.executionId !== undefined && (obj.executionId = message.executionId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseGetExecutionHistoryRequest);
        message.executionId = (_a = object.executionId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseGetExecutionHistoryResponse = {};
exports.GetExecutionHistoryResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.execution !== undefined) {
            execution_1.ExecutionPreview.encode(message.execution, writer.uint32(10).fork()).ldelim();
        }
        for (const v of message.entries) {
            history_entry_1.HistoryEntry.encode(v, writer.uint32(18).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 = Object.assign({}, baseGetExecutionHistoryResponse);
        message.entries = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.execution = execution_1.ExecutionPreview.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.entries.push(history_entry_1.HistoryEntry.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseGetExecutionHistoryResponse);
        message.execution =
            object.execution !== undefined && object.execution !== null
                ? execution_1.ExecutionPreview.fromJSON(object.execution)
                : undefined;
        message.entries = ((_a = object.entries) !== null && _a !== void 0 ? _a : []).map((e) => history_entry_1.HistoryEntry.fromJSON(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.execution !== undefined &&
            (obj.execution = message.execution
                ? execution_1.ExecutionPreview.toJSON(message.execution)
                : undefined);
        if (message.entries) {
            obj.entries = message.entries.map((e) => (e ? history_entry_1.HistoryEntry.toJSON(e) : undefined));
        }
        else {
            obj.entries = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseGetExecutionHistoryResponse);
        message.execution =
            object.execution !== undefined && object.execution !== null
                ? execution_1.ExecutionPreview.fromPartial(object.execution)
                : undefined;
        message.entries = ((_a = object.entries) === null || _a === void 0 ? void 0 : _a.map((e) => history_entry_1.HistoryEntry.fromPartial(e))) || [];
        return message;
    },
};
const baseListExecutionsRequest = {
    workflowId: '',
    pageSize: 0,
    pageToken: '',
    filter: '',
};
exports.ListExecutionsRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.workflowId !== '') {
            writer.uint32(10).string(message.workflowId);
        }
        if (message.pageSize !== 0) {
            writer.uint32(16).int64(message.pageSize);
        }
        if (message.pageToken !== '') {
            writer.uint32(26).string(message.pageToken);
        }
        if (message.filter !== '') {
            writer.uint32(34).string(message.filter);
        }
        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 = Object.assign({}, baseListExecutionsRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.workflowId = reader.string();
                    break;
                case 2:
                    message.pageSize = longToNumber(reader.int64());
                    break;
                case 3:
                    message.pageToken = reader.string();
                    break;
                case 4:
                    message.filter = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseListExecutionsRequest);
        message.workflowId =
            object.workflowId !== undefined && object.workflowId !== null
                ? String(object.workflowId)
                : '';
        message.pageSize =
            object.pageSize !== undefined && object.pageSize !== null ? Number(object.pageSize) : 0;
        message.pageToken =
            object.pageToken !== undefined && object.pageToken !== null
                ? String(object.pageToken)
                : '';
        message.filter =
            object.filter !== undefined && object.filter !== null ? String(object.filter) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.workflowId !== undefined && (obj.workflowId = message.workflowId);
        message.pageSize !== undefined && (obj.pageSize = Math.round(message.pageSize));
        message.pageToken !== undefined && (obj.pageToken = message.pageToken);
        message.filter !== undefined && (obj.filter = message.filter);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = Object.assign({}, baseListExecutionsRequest);
        message.workflowId = (_a = object.workflowId) !== null && _a !== void 0 ? _a : '';
        message.pageSize = (_b = object.pageSize) !== null && _b !== void 0 ? _b : 0;
        message.pageToken = (_c = object.pageToken) !== null && _c !== void 0 ? _c : '';
        message.filter = (_d = object.filter) !== null && _d !== void 0 ? _d : '';
        return message;
    },
};
const baseListExecutionsResponse = { nextPageToken: '' };
exports.ListExecutionsResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.executions) {
            execution_1.ExecutionPreview.encode(v, writer.uint32(10).fork()).ldelim();
        }
        if (message.nextPageToken !== '') {
            writer.uint32(18).string(message.nextPageToken);
        }
        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 = Object.assign({}, baseListExecutionsResponse);
        message.executions = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.executions.push(execution_1.ExecutionPreview.decode(reader, reader.uint32()));
                    break;
                case 2:
                    message.nextPageToken = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseListExecutionsResponse);
        message.executions = ((_a = object.executions) !== null && _a !== void 0 ? _a : []).map((e) => execution_1.ExecutionPreview.fromJSON(e));
        message.nextPageToken =
            object.nextPageToken !== undefined && object.nextPageToken !== null
                ? String(object.nextPageToken)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.executions) {
            obj.executions = message.executions.map((e) => e ? execution_1.ExecutionPreview.toJSON(e) : undefined);
        }
        else {
            obj.executions = [];
        }
        message.nextPageToken !== undefined && (obj.nextPageToken = message.nextPageToken);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseListExecutionsResponse);
        message.executions = ((_a = object.executions) === null || _a === void 0 ? void 0 : _a.map((e) => execution_1.ExecutionPreview.fromPartial(e))) || [];
        message.nextPageToken = (_b = object.nextPageToken) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
/** Set of methods for managing Workflows Executions. */
exports.ExecutionServiceService = {
    /** Starts new Workflow execution. */
    start: {
        path: '/yandex.cloud.serverless.workflows.v1.ExecutionService/Start',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.StartExecutionRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.StartExecutionRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.StartExecutionResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.StartExecutionResponse.decode(value),
    },
    /** Stops specified Workflow execution. */
    stop: {
        path: '/yandex.cloud.serverless.workflows.v1.ExecutionService/Stop',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.StopExecutionRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.StopExecutionRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.StopExecutionResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.StopExecutionResponse.decode(value),
    },
    /** Terminates specified Workflow execution. */
    terminate: {
        path: '/yandex.cloud.serverless.workflows.v1.ExecutionService/Terminate',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.TerminateExecutionRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.TerminateExecutionRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.TerminateExecutionResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.TerminateExecutionResponse.decode(value),
    },
    /** Retrieves specified Workflow execution. */
    get: {
        path: '/yandex.cloud.serverless.workflows.v1.ExecutionService/Get',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.GetExecutionRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.GetExecutionRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.GetExecutionResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.GetExecutionResponse.decode(value),
    },
    /** Retrieves detailed history of specified Workflow execution. */
    getHistory: {
        path: '/yandex.cloud.serverless.workflows.v1.ExecutionService/GetHistory',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.GetExecutionHistoryRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.GetExecutionHistoryRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.GetExecutionHistoryResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.GetExecutionHistoryResponse.decode(value),
    },
    /** Retrieves list of Workflow executions. */
    list: {
        path: '/yandex.cloud.serverless.workflows.v1.ExecutionService/List',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.ListExecutionsRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.ListExecutionsRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.ListExecutionsResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.ListExecutionsResponse.decode(value),
    },
};
exports.ExecutionServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.ExecutionServiceService, 'yandex.cloud.serverless.workflows.v1.ExecutionService');
var globalThis = (() => {
    if (typeof globalThis !== 'undefined')
        return globalThis;
    if (typeof self !== 'undefined')
        return self;
    if (typeof window !== 'undefined')
        return window;
    if (typeof global !== 'undefined')
        return global;
    throw 'Unable to locate global object';
})();
function longToNumber(long) {
    if (long.gt(Number.MAX_SAFE_INTEGER)) {
        throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
    }
    return long.toNumber();
}
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
