@zitadel/node
Version:
Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.
80 lines (79 loc) • 2.62 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.7.7
// protoc unknown
// source: zitadel/options.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "zitadel.v1";
function createBaseAuthOption() {
return { permission: "", checkFieldName: "" };
}
export const AuthOption = {
encode(message, writer = new BinaryWriter()) {
if (message.permission !== "") {
writer.uint32(10).string(message.permission);
}
if (message.checkFieldName !== "") {
writer.uint32(18).string(message.checkFieldName);
}
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 = createBaseAuthOption();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.permission = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.checkFieldName = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
permission: isSet(object.permission) ? globalThis.String(object.permission) : "",
checkFieldName: isSet(object.checkFieldName) ? globalThis.String(object.checkFieldName) : "",
};
},
toJSON(message) {
const obj = {};
if (message.permission !== "") {
obj.permission = message.permission;
}
if (message.checkFieldName !== "") {
obj.checkFieldName = message.checkFieldName;
}
return obj;
},
create(base) {
return AuthOption.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAuthOption();
message.permission = object.permission ?? "";
message.checkFieldName = object.checkFieldName ?? "";
return message;
},
};
function isSet(value) {
return value !== null && value !== undefined;
}