UNPKG

@zitadel/node

Version:

Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.

101 lines (100 loc) 4.07 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.7.7 // protoc unknown // source: zitadel/settings/v2/lockout_settings.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import Long from "long"; import { resourceOwnerTypeFromJSON, resourceOwnerTypeToJSON } from "./settings.js"; export const protobufPackage = "zitadel.settings.v2"; function createBaseLockoutSettings() { return { maxPasswordAttempts: Long.UZERO, resourceOwnerType: 0, maxOtpAttempts: Long.UZERO }; } export const LockoutSettings = { encode(message, writer = new BinaryWriter()) { if (!message.maxPasswordAttempts.equals(Long.UZERO)) { writer.uint32(8).uint64(message.maxPasswordAttempts.toString()); } if (message.resourceOwnerType !== 0) { writer.uint32(16).int32(message.resourceOwnerType); } if (!message.maxOtpAttempts.equals(Long.UZERO)) { writer.uint32(24).uint64(message.maxOtpAttempts.toString()); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLockoutSettings(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.maxPasswordAttempts = Long.fromString(reader.uint64().toString(), true); continue; } case 2: { if (tag !== 16) { break; } message.resourceOwnerType = reader.int32(); continue; } case 3: { if (tag !== 24) { break; } message.maxOtpAttempts = Long.fromString(reader.uint64().toString(), true); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { maxPasswordAttempts: isSet(object.maxPasswordAttempts) ? Long.fromValue(object.maxPasswordAttempts) : Long.UZERO, resourceOwnerType: isSet(object.resourceOwnerType) ? resourceOwnerTypeFromJSON(object.resourceOwnerType) : 0, maxOtpAttempts: isSet(object.maxOtpAttempts) ? Long.fromValue(object.maxOtpAttempts) : Long.UZERO, }; }, toJSON(message) { const obj = {}; if (!message.maxPasswordAttempts.equals(Long.UZERO)) { obj.maxPasswordAttempts = (message.maxPasswordAttempts || Long.UZERO).toString(); } if (message.resourceOwnerType !== 0) { obj.resourceOwnerType = resourceOwnerTypeToJSON(message.resourceOwnerType); } if (!message.maxOtpAttempts.equals(Long.UZERO)) { obj.maxOtpAttempts = (message.maxOtpAttempts || Long.UZERO).toString(); } return obj; }, create(base) { return LockoutSettings.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseLockoutSettings(); message.maxPasswordAttempts = (object.maxPasswordAttempts !== undefined && object.maxPasswordAttempts !== null) ? Long.fromValue(object.maxPasswordAttempts) : Long.UZERO; message.resourceOwnerType = object.resourceOwnerType ?? 0; message.maxOtpAttempts = (object.maxOtpAttempts !== undefined && object.maxOtpAttempts !== null) ? Long.fromValue(object.maxOtpAttempts) : Long.UZERO; return message; }, }; function isSet(value) { return value !== null && value !== undefined; }