UNPKG

@zitadel/node

Version:

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

633 lines (632 loc) 22 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.7.0 // protoc unknown // source: zitadel/resources/action/v3alpha/execution.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Details } from "../../object/v3alpha/object.js"; export const protobufPackage = "zitadel.resources.action.v3alpha"; function createBaseExecution() { return { targets: [] }; } export const Execution = { encode(message, writer = new BinaryWriter()) { for (const v of message.targets) { ExecutionTargetType.encode(v, writer.uint32(10).fork()).join(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExecution(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.targets.push(ExecutionTargetType.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { targets: globalThis.Array.isArray(object?.targets) ? object.targets.map((e) => ExecutionTargetType.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.targets?.length) { obj.targets = message.targets.map((e) => ExecutionTargetType.toJSON(e)); } return obj; }, create(base) { return Execution.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseExecution(); message.targets = object.targets?.map((e) => ExecutionTargetType.fromPartial(e)) || []; return message; }, }; function createBaseGetExecution() { return { details: undefined, condition: undefined, execution: undefined }; } export const GetExecution = { encode(message, writer = new BinaryWriter()) { if (message.details !== undefined) { Details.encode(message.details, writer.uint32(10).fork()).join(); } if (message.condition !== undefined) { Condition.encode(message.condition, writer.uint32(18).fork()).join(); } if (message.execution !== undefined) { Execution.encode(message.execution, writer.uint32(26).fork()).join(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetExecution(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.details = Details.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.condition = Condition.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.execution = Execution.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined, condition: isSet(object.condition) ? Condition.fromJSON(object.condition) : undefined, execution: isSet(object.execution) ? Execution.fromJSON(object.execution) : undefined, }; }, toJSON(message) { const obj = {}; if (message.details !== undefined) { obj.details = Details.toJSON(message.details); } if (message.condition !== undefined) { obj.condition = Condition.toJSON(message.condition); } if (message.execution !== undefined) { obj.execution = Execution.toJSON(message.execution); } return obj; }, create(base) { return GetExecution.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseGetExecution(); message.details = (object.details !== undefined && object.details !== null) ? Details.fromPartial(object.details) : undefined; message.condition = (object.condition !== undefined && object.condition !== null) ? Condition.fromPartial(object.condition) : undefined; message.execution = (object.execution !== undefined && object.execution !== null) ? Execution.fromPartial(object.execution) : undefined; return message; }, }; function createBaseExecutionTargetType() { return { target: undefined, include: undefined }; } export const ExecutionTargetType = { encode(message, writer = new BinaryWriter()) { if (message.target !== undefined) { writer.uint32(10).string(message.target); } if (message.include !== undefined) { Condition.encode(message.include, writer.uint32(18).fork()).join(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExecutionTargetType(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.target = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.include = Condition.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { target: isSet(object.target) ? globalThis.String(object.target) : undefined, include: isSet(object.include) ? Condition.fromJSON(object.include) : undefined, }; }, toJSON(message) { const obj = {}; if (message.target !== undefined) { obj.target = message.target; } if (message.include !== undefined) { obj.include = Condition.toJSON(message.include); } return obj; }, create(base) { return ExecutionTargetType.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseExecutionTargetType(); message.target = object.target ?? undefined; message.include = (object.include !== undefined && object.include !== null) ? Condition.fromPartial(object.include) : undefined; return message; }, }; function createBaseCondition() { return { request: undefined, response: undefined, function: undefined, event: undefined }; } export const Condition = { encode(message, writer = new BinaryWriter()) { if (message.request !== undefined) { RequestExecution.encode(message.request, writer.uint32(10).fork()).join(); } if (message.response !== undefined) { ResponseExecution.encode(message.response, writer.uint32(18).fork()).join(); } if (message.function !== undefined) { FunctionExecution.encode(message.function, writer.uint32(26).fork()).join(); } if (message.event !== undefined) { EventExecution.encode(message.event, writer.uint32(34).fork()).join(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCondition(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.request = RequestExecution.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.response = ResponseExecution.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.function = FunctionExecution.decode(reader, reader.uint32()); continue; } case 4: { if (tag !== 34) { break; } message.event = EventExecution.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { request: isSet(object.request) ? RequestExecution.fromJSON(object.request) : undefined, response: isSet(object.response) ? ResponseExecution.fromJSON(object.response) : undefined, function: isSet(object.function) ? FunctionExecution.fromJSON(object.function) : undefined, event: isSet(object.event) ? EventExecution.fromJSON(object.event) : undefined, }; }, toJSON(message) { const obj = {}; if (message.request !== undefined) { obj.request = RequestExecution.toJSON(message.request); } if (message.response !== undefined) { obj.response = ResponseExecution.toJSON(message.response); } if (message.function !== undefined) { obj.function = FunctionExecution.toJSON(message.function); } if (message.event !== undefined) { obj.event = EventExecution.toJSON(message.event); } return obj; }, create(base) { return Condition.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseCondition(); message.request = (object.request !== undefined && object.request !== null) ? RequestExecution.fromPartial(object.request) : undefined; message.response = (object.response !== undefined && object.response !== null) ? ResponseExecution.fromPartial(object.response) : undefined; message.function = (object.function !== undefined && object.function !== null) ? FunctionExecution.fromPartial(object.function) : undefined; message.event = (object.event !== undefined && object.event !== null) ? EventExecution.fromPartial(object.event) : undefined; return message; }, }; function createBaseRequestExecution() { return { method: undefined, service: undefined, all: undefined }; } export const RequestExecution = { encode(message, writer = new BinaryWriter()) { if (message.method !== undefined) { writer.uint32(10).string(message.method); } if (message.service !== undefined) { writer.uint32(18).string(message.service); } if (message.all !== undefined) { writer.uint32(24).bool(message.all); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestExecution(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.method = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.service = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.all = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { method: isSet(object.method) ? globalThis.String(object.method) : undefined, service: isSet(object.service) ? globalThis.String(object.service) : undefined, all: isSet(object.all) ? globalThis.Boolean(object.all) : undefined, }; }, toJSON(message) { const obj = {}; if (message.method !== undefined) { obj.method = message.method; } if (message.service !== undefined) { obj.service = message.service; } if (message.all !== undefined) { obj.all = message.all; } return obj; }, create(base) { return RequestExecution.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseRequestExecution(); message.method = object.method ?? undefined; message.service = object.service ?? undefined; message.all = object.all ?? undefined; return message; }, }; function createBaseResponseExecution() { return { method: undefined, service: undefined, all: undefined }; } export const ResponseExecution = { encode(message, writer = new BinaryWriter()) { if (message.method !== undefined) { writer.uint32(10).string(message.method); } if (message.service !== undefined) { writer.uint32(18).string(message.service); } if (message.all !== undefined) { writer.uint32(24).bool(message.all); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseExecution(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.method = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.service = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.all = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { method: isSet(object.method) ? globalThis.String(object.method) : undefined, service: isSet(object.service) ? globalThis.String(object.service) : undefined, all: isSet(object.all) ? globalThis.Boolean(object.all) : undefined, }; }, toJSON(message) { const obj = {}; if (message.method !== undefined) { obj.method = message.method; } if (message.service !== undefined) { obj.service = message.service; } if (message.all !== undefined) { obj.all = message.all; } return obj; }, create(base) { return ResponseExecution.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseResponseExecution(); message.method = object.method ?? undefined; message.service = object.service ?? undefined; message.all = object.all ?? undefined; return message; }, }; function createBaseFunctionExecution() { return { name: "" }; } export const FunctionExecution = { encode(message, writer = new BinaryWriter()) { if (message.name !== "") { writer.uint32(10).string(message.name); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFunctionExecution(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.name = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "" }; }, toJSON(message) { const obj = {}; if (message.name !== "") { obj.name = message.name; } return obj; }, create(base) { return FunctionExecution.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseFunctionExecution(); message.name = object.name ?? ""; return message; }, }; function createBaseEventExecution() { return { event: undefined, group: undefined, all: undefined }; } export const EventExecution = { encode(message, writer = new BinaryWriter()) { if (message.event !== undefined) { writer.uint32(10).string(message.event); } if (message.group !== undefined) { writer.uint32(18).string(message.group); } if (message.all !== undefined) { writer.uint32(24).bool(message.all); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventExecution(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.event = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.group = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.all = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { event: isSet(object.event) ? globalThis.String(object.event) : undefined, group: isSet(object.group) ? globalThis.String(object.group) : undefined, all: isSet(object.all) ? globalThis.Boolean(object.all) : undefined, }; }, toJSON(message) { const obj = {}; if (message.event !== undefined) { obj.event = message.event; } if (message.group !== undefined) { obj.group = message.group; } if (message.all !== undefined) { obj.all = message.all; } return obj; }, create(base) { return EventExecution.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseEventExecution(); message.event = object.event ?? undefined; message.group = object.group ?? undefined; message.all = object.all ?? undefined; return message; }, }; function isSet(value) { return value !== null && value !== undefined; }