"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProjectJobServiceClient = exports.ProjectJobServiceService = exports.LogMessage = exports.StdLog = exports.SetProjectJobDataTtlResponse = exports.SetProjectJobDataTtlRequest = exports.DeleteAllProjectJobDataResponse = exports.DeleteAllProjectJobDataMetadata = exports.DeleteAllProjectJobDataRequest = exports.DeleteProjectJobDataResponse = exports.DeleteProjectJobDataMetadata = exports.DeleteProjectJobDataRequest = exports.DeleteProjectJobMetadata = exports.DeleteProjectJobRequest = exports.GetProjectJobRequest = exports.ListProjectJobResponse = exports.ListProjectJobRequest = exports.DownloadProjectJobFilesResponse = exports.DownloadProjectJobFilesRequest = exports.ReadProjectJobLogsResponse = exports.ReadProjectJobLogsRequest = exports.ReadProjectJobStdLogsResponse = exports.ReadProjectJobStdLogsRequest = exports.CancelProjectJobRequest = exports.ExecuteProjectJobMetadata = exports.ExecuteProjectJobResponse = exports.ExecuteProjectJobRequest = exports.CloneProjectJobMetadata = exports.CloneProjectJobResponse = exports.CloneProjectJobRequest = exports.CreateProjectJobResponse = exports.CreateProjectJobMetadata = exports.CreateProjectJobRequest = exports.stdLog_TypeToJSON = exports.stdLog_TypeFromJSON = exports.StdLog_Type = exports.standardStreamToJSON = exports.standardStreamFromJSON = exports.StandardStream = 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 jobs_1 = require("../../../../../yandex/cloud/datasphere/v2/jobs/jobs");
const duration_1 = require("../../../../../google/protobuf/duration");
const timestamp_1 = require("../../../../../google/protobuf/timestamp");
const operation_1 = require("../../../../../yandex/cloud/operation/operation");
const empty_1 = require("../../../../../google/protobuf/empty");
exports.protobufPackage = 'yandex.cloud.datasphere.v2.jobs';
var StandardStream;
(function (StandardStream) {
    StandardStream[StandardStream["STANDARD_STREAM_UNSPECIFIED"] = 0] = "STANDARD_STREAM_UNSPECIFIED";
    /** OUT - Stdout. */
    StandardStream[StandardStream["OUT"] = 1] = "OUT";
    /** ERR - Stderr. */
    StandardStream[StandardStream["ERR"] = 2] = "ERR";
    StandardStream[StandardStream["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(StandardStream = exports.StandardStream || (exports.StandardStream = {}));
function standardStreamFromJSON(object) {
    switch (object) {
        case 0:
        case 'STANDARD_STREAM_UNSPECIFIED':
            return StandardStream.STANDARD_STREAM_UNSPECIFIED;
        case 1:
        case 'OUT':
            return StandardStream.OUT;
        case 2:
        case 'ERR':
            return StandardStream.ERR;
        case -1:
        case 'UNRECOGNIZED':
        default:
            return StandardStream.UNRECOGNIZED;
    }
}
exports.standardStreamFromJSON = standardStreamFromJSON;
function standardStreamToJSON(object) {
    switch (object) {
        case StandardStream.STANDARD_STREAM_UNSPECIFIED:
            return 'STANDARD_STREAM_UNSPECIFIED';
        case StandardStream.OUT:
            return 'OUT';
        case StandardStream.ERR:
            return 'ERR';
        default:
            return 'UNKNOWN';
    }
}
exports.standardStreamToJSON = standardStreamToJSON;
var StdLog_Type;
(function (StdLog_Type) {
    StdLog_Type[StdLog_Type["TYPE_UNSPECIFIED"] = 0] = "TYPE_UNSPECIFIED";
    /** OUT - stdout. */
    StdLog_Type[StdLog_Type["OUT"] = 1] = "OUT";
    /** ERR - stderr. */
    StdLog_Type[StdLog_Type["ERR"] = 2] = "ERR";
    StdLog_Type[StdLog_Type["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(StdLog_Type = exports.StdLog_Type || (exports.StdLog_Type = {}));
function stdLog_TypeFromJSON(object) {
    switch (object) {
        case 0:
        case 'TYPE_UNSPECIFIED':
            return StdLog_Type.TYPE_UNSPECIFIED;
        case 1:
        case 'OUT':
            return StdLog_Type.OUT;
        case 2:
        case 'ERR':
            return StdLog_Type.ERR;
        case -1:
        case 'UNRECOGNIZED':
        default:
            return StdLog_Type.UNRECOGNIZED;
    }
}
exports.stdLog_TypeFromJSON = stdLog_TypeFromJSON;
function stdLog_TypeToJSON(object) {
    switch (object) {
        case StdLog_Type.TYPE_UNSPECIFIED:
            return 'TYPE_UNSPECIFIED';
        case StdLog_Type.OUT:
            return 'OUT';
        case StdLog_Type.ERR:
            return 'ERR';
        default:
            return 'UNKNOWN';
    }
}
exports.stdLog_TypeToJSON = stdLog_TypeToJSON;
const baseCreateProjectJobRequest = { projectId: '', config: '', name: '', desc: '' };
exports.CreateProjectJobRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.projectId !== '') {
            writer.uint32(10).string(message.projectId);
        }
        if (message.jobParameters !== undefined) {
            jobs_1.JobParameters.encode(message.jobParameters, writer.uint32(18).fork()).ldelim();
        }
        if (message.config !== '') {
            writer.uint32(26).string(message.config);
        }
        if (message.name !== '') {
            writer.uint32(34).string(message.name);
        }
        if (message.desc !== '') {
            writer.uint32(42).string(message.desc);
        }
        if (message.dataTtl !== undefined) {
            duration_1.Duration.encode(message.dataTtl, writer.uint32(50).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({}, baseCreateProjectJobRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.projectId = reader.string();
                    break;
                case 2:
                    message.jobParameters = jobs_1.JobParameters.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.config = reader.string();
                    break;
                case 4:
                    message.name = reader.string();
                    break;
                case 5:
                    message.desc = reader.string();
                    break;
                case 6:
                    message.dataTtl = duration_1.Duration.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCreateProjectJobRequest);
        message.projectId =
            object.projectId !== undefined && object.projectId !== null
                ? String(object.projectId)
                : '';
        message.jobParameters =
            object.jobParameters !== undefined && object.jobParameters !== null
                ? jobs_1.JobParameters.fromJSON(object.jobParameters)
                : undefined;
        message.config =
            object.config !== undefined && object.config !== null ? String(object.config) : '';
        message.name = object.name !== undefined && object.name !== null ? String(object.name) : '';
        message.desc = object.desc !== undefined && object.desc !== null ? String(object.desc) : '';
        message.dataTtl =
            object.dataTtl !== undefined && object.dataTtl !== null
                ? duration_1.Duration.fromJSON(object.dataTtl)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.projectId !== undefined && (obj.projectId = message.projectId);
        message.jobParameters !== undefined &&
            (obj.jobParameters = message.jobParameters
                ? jobs_1.JobParameters.toJSON(message.jobParameters)
                : undefined);
        message.config !== undefined && (obj.config = message.config);
        message.name !== undefined && (obj.name = message.name);
        message.desc !== undefined && (obj.desc = message.desc);
        message.dataTtl !== undefined &&
            (obj.dataTtl = message.dataTtl ? duration_1.Duration.toJSON(message.dataTtl) : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = Object.assign({}, baseCreateProjectJobRequest);
        message.projectId = (_a = object.projectId) !== null && _a !== void 0 ? _a : '';
        message.jobParameters =
            object.jobParameters !== undefined && object.jobParameters !== null
                ? jobs_1.JobParameters.fromPartial(object.jobParameters)
                : undefined;
        message.config = (_b = object.config) !== null && _b !== void 0 ? _b : '';
        message.name = (_c = object.name) !== null && _c !== void 0 ? _c : '';
        message.desc = (_d = object.desc) !== null && _d !== void 0 ? _d : '';
        message.dataTtl =
            object.dataTtl !== undefined && object.dataTtl !== null
                ? duration_1.Duration.fromPartial(object.dataTtl)
                : undefined;
        return message;
    },
};
const baseCreateProjectJobMetadata = { projectId: '', jobId: '' };
exports.CreateProjectJobMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.projectId !== '') {
            writer.uint32(10).string(message.projectId);
        }
        if (message.jobId !== '') {
            writer.uint32(18).string(message.jobId);
        }
        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({}, baseCreateProjectJobMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.projectId = reader.string();
                    break;
                case 2:
                    message.jobId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCreateProjectJobMetadata);
        message.projectId =
            object.projectId !== undefined && object.projectId !== null
                ? String(object.projectId)
                : '';
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.projectId !== undefined && (obj.projectId = message.projectId);
        message.jobId !== undefined && (obj.jobId = message.jobId);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseCreateProjectJobMetadata);
        message.projectId = (_a = object.projectId) !== null && _a !== void 0 ? _a : '';
        message.jobId = (_b = object.jobId) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
const baseCreateProjectJobResponse = { jobId: '' };
exports.CreateProjectJobResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        for (const v of message.uploadFiles) {
            jobs_1.StorageFile.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({}, baseCreateProjectJobResponse);
        message.uploadFiles = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                case 2:
                    message.uploadFiles.push(jobs_1.StorageFile.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseCreateProjectJobResponse);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        message.uploadFiles = ((_a = object.uploadFiles) !== null && _a !== void 0 ? _a : []).map((e) => jobs_1.StorageFile.fromJSON(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        if (message.uploadFiles) {
            obj.uploadFiles = message.uploadFiles.map((e) => e ? jobs_1.StorageFile.toJSON(e) : undefined);
        }
        else {
            obj.uploadFiles = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseCreateProjectJobResponse);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        message.uploadFiles = ((_b = object.uploadFiles) === null || _b === void 0 ? void 0 : _b.map((e) => jobs_1.StorageFile.fromPartial(e))) || [];
        return message;
    },
};
const baseCloneProjectJobRequest = { sourceJobId: '', name: '', desc: '' };
exports.CloneProjectJobRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.sourceJobId !== '') {
            writer.uint32(10).string(message.sourceJobId);
        }
        if (message.jobParametersOverrides !== undefined) {
            jobs_1.JobParameters.encode(message.jobParametersOverrides, writer.uint32(18).fork()).ldelim();
        }
        if (message.name !== '') {
            writer.uint32(26).string(message.name);
        }
        if (message.desc !== '') {
            writer.uint32(34).string(message.desc);
        }
        if (message.dataTtl !== undefined) {
            duration_1.Duration.encode(message.dataTtl, 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 = Object.assign({}, baseCloneProjectJobRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.sourceJobId = reader.string();
                    break;
                case 2:
                    message.jobParametersOverrides = jobs_1.JobParameters.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.name = reader.string();
                    break;
                case 4:
                    message.desc = reader.string();
                    break;
                case 5:
                    message.dataTtl = duration_1.Duration.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCloneProjectJobRequest);
        message.sourceJobId =
            object.sourceJobId !== undefined && object.sourceJobId !== null
                ? String(object.sourceJobId)
                : '';
        message.jobParametersOverrides =
            object.jobParametersOverrides !== undefined && object.jobParametersOverrides !== null
                ? jobs_1.JobParameters.fromJSON(object.jobParametersOverrides)
                : undefined;
        message.name = object.name !== undefined && object.name !== null ? String(object.name) : '';
        message.desc = object.desc !== undefined && object.desc !== null ? String(object.desc) : '';
        message.dataTtl =
            object.dataTtl !== undefined && object.dataTtl !== null
                ? duration_1.Duration.fromJSON(object.dataTtl)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.sourceJobId !== undefined && (obj.sourceJobId = message.sourceJobId);
        message.jobParametersOverrides !== undefined &&
            (obj.jobParametersOverrides = message.jobParametersOverrides
                ? jobs_1.JobParameters.toJSON(message.jobParametersOverrides)
                : undefined);
        message.name !== undefined && (obj.name = message.name);
        message.desc !== undefined && (obj.desc = message.desc);
        message.dataTtl !== undefined &&
            (obj.dataTtl = message.dataTtl ? duration_1.Duration.toJSON(message.dataTtl) : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = Object.assign({}, baseCloneProjectJobRequest);
        message.sourceJobId = (_a = object.sourceJobId) !== null && _a !== void 0 ? _a : '';
        message.jobParametersOverrides =
            object.jobParametersOverrides !== undefined && object.jobParametersOverrides !== null
                ? jobs_1.JobParameters.fromPartial(object.jobParametersOverrides)
                : undefined;
        message.name = (_b = object.name) !== null && _b !== void 0 ? _b : '';
        message.desc = (_c = object.desc) !== null && _c !== void 0 ? _c : '';
        message.dataTtl =
            object.dataTtl !== undefined && object.dataTtl !== null
                ? duration_1.Duration.fromPartial(object.dataTtl)
                : undefined;
        return message;
    },
};
const baseCloneProjectJobResponse = { jobId: '' };
exports.CloneProjectJobResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        for (const v of message.uploadFiles) {
            jobs_1.StorageFile.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({}, baseCloneProjectJobResponse);
        message.uploadFiles = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                case 2:
                    message.uploadFiles.push(jobs_1.StorageFile.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseCloneProjectJobResponse);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        message.uploadFiles = ((_a = object.uploadFiles) !== null && _a !== void 0 ? _a : []).map((e) => jobs_1.StorageFile.fromJSON(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        if (message.uploadFiles) {
            obj.uploadFiles = message.uploadFiles.map((e) => e ? jobs_1.StorageFile.toJSON(e) : undefined);
        }
        else {
            obj.uploadFiles = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseCloneProjectJobResponse);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        message.uploadFiles = ((_b = object.uploadFiles) === null || _b === void 0 ? void 0 : _b.map((e) => jobs_1.StorageFile.fromPartial(e))) || [];
        return message;
    },
};
const baseCloneProjectJobMetadata = { projectId: '', jobId: '' };
exports.CloneProjectJobMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.projectId !== '') {
            writer.uint32(10).string(message.projectId);
        }
        if (message.jobId !== '') {
            writer.uint32(18).string(message.jobId);
        }
        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({}, baseCloneProjectJobMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.projectId = reader.string();
                    break;
                case 2:
                    message.jobId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCloneProjectJobMetadata);
        message.projectId =
            object.projectId !== undefined && object.projectId !== null
                ? String(object.projectId)
                : '';
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.projectId !== undefined && (obj.projectId = message.projectId);
        message.jobId !== undefined && (obj.jobId = message.jobId);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseCloneProjectJobMetadata);
        message.projectId = (_a = object.projectId) !== null && _a !== void 0 ? _a : '';
        message.jobId = (_b = object.jobId) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
const baseExecuteProjectJobRequest = { jobId: '' };
exports.ExecuteProjectJobRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        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({}, baseExecuteProjectJobRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseExecuteProjectJobRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseExecuteProjectJobRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseExecuteProjectJobResponse = {};
exports.ExecuteProjectJobResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.outputFiles) {
            jobs_1.StorageFile.encode(v, writer.uint32(10).fork()).ldelim();
        }
        for (const v of message.outputFilesErrors) {
            jobs_1.FileUploadError.encode(v, writer.uint32(34).fork()).ldelim();
        }
        for (const v of message.outputDatasets) {
            jobs_1.OutputDataset.encode(v, writer.uint32(26).fork()).ldelim();
        }
        if (message.result !== undefined) {
            jobs_1.JobResult.encode(message.result, 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({}, baseExecuteProjectJobResponse);
        message.outputFiles = [];
        message.outputFilesErrors = [];
        message.outputDatasets = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.outputFiles.push(jobs_1.StorageFile.decode(reader, reader.uint32()));
                    break;
                case 4:
                    message.outputFilesErrors.push(jobs_1.FileUploadError.decode(reader, reader.uint32()));
                    break;
                case 3:
                    message.outputDatasets.push(jobs_1.OutputDataset.decode(reader, reader.uint32()));
                    break;
                case 2:
                    message.result = jobs_1.JobResult.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a, _b, _c;
        const message = Object.assign({}, baseExecuteProjectJobResponse);
        message.outputFiles = ((_a = object.outputFiles) !== null && _a !== void 0 ? _a : []).map((e) => jobs_1.StorageFile.fromJSON(e));
        message.outputFilesErrors = ((_b = object.outputFilesErrors) !== null && _b !== void 0 ? _b : []).map((e) => jobs_1.FileUploadError.fromJSON(e));
        message.outputDatasets = ((_c = object.outputDatasets) !== null && _c !== void 0 ? _c : []).map((e) => jobs_1.OutputDataset.fromJSON(e));
        message.result =
            object.result !== undefined && object.result !== null
                ? jobs_1.JobResult.fromJSON(object.result)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.outputFiles) {
            obj.outputFiles = message.outputFiles.map((e) => e ? jobs_1.StorageFile.toJSON(e) : undefined);
        }
        else {
            obj.outputFiles = [];
        }
        if (message.outputFilesErrors) {
            obj.outputFilesErrors = message.outputFilesErrors.map((e) => e ? jobs_1.FileUploadError.toJSON(e) : undefined);
        }
        else {
            obj.outputFilesErrors = [];
        }
        if (message.outputDatasets) {
            obj.outputDatasets = message.outputDatasets.map((e) => e ? jobs_1.OutputDataset.toJSON(e) : undefined);
        }
        else {
            obj.outputDatasets = [];
        }
        message.result !== undefined &&
            (obj.result = message.result ? jobs_1.JobResult.toJSON(message.result) : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = Object.assign({}, baseExecuteProjectJobResponse);
        message.outputFiles = ((_a = object.outputFiles) === null || _a === void 0 ? void 0 : _a.map((e) => jobs_1.StorageFile.fromPartial(e))) || [];
        message.outputFilesErrors =
            ((_b = object.outputFilesErrors) === null || _b === void 0 ? void 0 : _b.map((e) => jobs_1.FileUploadError.fromPartial(e))) || [];
        message.outputDatasets =
            ((_c = object.outputDatasets) === null || _c === void 0 ? void 0 : _c.map((e) => jobs_1.OutputDataset.fromPartial(e))) || [];
        message.result =
            object.result !== undefined && object.result !== null
                ? jobs_1.JobResult.fromPartial(object.result)
                : undefined;
        return message;
    },
};
const baseExecuteProjectJobMetadata = {};
exports.ExecuteProjectJobMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.job !== undefined) {
            jobs_1.Job.encode(message.job, writer.uint32(10).fork()).ldelim();
        }
        if (message.progress !== undefined) {
            jobs_1.JobProgress.encode(message.progress, writer.uint32(18).fork()).ldelim();
        }
        if (message.metadata !== undefined) {
            jobs_1.JobMetadata.encode(message.metadata, 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({}, baseExecuteProjectJobMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.job = jobs_1.Job.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.progress = jobs_1.JobProgress.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.metadata = jobs_1.JobMetadata.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseExecuteProjectJobMetadata);
        message.job =
            object.job !== undefined && object.job !== null ? jobs_1.Job.fromJSON(object.job) : undefined;
        message.progress =
            object.progress !== undefined && object.progress !== null
                ? jobs_1.JobProgress.fromJSON(object.progress)
                : undefined;
        message.metadata =
            object.metadata !== undefined && object.metadata !== null
                ? jobs_1.JobMetadata.fromJSON(object.metadata)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.job !== undefined && (obj.job = message.job ? jobs_1.Job.toJSON(message.job) : undefined);
        message.progress !== undefined &&
            (obj.progress = message.progress ? jobs_1.JobProgress.toJSON(message.progress) : undefined);
        message.metadata !== undefined &&
            (obj.metadata = message.metadata ? jobs_1.JobMetadata.toJSON(message.metadata) : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = Object.assign({}, baseExecuteProjectJobMetadata);
        message.job =
            object.job !== undefined && object.job !== null
                ? jobs_1.Job.fromPartial(object.job)
                : undefined;
        message.progress =
            object.progress !== undefined && object.progress !== null
                ? jobs_1.JobProgress.fromPartial(object.progress)
                : undefined;
        message.metadata =
            object.metadata !== undefined && object.metadata !== null
                ? jobs_1.JobMetadata.fromPartial(object.metadata)
                : undefined;
        return message;
    },
};
const baseCancelProjectJobRequest = { jobId: '', reason: '', graceful: false };
exports.CancelProjectJobRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        if (message.reason !== '') {
            writer.uint32(18).string(message.reason);
        }
        if (message.graceful === true) {
            writer.uint32(24).bool(message.graceful);
        }
        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({}, baseCancelProjectJobRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                case 2:
                    message.reason = reader.string();
                    break;
                case 3:
                    message.graceful = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCancelProjectJobRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        message.reason =
            object.reason !== undefined && object.reason !== null ? String(object.reason) : '';
        message.graceful =
            object.graceful !== undefined && object.graceful !== null
                ? Boolean(object.graceful)
                : false;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        message.reason !== undefined && (obj.reason = message.reason);
        message.graceful !== undefined && (obj.graceful = message.graceful);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = Object.assign({}, baseCancelProjectJobRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        message.reason = (_b = object.reason) !== null && _b !== void 0 ? _b : '';
        message.graceful = (_c = object.graceful) !== null && _c !== void 0 ? _c : false;
        return message;
    },
};
const baseReadProjectJobStdLogsRequest = { jobId: '', offset: 0 };
exports.ReadProjectJobStdLogsRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        if (message.offset !== 0) {
            writer.uint32(16).int64(message.offset);
        }
        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({}, baseReadProjectJobStdLogsRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                case 2:
                    message.offset = longToNumber(reader.int64());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseReadProjectJobStdLogsRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        message.offset =
            object.offset !== undefined && object.offset !== null ? Number(object.offset) : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        message.offset !== undefined && (obj.offset = Math.round(message.offset));
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseReadProjectJobStdLogsRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        message.offset = (_b = object.offset) !== null && _b !== void 0 ? _b : 0;
        return message;
    },
};
const baseReadProjectJobStdLogsResponse = { offset: 0 };
exports.ReadProjectJobStdLogsResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.logs) {
            exports.StdLog.encode(v, writer.uint32(10).fork()).ldelim();
        }
        if (message.offset !== 0) {
            writer.uint32(16).int64(message.offset);
        }
        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({}, baseReadProjectJobStdLogsResponse);
        message.logs = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.logs.push(exports.StdLog.decode(reader, reader.uint32()));
                    break;
                case 2:
                    message.offset = longToNumber(reader.int64());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseReadProjectJobStdLogsResponse);
        message.logs = ((_a = object.logs) !== null && _a !== void 0 ? _a : []).map((e) => exports.StdLog.fromJSON(e));
        message.offset =
            object.offset !== undefined && object.offset !== null ? Number(object.offset) : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.logs) {
            obj.logs = message.logs.map((e) => (e ? exports.StdLog.toJSON(e) : undefined));
        }
        else {
            obj.logs = [];
        }
        message.offset !== undefined && (obj.offset = Math.round(message.offset));
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseReadProjectJobStdLogsResponse);
        message.logs = ((_a = object.logs) === null || _a === void 0 ? void 0 : _a.map((e) => exports.StdLog.fromPartial(e))) || [];
        message.offset = (_b = object.offset) !== null && _b !== void 0 ? _b : 0;
        return message;
    },
};
const baseReadProjectJobLogsRequest = { jobId: '', offset: 0 };
exports.ReadProjectJobLogsRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        if (message.offset !== 0) {
            writer.uint32(16).int64(message.offset);
        }
        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({}, baseReadProjectJobLogsRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                case 2:
                    message.offset = longToNumber(reader.int64());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseReadProjectJobLogsRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        message.offset =
            object.offset !== undefined && object.offset !== null ? Number(object.offset) : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        message.offset !== undefined && (obj.offset = Math.round(message.offset));
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseReadProjectJobLogsRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        message.offset = (_b = object.offset) !== null && _b !== void 0 ? _b : 0;
        return message;
    },
};
const baseReadProjectJobLogsResponse = { offset: 0 };
exports.ReadProjectJobLogsResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.logs) {
            exports.LogMessage.encode(v, writer.uint32(10).fork()).ldelim();
        }
        if (message.offset !== 0) {
            writer.uint32(16).int64(message.offset);
        }
        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({}, baseReadProjectJobLogsResponse);
        message.logs = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.logs.push(exports.LogMessage.decode(reader, reader.uint32()));
                    break;
                case 2:
                    message.offset = longToNumber(reader.int64());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseReadProjectJobLogsResponse);
        message.logs = ((_a = object.logs) !== null && _a !== void 0 ? _a : []).map((e) => exports.LogMessage.fromJSON(e));
        message.offset =
            object.offset !== undefined && object.offset !== null ? Number(object.offset) : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.logs) {
            obj.logs = message.logs.map((e) => (e ? exports.LogMessage.toJSON(e) : undefined));
        }
        else {
            obj.logs = [];
        }
        message.offset !== undefined && (obj.offset = Math.round(message.offset));
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseReadProjectJobLogsResponse);
        message.logs = ((_a = object.logs) === null || _a === void 0 ? void 0 : _a.map((e) => exports.LogMessage.fromPartial(e))) || [];
        message.offset = (_b = object.offset) !== null && _b !== void 0 ? _b : 0;
        return message;
    },
};
const baseDownloadProjectJobFilesRequest = { jobId: '' };
exports.DownloadProjectJobFilesRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        for (const v of message.files) {
            jobs_1.File.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({}, baseDownloadProjectJobFilesRequest);
        message.files = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                case 2:
                    message.files.push(jobs_1.File.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseDownloadProjectJobFilesRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        message.files = ((_a = object.files) !== null && _a !== void 0 ? _a : []).map((e) => jobs_1.File.fromJSON(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        if (message.files) {
            obj.files = message.files.map((e) => (e ? jobs_1.File.toJSON(e) : undefined));
        }
        else {
            obj.files = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseDownloadProjectJobFilesRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        message.files = ((_b = object.files) === null || _b === void 0 ? void 0 : _b.map((e) => jobs_1.File.fromPartial(e))) || [];
        return message;
    },
};
const baseDownloadProjectJobFilesResponse = {};
exports.DownloadProjectJobFilesResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.downloadFiles) {
            jobs_1.StorageFile.encode(v, 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({}, baseDownloadProjectJobFilesResponse);
        message.downloadFiles = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.downloadFiles.push(jobs_1.StorageFile.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseDownloadProjectJobFilesResponse);
        message.downloadFiles = ((_a = object.downloadFiles) !== null && _a !== void 0 ? _a : []).map((e) => jobs_1.StorageFile.fromJSON(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.downloadFiles) {
            obj.downloadFiles = message.downloadFiles.map((e) => e ? jobs_1.StorageFile.toJSON(e) : undefined);
        }
        else {
            obj.downloadFiles = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDownloadProjectJobFilesResponse);
        message.downloadFiles = ((_a = object.downloadFiles) === null || _a === void 0 ? void 0 : _a.map((e) => jobs_1.StorageFile.fromPartial(e))) || [];
        return message;
    },
};
const baseListProjectJobRequest = { projectId: '', pageSize: 0, pageToken: '', filter: '' };
exports.ListProjectJobRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.projectId !== '') {
            writer.uint32(10).string(message.projectId);
        }
        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({}, baseListProjectJobRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.projectId = 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({}, baseListProjectJobRequest);
        message.projectId =
            object.projectId !== undefined && object.projectId !== null
                ? String(object.projectId)
                : '';
        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.projectId !== undefined && (obj.projectId = message.projectId);
        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({}, baseListProjectJobRequest);
        message.projectId = (_a = object.projectId) !== 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 baseListProjectJobResponse = { nextPageToken: '' };
exports.ListProjectJobResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.jobs) {
            jobs_1.Job.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({}, baseListProjectJobResponse);
        message.jobs = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobs.push(jobs_1.Job.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({}, baseListProjectJobResponse);
        message.jobs = ((_a = object.jobs) !== null && _a !== void 0 ? _a : []).map((e) => jobs_1.Job.fromJSON(e));
        message.nextPageToken =
            object.nextPageToken !== undefined && object.nextPageToken !== null
                ? String(object.nextPageToken)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.jobs) {
            obj.jobs = message.jobs.map((e) => (e ? jobs_1.Job.toJSON(e) : undefined));
        }
        else {
            obj.jobs = [];
        }
        message.nextPageToken !== undefined && (obj.nextPageToken = message.nextPageToken);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseListProjectJobResponse);
        message.jobs = ((_a = object.jobs) === null || _a === void 0 ? void 0 : _a.map((e) => jobs_1.Job.fromPartial(e))) || [];
        message.nextPageToken = (_b = object.nextPageToken) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
const baseGetProjectJobRequest = { jobId: '' };
exports.GetProjectJobRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        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({}, baseGetProjectJobRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseGetProjectJobRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseGetProjectJobRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteProjectJobRequest = { jobId: '' };
exports.DeleteProjectJobRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        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({}, baseDeleteProjectJobRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteProjectJobRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteProjectJobRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteProjectJobMetadata = { jobId: '' };
exports.DeleteProjectJobMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        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({}, baseDeleteProjectJobMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteProjectJobMetadata);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteProjectJobMetadata);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteProjectJobDataRequest = { jobId: '' };
exports.DeleteProjectJobDataRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        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({}, baseDeleteProjectJobDataRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteProjectJobDataRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteProjectJobDataRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteProjectJobDataMetadata = { jobId: '' };
exports.DeleteProjectJobDataMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        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({}, baseDeleteProjectJobDataMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteProjectJobDataMetadata);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteProjectJobDataMetadata);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteProjectJobDataResponse = {};
exports.DeleteProjectJobDataResponse = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        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({}, baseDeleteProjectJobDataResponse);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseDeleteProjectJobDataResponse);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseDeleteProjectJobDataResponse);
        return message;
    },
};
const baseDeleteAllProjectJobDataRequest = { projectId: '' };
exports.DeleteAllProjectJobDataRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.projectId !== '') {
            writer.uint32(10).string(message.projectId);
        }
        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({}, baseDeleteAllProjectJobDataRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.projectId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteAllProjectJobDataRequest);
        message.projectId =
            object.projectId !== undefined && object.projectId !== null
                ? String(object.projectId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.projectId !== undefined && (obj.projectId = message.projectId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteAllProjectJobDataRequest);
        message.projectId = (_a = object.projectId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteAllProjectJobDataMetadata = { projectId: '' };
exports.DeleteAllProjectJobDataMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.projectId !== '') {
            writer.uint32(10).string(message.projectId);
        }
        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({}, baseDeleteAllProjectJobDataMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.projectId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteAllProjectJobDataMetadata);
        message.projectId =
            object.projectId !== undefined && object.projectId !== null
                ? String(object.projectId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.projectId !== undefined && (obj.projectId = message.projectId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteAllProjectJobDataMetadata);
        message.projectId = (_a = object.projectId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteAllProjectJobDataResponse = {};
exports.DeleteAllProjectJobDataResponse = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        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({}, baseDeleteAllProjectJobDataResponse);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseDeleteAllProjectJobDataResponse);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseDeleteAllProjectJobDataResponse);
        return message;
    },
};
const baseSetProjectJobDataTtlRequest = { jobId: '' };
exports.SetProjectJobDataTtlRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.jobId !== '') {
            writer.uint32(10).string(message.jobId);
        }
        if (message.ttl !== undefined) {
            duration_1.Duration.encode(message.ttl, 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({}, baseSetProjectJobDataTtlRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.jobId = reader.string();
                    break;
                case 2:
                    message.ttl = duration_1.Duration.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseSetProjectJobDataTtlRequest);
        message.jobId =
            object.jobId !== undefined && object.jobId !== null ? String(object.jobId) : '';
        message.ttl =
            object.ttl !== undefined && object.ttl !== null
                ? duration_1.Duration.fromJSON(object.ttl)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.jobId !== undefined && (obj.jobId = message.jobId);
        message.ttl !== undefined &&
            (obj.ttl = message.ttl ? duration_1.Duration.toJSON(message.ttl) : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseSetProjectJobDataTtlRequest);
        message.jobId = (_a = object.jobId) !== null && _a !== void 0 ? _a : '';
        message.ttl =
            object.ttl !== undefined && object.ttl !== null
                ? duration_1.Duration.fromPartial(object.ttl)
                : undefined;
        return message;
    },
};
const baseSetProjectJobDataTtlResponse = {};
exports.SetProjectJobDataTtlResponse = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        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({}, baseSetProjectJobDataTtlResponse);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseSetProjectJobDataTtlResponse);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseSetProjectJobDataTtlResponse);
        return message;
    },
};
const baseStdLog = { type: 0 };
exports.StdLog = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.content.length !== 0) {
            writer.uint32(10).bytes(message.content);
        }
        if (message.type !== 0) {
            writer.uint32(16).int32(message.type);
        }
        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({}, baseStdLog);
        message.content = Buffer.alloc(0);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.content = reader.bytes();
                    break;
                case 2:
                    message.type = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseStdLog);
        message.content =
            object.content !== undefined && object.content !== null
                ? Buffer.from(bytesFromBase64(object.content))
                : Buffer.alloc(0);
        message.type =
            object.type !== undefined && object.type !== null
                ? stdLog_TypeFromJSON(object.type)
                : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.content !== undefined &&
            (obj.content = base64FromBytes(message.content !== undefined ? message.content : Buffer.alloc(0)));
        message.type !== undefined && (obj.type = stdLog_TypeToJSON(message.type));
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseStdLog);
        message.content = (_a = object.content) !== null && _a !== void 0 ? _a : Buffer.alloc(0);
        message.type = (_b = object.type) !== null && _b !== void 0 ? _b : 0;
        return message;
    },
};
const baseLogMessage = {};
exports.LogMessage = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.content.length !== 0) {
            writer.uint32(10).bytes(message.content);
        }
        if (message.createdAt !== undefined) {
            timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(18).fork()).ldelim();
        }
        if (message.standardStream !== undefined) {
            writer.uint32(24).int32(message.standardStream);
        }
        if (message.filePath !== undefined) {
            writer.uint32(34).string(message.filePath);
        }
        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({}, baseLogMessage);
        message.content = Buffer.alloc(0);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.content = reader.bytes();
                    break;
                case 2:
                    message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
                    break;
                case 3:
                    message.standardStream = reader.int32();
                    break;
                case 4:
                    message.filePath = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseLogMessage);
        message.content =
            object.content !== undefined && object.content !== null
                ? Buffer.from(bytesFromBase64(object.content))
                : Buffer.alloc(0);
        message.createdAt =
            object.createdAt !== undefined && object.createdAt !== null
                ? fromJsonTimestamp(object.createdAt)
                : undefined;
        message.standardStream =
            object.standardStream !== undefined && object.standardStream !== null
                ? standardStreamFromJSON(object.standardStream)
                : undefined;
        message.filePath =
            object.filePath !== undefined && object.filePath !== null
                ? String(object.filePath)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.content !== undefined &&
            (obj.content = base64FromBytes(message.content !== undefined ? message.content : Buffer.alloc(0)));
        message.createdAt !== undefined && (obj.createdAt = message.createdAt.toISOString());
        message.standardStream !== undefined &&
            (obj.standardStream =
                message.standardStream !== undefined
                    ? standardStreamToJSON(message.standardStream)
                    : undefined);
        message.filePath !== undefined && (obj.filePath = message.filePath);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = Object.assign({}, baseLogMessage);
        message.content = (_a = object.content) !== null && _a !== void 0 ? _a : Buffer.alloc(0);
        message.createdAt = (_b = object.createdAt) !== null && _b !== void 0 ? _b : undefined;
        message.standardStream = (_c = object.standardStream) !== null && _c !== void 0 ? _c : undefined;
        message.filePath = (_d = object.filePath) !== null && _d !== void 0 ? _d : undefined;
        return message;
    },
};
/**
 * A set of methods for managing Project Jobs. Do not use these methods manually.
 * For working with DataSphere Jobs, install DataSphere CLI via `pip install datasphere`.
 */
