"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DockerImageServiceClient = exports.DockerImageServiceService = exports.ActivateDockerImageRequest = 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 operation_1 = require("../../../../yandex/cloud/operation/operation");
exports.protobufPackage = 'yandex.cloud.datasphere.v2';
const baseActivateDockerImageRequest = { projectId: '', dockerId: '' };
exports.ActivateDockerImageRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.projectId !== '') {
            writer.uint32(10).string(message.projectId);
        }
        if (message.dockerId !== '') {
            writer.uint32(18).string(message.dockerId);
        }
        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({}, baseActivateDockerImageRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.projectId = reader.string();
                    break;
                case 2:
                    message.dockerId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseActivateDockerImageRequest);
        message.projectId =
            object.projectId !== undefined && object.projectId !== null
                ? String(object.projectId)
                : '';
        message.dockerId =
            object.dockerId !== undefined && object.dockerId !== null
                ? String(object.dockerId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.projectId !== undefined && (obj.projectId = message.projectId);
        message.dockerId !== undefined && (obj.dockerId = message.dockerId);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseActivateDockerImageRequest);
        message.projectId = (_a = object.projectId) !== null && _a !== void 0 ? _a : '';
        message.dockerId = (_b = object.dockerId) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
/** A set of methods for managing Docker Images. */
exports.DockerImageServiceService = {
    /** Activates shared docker image in project */
    activate: {
        path: '/yandex.cloud.datasphere.v2.DockerImageService/Activate',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.ActivateDockerImageRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.ActivateDockerImageRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
};
exports.DockerImageServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.DockerImageServiceService, 'yandex.cloud.datasphere.v2.DockerImageService');
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
