"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OsLoginServiceClient = exports.OsLoginServiceService = exports.SetDefaultOsLoginProfileMetadata = exports.UpdateOsLoginSettingsMetadata = exports.CreateOsLoginProfileMetadata = exports.DeleteOsLoginProfileMetadata = exports.UpdateOsLoginProfileMetadata = exports.CreateOsLoginProfileRequest = exports.DeleteOsLoginProfileRequest = exports.UpdateOsLoginProfileRequest = exports.OsLoginProfile = exports.ListOsLoginProfilesResponse = exports.ListOsLoginProfilesRequest = exports.GetOsLoginProfileRequest = exports.SetDefaultOsLoginProfileRequest = exports.UpdateOsLoginSettingsRequest_SshCertificateSettings = exports.UpdateOsLoginSettingsRequest_UserSshKeySettings = exports.UpdateOsLoginSettingsRequest = exports.SshCertificateSettings = exports.UserSshKeySettings = exports.OsLoginSettings = exports.GetOsLoginSettingsRequest = 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 field_mask_1 = require("../../../../google/protobuf/field_mask");
const operation_1 = require("../../../../yandex/cloud/operation/operation");
exports.protobufPackage = 'yandex.cloud.organizationmanager.v1';
const baseGetOsLoginSettingsRequest = { organizationId: '' };
exports.GetOsLoginSettingsRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.organizationId !== '') {
            writer.uint32(10).string(message.organizationId);
        }
        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({}, baseGetOsLoginSettingsRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.organizationId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseGetOsLoginSettingsRequest);
        message.organizationId =
            object.organizationId !== undefined && object.organizationId !== null
                ? String(object.organizationId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.organizationId !== undefined && (obj.organizationId = message.organizationId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseGetOsLoginSettingsRequest);
        message.organizationId = (_a = object.organizationId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseOsLoginSettings = {};
exports.OsLoginSettings = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.userSshKeySettings !== undefined) {
            exports.UserSshKeySettings.encode(message.userSshKeySettings, writer.uint32(10).fork()).ldelim();
        }
        if (message.sshCertificateSettings !== undefined) {
            exports.SshCertificateSettings.encode(message.sshCertificateSettings, 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({}, baseOsLoginSettings);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.userSshKeySettings = exports.UserSshKeySettings.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.sshCertificateSettings = exports.SshCertificateSettings.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseOsLoginSettings);
        message.userSshKeySettings =
            object.userSshKeySettings !== undefined && object.userSshKeySettings !== null
                ? exports.UserSshKeySettings.fromJSON(object.userSshKeySettings)
                : undefined;
        message.sshCertificateSettings =
            object.sshCertificateSettings !== undefined && object.sshCertificateSettings !== null
                ? exports.SshCertificateSettings.fromJSON(object.sshCertificateSettings)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.userSshKeySettings !== undefined &&
            (obj.userSshKeySettings = message.userSshKeySettings
                ? exports.UserSshKeySettings.toJSON(message.userSshKeySettings)
                : undefined);
        message.sshCertificateSettings !== undefined &&
            (obj.sshCertificateSettings = message.sshCertificateSettings
                ? exports.SshCertificateSettings.toJSON(message.sshCertificateSettings)
                : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = Object.assign({}, baseOsLoginSettings);
        message.userSshKeySettings =
            object.userSshKeySettings !== undefined && object.userSshKeySettings !== null
                ? exports.UserSshKeySettings.fromPartial(object.userSshKeySettings)
                : undefined;
        message.sshCertificateSettings =
            object.sshCertificateSettings !== undefined && object.sshCertificateSettings !== null
                ? exports.SshCertificateSettings.fromPartial(object.sshCertificateSettings)
                : undefined;
        return message;
    },
};
const baseUserSshKeySettings = { enabled: false, allowManageOwnKeys: false };
exports.UserSshKeySettings = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.enabled === true) {
            writer.uint32(8).bool(message.enabled);
        }
        if (message.allowManageOwnKeys === true) {
            writer.uint32(16).bool(message.allowManageOwnKeys);
        }
        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({}, baseUserSshKeySettings);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.enabled = reader.bool();
                    break;
                case 2:
                    message.allowManageOwnKeys = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUserSshKeySettings);
        message.enabled =
            object.enabled !== undefined && object.enabled !== null
                ? Boolean(object.enabled)
                : false;
        message.allowManageOwnKeys =
            object.allowManageOwnKeys !== undefined && object.allowManageOwnKeys !== null
                ? Boolean(object.allowManageOwnKeys)
                : false;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.enabled !== undefined && (obj.enabled = message.enabled);
        message.allowManageOwnKeys !== undefined &&
            (obj.allowManageOwnKeys = message.allowManageOwnKeys);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseUserSshKeySettings);
        message.enabled = (_a = object.enabled) !== null && _a !== void 0 ? _a : false;
        message.allowManageOwnKeys = (_b = object.allowManageOwnKeys) !== null && _b !== void 0 ? _b : false;
        return message;
    },
};
const baseSshCertificateSettings = { enabled: false };
exports.SshCertificateSettings = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.enabled === true) {
            writer.uint32(8).bool(message.enabled);
        }
        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({}, baseSshCertificateSettings);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.enabled = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseSshCertificateSettings);
        message.enabled =
            object.enabled !== undefined && object.enabled !== null
                ? Boolean(object.enabled)
                : false;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.enabled !== undefined && (obj.enabled = message.enabled);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseSshCertificateSettings);
        message.enabled = (_a = object.enabled) !== null && _a !== void 0 ? _a : false;
        return message;
    },
};
const baseUpdateOsLoginSettingsRequest = { organizationId: '' };
exports.UpdateOsLoginSettingsRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.organizationId !== '') {
            writer.uint32(10).string(message.organizationId);
        }
        if (message.userSshKeySettings !== undefined) {
            exports.UpdateOsLoginSettingsRequest_UserSshKeySettings.encode(message.userSshKeySettings, writer.uint32(18).fork()).ldelim();
        }
        if (message.sshCertificateSettings !== undefined) {
            exports.UpdateOsLoginSettingsRequest_SshCertificateSettings.encode(message.sshCertificateSettings, writer.uint32(26).fork()).ldelim();
        }
        if (message.updateMask !== undefined) {
            field_mask_1.FieldMask.encode(message.updateMask, writer.uint32(34).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseUpdateOsLoginSettingsRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.organizationId = reader.string();
                    break;
                case 2:
                    message.userSshKeySettings =
                        exports.UpdateOsLoginSettingsRequest_UserSshKeySettings.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.sshCertificateSettings =
                        exports.UpdateOsLoginSettingsRequest_SshCertificateSettings.decode(reader, reader.uint32());
                    break;
                case 4:
                    message.updateMask = field_mask_1.FieldMask.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateOsLoginSettingsRequest);
        message.organizationId =
            object.organizationId !== undefined && object.organizationId !== null
                ? String(object.organizationId)
                : '';
        message.userSshKeySettings =
            object.userSshKeySettings !== undefined && object.userSshKeySettings !== null
                ? exports.UpdateOsLoginSettingsRequest_UserSshKeySettings.fromJSON(object.userSshKeySettings)
                : undefined;
        message.sshCertificateSettings =
            object.sshCertificateSettings !== undefined && object.sshCertificateSettings !== null
                ? exports.UpdateOsLoginSettingsRequest_SshCertificateSettings.fromJSON(object.sshCertificateSettings)
                : undefined;
        message.updateMask =
            object.updateMask !== undefined && object.updateMask !== null
                ? field_mask_1.FieldMask.fromJSON(object.updateMask)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.organizationId !== undefined && (obj.organizationId = message.organizationId);
        message.userSshKeySettings !== undefined &&
            (obj.userSshKeySettings = message.userSshKeySettings
                ? exports.UpdateOsLoginSettingsRequest_UserSshKeySettings.toJSON(message.userSshKeySettings)
                : undefined);
        message.sshCertificateSettings !== undefined &&
            (obj.sshCertificateSettings = message.sshCertificateSettings
                ? exports.UpdateOsLoginSettingsRequest_SshCertificateSettings.toJSON(message.sshCertificateSettings)
                : undefined);
        message.updateMask !== undefined &&
            (obj.updateMask = message.updateMask
                ? field_mask_1.FieldMask.toJSON(message.updateMask)
                : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseUpdateOsLoginSettingsRequest);
        message.organizationId = (_a = object.organizationId) !== null && _a !== void 0 ? _a : '';
        message.userSshKeySettings =
            object.userSshKeySettings !== undefined && object.userSshKeySettings !== null
                ? exports.UpdateOsLoginSettingsRequest_UserSshKeySettings.fromPartial(object.userSshKeySettings)
                : undefined;
        message.sshCertificateSettings =
            object.sshCertificateSettings !== undefined && object.sshCertificateSettings !== null
                ? exports.UpdateOsLoginSettingsRequest_SshCertificateSettings.fromPartial(object.sshCertificateSettings)
                : undefined;
        message.updateMask =
            object.updateMask !== undefined && object.updateMask !== null
                ? field_mask_1.FieldMask.fromPartial(object.updateMask)
                : undefined;
        return message;
    },
};
const baseUpdateOsLoginSettingsRequest_UserSshKeySettings = {
    enabled: false,
    allowManageOwnKeys: false,
};
exports.UpdateOsLoginSettingsRequest_UserSshKeySettings = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.enabled === true) {
            writer.uint32(8).bool(message.enabled);
        }
        if (message.allowManageOwnKeys === true) {
            writer.uint32(16).bool(message.allowManageOwnKeys);
        }
        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({}, baseUpdateOsLoginSettingsRequest_UserSshKeySettings);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.enabled = reader.bool();
                    break;
                case 2:
                    message.allowManageOwnKeys = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateOsLoginSettingsRequest_UserSshKeySettings);
        message.enabled =
            object.enabled !== undefined && object.enabled !== null
                ? Boolean(object.enabled)
                : false;
        message.allowManageOwnKeys =
            object.allowManageOwnKeys !== undefined && object.allowManageOwnKeys !== null
                ? Boolean(object.allowManageOwnKeys)
                : false;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.enabled !== undefined && (obj.enabled = message.enabled);
        message.allowManageOwnKeys !== undefined &&
            (obj.allowManageOwnKeys = message.allowManageOwnKeys);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseUpdateOsLoginSettingsRequest_UserSshKeySettings);
        message.enabled = (_a = object.enabled) !== null && _a !== void 0 ? _a : false;
        message.allowManageOwnKeys = (_b = object.allowManageOwnKeys) !== null && _b !== void 0 ? _b : false;
        return message;
    },
};
const baseUpdateOsLoginSettingsRequest_SshCertificateSettings = { enabled: false };
exports.UpdateOsLoginSettingsRequest_SshCertificateSettings = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.enabled === true) {
            writer.uint32(8).bool(message.enabled);
        }
        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({}, baseUpdateOsLoginSettingsRequest_SshCertificateSettings);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.enabled = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateOsLoginSettingsRequest_SshCertificateSettings);
        message.enabled =
            object.enabled !== undefined && object.enabled !== null
                ? Boolean(object.enabled)
                : false;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.enabled !== undefined && (obj.enabled = message.enabled);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseUpdateOsLoginSettingsRequest_SshCertificateSettings);
        message.enabled = (_a = object.enabled) !== null && _a !== void 0 ? _a : false;
        return message;
    },
};
const baseSetDefaultOsLoginProfileRequest = { osLoginProfileId: '' };
exports.SetDefaultOsLoginProfileRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.osLoginProfileId !== '') {
            writer.uint32(10).string(message.osLoginProfileId);
        }
        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({}, baseSetDefaultOsLoginProfileRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.osLoginProfileId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseSetDefaultOsLoginProfileRequest);
        message.osLoginProfileId =
            object.osLoginProfileId !== undefined && object.osLoginProfileId !== null
                ? String(object.osLoginProfileId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.osLoginProfileId !== undefined && (obj.osLoginProfileId = message.osLoginProfileId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseSetDefaultOsLoginProfileRequest);
        message.osLoginProfileId = (_a = object.osLoginProfileId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseGetOsLoginProfileRequest = { osLoginProfileId: '' };
exports.GetOsLoginProfileRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.osLoginProfileId !== '') {
            writer.uint32(10).string(message.osLoginProfileId);
        }
        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({}, baseGetOsLoginProfileRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.osLoginProfileId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseGetOsLoginProfileRequest);
        message.osLoginProfileId =
            object.osLoginProfileId !== undefined && object.osLoginProfileId !== null
                ? String(object.osLoginProfileId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.osLoginProfileId !== undefined && (obj.osLoginProfileId = message.osLoginProfileId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseGetOsLoginProfileRequest);
        message.osLoginProfileId = (_a = object.osLoginProfileId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseListOsLoginProfilesRequest = {
    organizationId: '',
    pageSize: 0,
    pageToken: '',
    filter: '',
};
exports.ListOsLoginProfilesRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.organizationId !== '') {
            writer.uint32(10).string(message.organizationId);
        }
        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({}, baseListOsLoginProfilesRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.organizationId = 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({}, baseListOsLoginProfilesRequest);
        message.organizationId =
            object.organizationId !== undefined && object.organizationId !== null
                ? String(object.organizationId)
                : '';
        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.organizationId !== undefined && (obj.organizationId = message.organizationId);
        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({}, baseListOsLoginProfilesRequest);
        message.organizationId = (_a = object.organizationId) !== 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 baseListOsLoginProfilesResponse = { nextPageToken: '' };
exports.ListOsLoginProfilesResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.profiles) {
            exports.OsLoginProfile.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({}, baseListOsLoginProfilesResponse);
        message.profiles = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.profiles.push(exports.OsLoginProfile.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({}, baseListOsLoginProfilesResponse);
        message.profiles = ((_a = object.profiles) !== null && _a !== void 0 ? _a : []).map((e) => exports.OsLoginProfile.fromJSON(e));
        message.nextPageToken =
            object.nextPageToken !== undefined && object.nextPageToken !== null
                ? String(object.nextPageToken)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.profiles) {
            obj.profiles = message.profiles.map((e) => (e ? exports.OsLoginProfile.toJSON(e) : undefined));
        }
        else {
            obj.profiles = [];
        }
        message.nextPageToken !== undefined && (obj.nextPageToken = message.nextPageToken);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseListOsLoginProfilesResponse);
        message.profiles = ((_a = object.profiles) === null || _a === void 0 ? void 0 : _a.map((e) => exports.OsLoginProfile.fromPartial(e))) || [];
        message.nextPageToken = (_b = object.nextPageToken) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
const baseOsLoginProfile = {
    id: '',
    organizationId: '',
    subjectId: '',
    login: '',
    uid: 0,
    isDefault: false,
    homeDirectory: '',
    shell: '',
};
exports.OsLoginProfile = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.id !== '') {
            writer.uint32(10).string(message.id);
        }
        if (message.organizationId !== '') {
            writer.uint32(18).string(message.organizationId);
        }
        if (message.subjectId !== '') {
            writer.uint32(26).string(message.subjectId);
        }
        if (message.login !== '') {
            writer.uint32(34).string(message.login);
        }
        if (message.uid !== 0) {
            writer.uint32(40).int64(message.uid);
        }
        if (message.isDefault === true) {
            writer.uint32(48).bool(message.isDefault);
        }
        if (message.homeDirectory !== '') {
            writer.uint32(58).string(message.homeDirectory);
        }
        if (message.shell !== '') {
            writer.uint32(66).string(message.shell);
        }
        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({}, baseOsLoginProfile);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.id = reader.string();
                    break;
                case 2:
                    message.organizationId = reader.string();
                    break;
                case 3:
                    message.subjectId = reader.string();
                    break;
                case 4:
                    message.login = reader.string();
                    break;
                case 5:
                    message.uid = longToNumber(reader.int64());
                    break;
                case 6:
                    message.isDefault = reader.bool();
                    break;
                case 7:
                    message.homeDirectory = reader.string();
                    break;
                case 8:
                    message.shell = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseOsLoginProfile);
        message.id = object.id !== undefined && object.id !== null ? String(object.id) : '';
        message.organizationId =
            object.organizationId !== undefined && object.organizationId !== null
                ? String(object.organizationId)
                : '';
        message.subjectId =
            object.subjectId !== undefined && object.subjectId !== null
                ? String(object.subjectId)
                : '';
        message.login =
            object.login !== undefined && object.login !== null ? String(object.login) : '';
        message.uid = object.uid !== undefined && object.uid !== null ? Number(object.uid) : 0;
        message.isDefault =
            object.isDefault !== undefined && object.isDefault !== null
                ? Boolean(object.isDefault)
                : false;
        message.homeDirectory =
            object.homeDirectory !== undefined && object.homeDirectory !== null
                ? String(object.homeDirectory)
                : '';
        message.shell =
            object.shell !== undefined && object.shell !== null ? String(object.shell) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.id !== undefined && (obj.id = message.id);
        message.organizationId !== undefined && (obj.organizationId = message.organizationId);
        message.subjectId !== undefined && (obj.subjectId = message.subjectId);
        message.login !== undefined && (obj.login = message.login);
        message.uid !== undefined && (obj.uid = Math.round(message.uid));
        message.isDefault !== undefined && (obj.isDefault = message.isDefault);
        message.homeDirectory !== undefined && (obj.homeDirectory = message.homeDirectory);
        message.shell !== undefined && (obj.shell = message.shell);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e, _f, _g, _h;
        const message = Object.assign({}, baseOsLoginProfile);
        message.id = (_a = object.id) !== null && _a !== void 0 ? _a : '';
        message.organizationId = (_b = object.organizationId) !== null && _b !== void 0 ? _b : '';
        message.subjectId = (_c = object.subjectId) !== null && _c !== void 0 ? _c : '';
        message.login = (_d = object.login) !== null && _d !== void 0 ? _d : '';
        message.uid = (_e = object.uid) !== null && _e !== void 0 ? _e : 0;
        message.isDefault = (_f = object.isDefault) !== null && _f !== void 0 ? _f : false;
        message.homeDirectory = (_g = object.homeDirectory) !== null && _g !== void 0 ? _g : '';
        message.shell = (_h = object.shell) !== null && _h !== void 0 ? _h : '';
        return message;
    },
};
const baseUpdateOsLoginProfileRequest = {
    osLoginProfileId: '',
    login: '',
    uid: 0,
    homeDirectory: '',
    shell: '',
};
exports.UpdateOsLoginProfileRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.osLoginProfileId !== '') {
            writer.uint32(10).string(message.osLoginProfileId);
        }
        if (message.login !== '') {
            writer.uint32(18).string(message.login);
        }
        if (message.uid !== 0) {
            writer.uint32(24).int64(message.uid);
        }
        if (message.homeDirectory !== '') {
            writer.uint32(34).string(message.homeDirectory);
        }
        if (message.shell !== '') {
            writer.uint32(42).string(message.shell);
        }
        if (message.updateMask !== undefined) {
            field_mask_1.FieldMask.encode(message.updateMask, 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({}, baseUpdateOsLoginProfileRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.osLoginProfileId = reader.string();
                    break;
                case 2:
                    message.login = reader.string();
                    break;
                case 3:
                    message.uid = longToNumber(reader.int64());
                    break;
                case 4:
                    message.homeDirectory = reader.string();
                    break;
                case 5:
                    message.shell = reader.string();
                    break;
                case 6:
                    message.updateMask = field_mask_1.FieldMask.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateOsLoginProfileRequest);
        message.osLoginProfileId =
            object.osLoginProfileId !== undefined && object.osLoginProfileId !== null
                ? String(object.osLoginProfileId)
                : '';
        message.login =
            object.login !== undefined && object.login !== null ? String(object.login) : '';
        message.uid = object.uid !== undefined && object.uid !== null ? Number(object.uid) : 0;
        message.homeDirectory =
            object.homeDirectory !== undefined && object.homeDirectory !== null
                ? String(object.homeDirectory)
                : '';
        message.shell =
            object.shell !== undefined && object.shell !== null ? String(object.shell) : '';
        message.updateMask =
            object.updateMask !== undefined && object.updateMask !== null
                ? field_mask_1.FieldMask.fromJSON(object.updateMask)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.osLoginProfileId !== undefined && (obj.osLoginProfileId = message.osLoginProfileId);
        message.login !== undefined && (obj.login = message.login);
        message.uid !== undefined && (obj.uid = Math.round(message.uid));
        message.homeDirectory !== undefined && (obj.homeDirectory = message.homeDirectory);
        message.shell !== undefined && (obj.shell = message.shell);
        message.updateMask !== undefined &&
            (obj.updateMask = message.updateMask
                ? field_mask_1.FieldMask.toJSON(message.updateMask)
                : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e;
        const message = Object.assign({}, baseUpdateOsLoginProfileRequest);
        message.osLoginProfileId = (_a = object.osLoginProfileId) !== null && _a !== void 0 ? _a : '';
        message.login = (_b = object.login) !== null && _b !== void 0 ? _b : '';
        message.uid = (_c = object.uid) !== null && _c !== void 0 ? _c : 0;
        message.homeDirectory = (_d = object.homeDirectory) !== null && _d !== void 0 ? _d : '';
        message.shell = (_e = object.shell) !== null && _e !== void 0 ? _e : '';
        message.updateMask =
            object.updateMask !== undefined && object.updateMask !== null
                ? field_mask_1.FieldMask.fromPartial(object.updateMask)
                : undefined;
        return message;
    },
};
const baseDeleteOsLoginProfileRequest = { id: '' };
exports.DeleteOsLoginProfileRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.id !== '') {
            writer.uint32(10).string(message.id);
        }
        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({}, baseDeleteOsLoginProfileRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.id = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteOsLoginProfileRequest);
        message.id = object.id !== undefined && object.id !== null ? String(object.id) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.id !== undefined && (obj.id = message.id);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteOsLoginProfileRequest);
        message.id = (_a = object.id) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseCreateOsLoginProfileRequest = {
    organizationId: '',
    subjectId: '',
    login: '',
    uid: 0,
    homeDirectory: '',
    shell: '',
};
exports.CreateOsLoginProfileRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.organizationId !== '') {
            writer.uint32(10).string(message.organizationId);
        }
        if (message.subjectId !== '') {
            writer.uint32(18).string(message.subjectId);
        }
        if (message.login !== '') {
            writer.uint32(26).string(message.login);
        }
        if (message.uid !== 0) {
            writer.uint32(32).int64(message.uid);
        }
        if (message.homeDirectory !== '') {
            writer.uint32(42).string(message.homeDirectory);
        }
        if (message.shell !== '') {
            writer.uint32(50).string(message.shell);
        }
        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({}, baseCreateOsLoginProfileRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.organizationId = reader.string();
                    break;
                case 2:
                    message.subjectId = reader.string();
                    break;
                case 3:
                    message.login = reader.string();
                    break;
                case 4:
                    message.uid = longToNumber(reader.int64());
                    break;
                case 5:
                    message.homeDirectory = reader.string();
                    break;
                case 6:
                    message.shell = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCreateOsLoginProfileRequest);
        message.organizationId =
            object.organizationId !== undefined && object.organizationId !== null
                ? String(object.organizationId)
                : '';
        message.subjectId =
            object.subjectId !== undefined && object.subjectId !== null
                ? String(object.subjectId)
                : '';
        message.login =
            object.login !== undefined && object.login !== null ? String(object.login) : '';
        message.uid = object.uid !== undefined && object.uid !== null ? Number(object.uid) : 0;
        message.homeDirectory =
            object.homeDirectory !== undefined && object.homeDirectory !== null
                ? String(object.homeDirectory)
                : '';
        message.shell =
            object.shell !== undefined && object.shell !== null ? String(object.shell) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.organizationId !== undefined && (obj.organizationId = message.organizationId);
        message.subjectId !== undefined && (obj.subjectId = message.subjectId);
        message.login !== undefined && (obj.login = message.login);
        message.uid !== undefined && (obj.uid = Math.round(message.uid));
        message.homeDirectory !== undefined && (obj.homeDirectory = message.homeDirectory);
        message.shell !== undefined && (obj.shell = message.shell);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e, _f;
        const message = Object.assign({}, baseCreateOsLoginProfileRequest);
        message.organizationId = (_a = object.organizationId) !== null && _a !== void 0 ? _a : '';
        message.subjectId = (_b = object.subjectId) !== null && _b !== void 0 ? _b : '';
        message.login = (_c = object.login) !== null && _c !== void 0 ? _c : '';
        message.uid = (_d = object.uid) !== null && _d !== void 0 ? _d : 0;
        message.homeDirectory = (_e = object.homeDirectory) !== null && _e !== void 0 ? _e : '';
        message.shell = (_f = object.shell) !== null && _f !== void 0 ? _f : '';
        return message;
    },
};
const baseUpdateOsLoginProfileMetadata = { osLoginProfileId: '' };
exports.UpdateOsLoginProfileMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.osLoginProfileId !== '') {
            writer.uint32(10).string(message.osLoginProfileId);
        }
        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({}, baseUpdateOsLoginProfileMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.osLoginProfileId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateOsLoginProfileMetadata);
        message.osLoginProfileId =
            object.osLoginProfileId !== undefined && object.osLoginProfileId !== null
                ? String(object.osLoginProfileId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.osLoginProfileId !== undefined && (obj.osLoginProfileId = message.osLoginProfileId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseUpdateOsLoginProfileMetadata);
        message.osLoginProfileId = (_a = object.osLoginProfileId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteOsLoginProfileMetadata = { osLoginProfileId: '' };
exports.DeleteOsLoginProfileMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.osLoginProfileId !== '') {
            writer.uint32(10).string(message.osLoginProfileId);
        }
        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({}, baseDeleteOsLoginProfileMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.osLoginProfileId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteOsLoginProfileMetadata);
        message.osLoginProfileId =
            object.osLoginProfileId !== undefined && object.osLoginProfileId !== null
                ? String(object.osLoginProfileId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.osLoginProfileId !== undefined && (obj.osLoginProfileId = message.osLoginProfileId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteOsLoginProfileMetadata);
        message.osLoginProfileId = (_a = object.osLoginProfileId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseCreateOsLoginProfileMetadata = {
    osLoginProfileId: '',
    organizationId: '',
    subjectId: '',
};
exports.CreateOsLoginProfileMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.osLoginProfileId !== '') {
            writer.uint32(10).string(message.osLoginProfileId);
        }
        if (message.organizationId !== '') {
            writer.uint32(18).string(message.organizationId);
        }
        if (message.subjectId !== '') {
            writer.uint32(26).string(message.subjectId);
        }
        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({}, baseCreateOsLoginProfileMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.osLoginProfileId = reader.string();
                    break;
                case 2:
                    message.organizationId = reader.string();
                    break;
                case 3:
                    message.subjectId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCreateOsLoginProfileMetadata);
        message.osLoginProfileId =
            object.osLoginProfileId !== undefined && object.osLoginProfileId !== null
                ? String(object.osLoginProfileId)
                : '';
        message.organizationId =
            object.organizationId !== undefined && object.organizationId !== null
                ? String(object.organizationId)
                : '';
        message.subjectId =
            object.subjectId !== undefined && object.subjectId !== null
                ? String(object.subjectId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.osLoginProfileId !== undefined && (obj.osLoginProfileId = message.osLoginProfileId);
        message.organizationId !== undefined && (obj.organizationId = message.organizationId);
        message.subjectId !== undefined && (obj.subjectId = message.subjectId);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = Object.assign({}, baseCreateOsLoginProfileMetadata);
        message.osLoginProfileId = (_a = object.osLoginProfileId) !== null && _a !== void 0 ? _a : '';
        message.organizationId = (_b = object.organizationId) !== null && _b !== void 0 ? _b : '';
        message.subjectId = (_c = object.subjectId) !== null && _c !== void 0 ? _c : '';
        return message;
    },
};
const baseUpdateOsLoginSettingsMetadata = { organizationId: '' };
exports.UpdateOsLoginSettingsMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.organizationId !== '') {
            writer.uint32(10).string(message.organizationId);
        }
        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({}, baseUpdateOsLoginSettingsMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.organizationId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateOsLoginSettingsMetadata);
        message.organizationId =
            object.organizationId !== undefined && object.organizationId !== null
                ? String(object.organizationId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.organizationId !== undefined && (obj.organizationId = message.organizationId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseUpdateOsLoginSettingsMetadata);
        message.organizationId = (_a = object.organizationId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseSetDefaultOsLoginProfileMetadata = {
    previousDefaultProfileId: '',
    currentDefaultProfileId: '',
};
exports.SetDefaultOsLoginProfileMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.previousDefaultProfileId !== '') {
            writer.uint32(10).string(message.previousDefaultProfileId);
        }
        if (message.currentDefaultProfileId !== '') {
            writer.uint32(18).string(message.currentDefaultProfileId);
        }
        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({}, baseSetDefaultOsLoginProfileMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.previousDefaultProfileId = reader.string();
                    break;
                case 2:
                    message.currentDefaultProfileId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseSetDefaultOsLoginProfileMetadata);
        message.previousDefaultProfileId =
            object.previousDefaultProfileId !== undefined &&
                object.previousDefaultProfileId !== null
                ? String(object.previousDefaultProfileId)
                : '';
        message.currentDefaultProfileId =
            object.currentDefaultProfileId !== undefined && object.currentDefaultProfileId !== null
                ? String(object.currentDefaultProfileId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.previousDefaultProfileId !== undefined &&
            (obj.previousDefaultProfileId = message.previousDefaultProfileId);
        message.currentDefaultProfileId !== undefined &&
            (obj.currentDefaultProfileId = message.currentDefaultProfileId);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseSetDefaultOsLoginProfileMetadata);
        message.previousDefaultProfileId = (_a = object.previousDefaultProfileId) !== null && _a !== void 0 ? _a : '';
        message.currentDefaultProfileId = (_b = object.currentDefaultProfileId) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
exports.OsLoginServiceService = {
    /** OsLogin settings */
    getSettings: {
        path: '/yandex.cloud.organizationmanager.v1.OsLoginService/GetSettings',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.GetOsLoginSettingsRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.GetOsLoginSettingsRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.OsLoginSettings.encode(value).finish()),
        responseDeserialize: (value) => exports.OsLoginSettings.decode(value),
    },
    updateSettings: {
        path: '/yandex.cloud.organizationmanager.v1.OsLoginService/UpdateSettings',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.UpdateOsLoginSettingsRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.UpdateOsLoginSettingsRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** OsLogin Profiles */
    getProfile: {
        path: '/yandex.cloud.organizationmanager.v1.OsLoginService/GetProfile',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.GetOsLoginProfileRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.GetOsLoginProfileRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.OsLoginProfile.encode(value).finish()),
        responseDeserialize: (value) => exports.OsLoginProfile.decode(value),
    },
    listProfiles: {
        path: '/yandex.cloud.organizationmanager.v1.OsLoginService/ListProfiles',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.ListOsLoginProfilesRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.ListOsLoginProfilesRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.ListOsLoginProfilesResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.ListOsLoginProfilesResponse.decode(value),
    },
    createProfile: {
        path: '/yandex.cloud.organizationmanager.v1.OsLoginService/CreateProfile',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.CreateOsLoginProfileRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.CreateOsLoginProfileRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    updateProfile: {
        path: '/yandex.cloud.organizationmanager.v1.OsLoginService/UpdateProfile',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.UpdateOsLoginProfileRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.UpdateOsLoginProfileRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Sets a profile as a default for the subject assigned to this profile */
    setDefaultProfile: {
        path: '/yandex.cloud.organizationmanager.v1.OsLoginService/SetDefaultProfile',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.SetDefaultOsLoginProfileRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.SetDefaultOsLoginProfileRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    deleteProfile: {
        path: '/yandex.cloud.organizationmanager.v1.OsLoginService/DeleteProfile',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.DeleteOsLoginProfileRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.DeleteOsLoginProfileRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
};
exports.OsLoginServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.OsLoginServiceService, 'yandex.cloud.organizationmanager.v1.OsLoginService');
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();
}