exports.ProjectJobServiceService = {
    /** Creates job. */
    create: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Create',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.CreateProjectJobRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.CreateProjectJobRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Clone job. */
    clone: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Clone',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.CloneProjectJobRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.CloneProjectJobRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Runs job execution. */
    execute: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Execute',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.ExecuteProjectJobRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.ExecuteProjectJobRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Cancels running job. */
    cancel: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Cancel',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.CancelProjectJobRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.CancelProjectJobRequest.decode(value),
        responseSerialize: (value) => Buffer.from(empty_1.Empty.encode(value).finish()),
        responseDeserialize: (value) => empty_1.Empty.decode(value),
    },
    /**
     * Returns stream of job logs.
     *
     * @deprecated
     */
    readStdLogs: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/ReadStdLogs',
        requestStream: false,
        responseStream: true,
        requestSerialize: (value) => Buffer.from(exports.ReadProjectJobStdLogsRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.ReadProjectJobStdLogsRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.ReadProjectJobStdLogsResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.ReadProjectJobStdLogsResponse.decode(value),
    },
    /** Returns stream of job logs. */
    readLogs: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/ReadLogs',
        requestStream: false,
        responseStream: true,
        requestSerialize: (value) => Buffer.from(exports.ReadProjectJobLogsRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.ReadProjectJobLogsRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.ReadProjectJobLogsResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.ReadProjectJobLogsResponse.decode(value),
    },
    /** Returns download urls for job files. */
    downloadJobFiles: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/DownloadJobFiles',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.DownloadProjectJobFilesRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.DownloadProjectJobFilesRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.DownloadProjectJobFilesResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.DownloadProjectJobFilesResponse.decode(value),
    },
    /** Lists jobs. */
    list: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/List',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.ListProjectJobRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.ListProjectJobRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.ListProjectJobResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.ListProjectJobResponse.decode(value),
    },
    /** Returns job by id. */
    get: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Get',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.GetProjectJobRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.GetProjectJobRequest.decode(value),
        responseSerialize: (value) => Buffer.from(jobs_1.Job.encode(value).finish()),
        responseDeserialize: (value) => jobs_1.Job.decode(value),
    },
    /** Deletes specified job. */
    delete: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Delete',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.DeleteProjectJobRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.DeleteProjectJobRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Delete job data. */
    deleteData: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/DeleteData',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.DeleteProjectJobDataRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.DeleteProjectJobDataRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Delete all jobs data. */
    deleteAllData: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/DeleteAllData',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.DeleteAllProjectJobDataRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.DeleteAllProjectJobDataRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Update job data ttl. */
    setDataTtl: {
        path: '/yandex.cloud.datasphere.v2.jobs.ProjectJobService/SetDataTtl',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.SetProjectJobDataTtlRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.SetProjectJobDataTtlRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.SetProjectJobDataTtlResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.SetProjectJobDataTtlResponse.decode(value),
    },
};
exports.ProjectJobServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.ProjectJobServiceService, 'yandex.cloud.datasphere.v2.jobs.ProjectJobService');
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';
})();
const atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary'));
function bytesFromBase64(b64) {
    const bin = atob(b64);
    const arr = new Uint8Array(bin.length);
    for (let i = 0; i < bin.length; ++i) {
        arr[i] = bin.charCodeAt(i);
    }
    return arr;
}
const btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64'));
function base64FromBytes(arr) {
    const bin = [];
    for (const byte of arr) {
        bin.push(String.fromCharCode(byte));
    }
    return btoa(bin.join(''));
}
function toTimestamp(date) {
    const seconds = date.getTime() / 1000;
    const nanos = (date.getTime() % 1000) * 1000000;
    return { seconds, nanos };
}
function fromTimestamp(t) {
    let millis = t.seconds * 1000;
    millis += t.nanos / 1000000;
    return new Date(millis);
}
function fromJsonTimestamp(o) {
    if (o instanceof Date) {
        return o;
    }
    else if (typeof o === 'string') {
        return new Date(o);
    }
    else {
        return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
    }
}
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();
}
