UNPKG

@zitadel/node

Version:

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

111 lines (110 loc) 3.94 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.7.5 // protoc unknown // source: zitadel/app/v2beta/api.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export const protobufPackage = "zitadel.app.v2beta"; export var APIAuthMethodType; (function (APIAuthMethodType) { APIAuthMethodType[APIAuthMethodType["API_AUTH_METHOD_TYPE_BASIC"] = 0] = "API_AUTH_METHOD_TYPE_BASIC"; APIAuthMethodType[APIAuthMethodType["API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT"] = 1] = "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT"; APIAuthMethodType[APIAuthMethodType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; })(APIAuthMethodType || (APIAuthMethodType = {})); export function aPIAuthMethodTypeFromJSON(object) { switch (object) { case 0: case "API_AUTH_METHOD_TYPE_BASIC": return APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC; case 1: case "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT": return APIAuthMethodType.API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT; case -1: case "UNRECOGNIZED": default: return APIAuthMethodType.UNRECOGNIZED; } } export function aPIAuthMethodTypeToJSON(object) { switch (object) { case APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC: return "API_AUTH_METHOD_TYPE_BASIC"; case APIAuthMethodType.API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT: return "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT"; case APIAuthMethodType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } function createBaseAPIConfig() { return { clientId: "", authMethodType: 0 }; } export const APIConfig = { encode(message, writer = new BinaryWriter()) { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } if (message.authMethodType !== 0) { writer.uint32(16).int32(message.authMethodType); } 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 = createBaseAPIConfig(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.clientId = reader.string(); continue; } case 2: { if (tag !== 16) { break; } message.authMethodType = reader.int32(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "", authMethodType: isSet(object.authMethodType) ? aPIAuthMethodTypeFromJSON(object.authMethodType) : 0, }; }, toJSON(message) { const obj = {}; if (message.clientId !== "") { obj.clientId = message.clientId; } if (message.authMethodType !== 0) { obj.authMethodType = aPIAuthMethodTypeToJSON(message.authMethodType); } return obj; }, create(base) { return APIConfig.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseAPIConfig(); message.clientId = object.clientId ?? ""; message.authMethodType = object.authMethodType ?? 0; return message; }, }; function isSet(value) { return value !== null && value !== undefined; }