@zitadel/node
Version:
Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.
1,420 lines • 175 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.7.5
// protoc unknown
// source: zitadel/project/v2beta/project_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import Long from "long";
import { Timestamp } from "../../../google/protobuf/timestamp.js";
import { PaginationRequest, PaginationResponse } from "../../filter/v2beta/filter.js";
import { privateLabelingSettingFromJSON, privateLabelingSettingToJSON, Project, projectFieldNameFromJSON, projectFieldNameToJSON, ProjectGrant, projectGrantFieldNameFromJSON, projectGrantFieldNameToJSON, ProjectGrantSearchFilter, ProjectRole, projectRoleFieldNameFromJSON, projectRoleFieldNameToJSON, ProjectRoleSearchFilter, ProjectSearchFilter, } from "./query.js";
export const protobufPackage = "zitadel.project.v2beta";
function createBaseCreateProjectRequest() {
return {
organizationId: "",
id: undefined,
name: "",
projectRoleAssertion: false,
authorizationRequired: false,
projectAccessRequired: false,
privateLabelingSetting: 0,
};
}
export const CreateProjectRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.organizationId !== "") {
writer.uint32(10).string(message.organizationId);
}
if (message.id !== undefined) {
writer.uint32(18).string(message.id);
}
if (message.name !== "") {
writer.uint32(26).string(message.name);
}
if (message.projectRoleAssertion !== false) {
writer.uint32(32).bool(message.projectRoleAssertion);
}
if (message.authorizationRequired !== false) {
writer.uint32(40).bool(message.authorizationRequired);
}
if (message.projectAccessRequired !== false) {
writer.uint32(48).bool(message.projectAccessRequired);
}
if (message.privateLabelingSetting !== 0) {
writer.uint32(56).int32(message.privateLabelingSetting);
}
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 = createBaseCreateProjectRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.organizationId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.id = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.name = reader.string();
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.projectRoleAssertion = reader.bool();
continue;
}
case 5: {
if (tag !== 40) {
break;
}
message.authorizationRequired = reader.bool();
continue;
}
case 6: {
if (tag !== 48) {
break;
}
message.projectAccessRequired = reader.bool();
continue;
}
case 7: {
if (tag !== 56) {
break;
}
message.privateLabelingSetting = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
id: isSet(object.id) ? globalThis.String(object.id) : undefined,
name: isSet(object.name) ? globalThis.String(object.name) : "",
projectRoleAssertion: isSet(object.projectRoleAssertion)
? globalThis.Boolean(object.projectRoleAssertion)
: false,
authorizationRequired: isSet(object.authorizationRequired)
? globalThis.Boolean(object.authorizationRequired)
: false,
projectAccessRequired: isSet(object.projectAccessRequired)
? globalThis.Boolean(object.projectAccessRequired)
: false,
privateLabelingSetting: isSet(object.privateLabelingSetting)
? privateLabelingSettingFromJSON(object.privateLabelingSetting)
: 0,
};
},
toJSON(message) {
const obj = {};
if (message.organizationId !== "") {
obj.organizationId = message.organizationId;
}
if (message.id !== undefined) {
obj.id = message.id;
}
if (message.name !== "") {
obj.name = message.name;
}
if (message.projectRoleAssertion !== false) {
obj.projectRoleAssertion = message.projectRoleAssertion;
}
if (message.authorizationRequired !== false) {
obj.authorizationRequired = message.authorizationRequired;
}
if (message.projectAccessRequired !== false) {
obj.projectAccessRequired = message.projectAccessRequired;
}
if (message.privateLabelingSetting !== 0) {
obj.privateLabelingSetting = privateLabelingSettingToJSON(message.privateLabelingSetting);
}
return obj;
},
create(base) {
return CreateProjectRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseCreateProjectRequest();
message.organizationId = object.organizationId ?? "";
message.id = object.id ?? undefined;
message.name = object.name ?? "";
message.projectRoleAssertion = object.projectRoleAssertion ?? false;
message.authorizationRequired = object.authorizationRequired ?? false;
message.projectAccessRequired = object.projectAccessRequired ?? false;
message.privateLabelingSetting = object.privateLabelingSetting ?? 0;
return message;
},
};
function createBaseCreateProjectResponse() {
return { id: "", creationDate: undefined };
}
export const CreateProjectResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.creationDate !== undefined) {
Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(18).fork()).join();
}
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 = createBaseCreateProjectResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.creationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
creationDate: isSet(object.creationDate) ? fromJsonTimestamp(object.creationDate) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.id !== "") {
obj.id = message.id;
}
if (message.creationDate !== undefined) {
obj.creationDate = message.creationDate.toISOString();
}
return obj;
},
create(base) {
return CreateProjectResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseCreateProjectResponse();
message.id = object.id ?? "";
message.creationDate = object.creationDate ?? undefined;
return message;
},
};
function createBaseUpdateProjectRequest() {
return {
id: "",
name: undefined,
projectRoleAssertion: undefined,
projectRoleCheck: undefined,
hasProjectCheck: undefined,
privateLabelingSetting: undefined,
};
}
export const UpdateProjectRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.name !== undefined) {
writer.uint32(18).string(message.name);
}
if (message.projectRoleAssertion !== undefined) {
writer.uint32(24).bool(message.projectRoleAssertion);
}
if (message.projectRoleCheck !== undefined) {
writer.uint32(32).bool(message.projectRoleCheck);
}
if (message.hasProjectCheck !== undefined) {
writer.uint32(40).bool(message.hasProjectCheck);
}
if (message.privateLabelingSetting !== undefined) {
writer.uint32(48).int32(message.privateLabelingSetting);
}
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 = createBaseUpdateProjectRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.name = reader.string();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.projectRoleAssertion = reader.bool();
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.projectRoleCheck = reader.bool();
continue;
}
case 5: {
if (tag !== 40) {
break;
}
message.hasProjectCheck = reader.bool();
continue;
}
case 6: {
if (tag !== 48) {
break;
}
message.privateLabelingSetting = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
projectRoleAssertion: isSet(object.projectRoleAssertion)
? globalThis.Boolean(object.projectRoleAssertion)
: undefined,
projectRoleCheck: isSet(object.projectRoleCheck) ? globalThis.Boolean(object.projectRoleCheck) : undefined,
hasProjectCheck: isSet(object.hasProjectCheck) ? globalThis.Boolean(object.hasProjectCheck) : undefined,
privateLabelingSetting: isSet(object.privateLabelingSetting)
? privateLabelingSettingFromJSON(object.privateLabelingSetting)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.id !== "") {
obj.id = message.id;
}
if (message.name !== undefined) {
obj.name = message.name;
}
if (message.projectRoleAssertion !== undefined) {
obj.projectRoleAssertion = message.projectRoleAssertion;
}
if (message.projectRoleCheck !== undefined) {
obj.projectRoleCheck = message.projectRoleCheck;
}
if (message.hasProjectCheck !== undefined) {
obj.hasProjectCheck = message.hasProjectCheck;
}
if (message.privateLabelingSetting !== undefined) {
obj.privateLabelingSetting = privateLabelingSettingToJSON(message.privateLabelingSetting);
}
return obj;
},
create(base) {
return UpdateProjectRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateProjectRequest();
message.id = object.id ?? "";
message.name = object.name ?? undefined;
message.projectRoleAssertion = object.projectRoleAssertion ?? undefined;
message.projectRoleCheck = object.projectRoleCheck ?? undefined;
message.hasProjectCheck = object.hasProjectCheck ?? undefined;
message.privateLabelingSetting = object.privateLabelingSetting ?? undefined;
return message;
},
};
function createBaseUpdateProjectResponse() {
return { changeDate: undefined };
}
export const UpdateProjectResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.changeDate !== undefined) {
Timestamp.encode(toTimestamp(message.changeDate), writer.uint32(10).fork()).join();
}
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 = createBaseUpdateProjectResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.changeDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { changeDate: isSet(object.changeDate) ? fromJsonTimestamp(object.changeDate) : undefined };
},
toJSON(message) {
const obj = {};
if (message.changeDate !== undefined) {
obj.changeDate = message.changeDate.toISOString();
}
return obj;
},
create(base) {
return UpdateProjectResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateProjectResponse();
message.changeDate = object.changeDate ?? undefined;
return message;
},
};
function createBaseDeleteProjectRequest() {
return { id: "" };
}
export const DeleteProjectRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
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 = createBaseDeleteProjectRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
},
toJSON(message) {
const obj = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj;
},
create(base) {
return DeleteProjectRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteProjectRequest();
message.id = object.id ?? "";
return message;
},
};
function createBaseDeleteProjectResponse() {
return { deletionDate: undefined };
}
export const DeleteProjectResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.deletionDate !== undefined) {
Timestamp.encode(toTimestamp(message.deletionDate), writer.uint32(26).fork()).join();
}
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 = createBaseDeleteProjectResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 3: {
if (tag !== 26) {
break;
}
message.deletionDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { deletionDate: isSet(object.deletionDate) ? fromJsonTimestamp(object.deletionDate) : undefined };
},
toJSON(message) {
const obj = {};
if (message.deletionDate !== undefined) {
obj.deletionDate = message.deletionDate.toISOString();
}
return obj;
},
create(base) {
return DeleteProjectResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteProjectResponse();
message.deletionDate = object.deletionDate ?? undefined;
return message;
},
};
function createBaseGetProjectRequest() {
return { id: "" };
}
export const GetProjectRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
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 = createBaseGetProjectRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
},
toJSON(message) {
const obj = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj;
},
create(base) {
return GetProjectRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetProjectRequest();
message.id = object.id ?? "";
return message;
},
};
function createBaseGetProjectResponse() {
return { project: undefined };
}
export const GetProjectResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.project !== undefined) {
Project.encode(message.project, writer.uint32(10).fork()).join();
}
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 = createBaseGetProjectResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.project = Project.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { project: isSet(object.project) ? Project.fromJSON(object.project) : undefined };
},
toJSON(message) {
const obj = {};
if (message.project !== undefined) {
obj.project = Project.toJSON(message.project);
}
return obj;
},
create(base) {
return GetProjectResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetProjectResponse();
message.project = (object.project !== undefined && object.project !== null)
? Project.fromPartial(object.project)
: undefined;
return message;
},
};
function createBaseListProjectsRequest() {
return { pagination: undefined, sortingColumn: undefined, filters: [] };
}
export const ListProjectsRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.pagination !== undefined) {
PaginationRequest.encode(message.pagination, writer.uint32(10).fork()).join();
}
if (message.sortingColumn !== undefined) {
writer.uint32(16).int32(message.sortingColumn);
}
for (const v of message.filters) {
ProjectSearchFilter.encode(v, writer.uint32(26).fork()).join();
}
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 = createBaseListProjectsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.pagination = PaginationRequest.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.sortingColumn = reader.int32();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.filters.push(ProjectSearchFilter.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
sortingColumn: isSet(object.sortingColumn) ? projectFieldNameFromJSON(object.sortingColumn) : undefined,
filters: globalThis.Array.isArray(object?.filters)
? object.filters.map((e) => ProjectSearchFilter.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.pagination !== undefined) {
obj.pagination = PaginationRequest.toJSON(message.pagination);
}
if (message.sortingColumn !== undefined) {
obj.sortingColumn = projectFieldNameToJSON(message.sortingColumn);
}
if (message.filters?.length) {
obj.filters = message.filters.map((e) => ProjectSearchFilter.toJSON(e));
}
return obj;
},
create(base) {
return ListProjectsRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListProjectsRequest();
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationRequest.fromPartial(object.pagination)
: undefined;
message.sortingColumn = object.sortingColumn ?? undefined;
message.filters = object.filters?.map((e) => ProjectSearchFilter.fromPartial(e)) || [];
return message;
},
};
function createBaseListProjectsResponse() {
return { pagination: undefined, projects: [] };
}
export const ListProjectsResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.pagination !== undefined) {
PaginationResponse.encode(message.pagination, writer.uint32(10).fork()).join();
}
for (const v of message.projects) {
Project.encode(v, writer.uint32(18).fork()).join();
}
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 = createBaseListProjectsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.pagination = PaginationResponse.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.projects.push(Project.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
projects: globalThis.Array.isArray(object?.projects) ? object.projects.map((e) => Project.fromJSON(e)) : [],
};
},
toJSON(message) {
const obj = {};
if (message.pagination !== undefined) {
obj.pagination = PaginationResponse.toJSON(message.pagination);
}
if (message.projects?.length) {
obj.projects = message.projects.map((e) => Project.toJSON(e));
}
return obj;
},
create(base) {
return ListProjectsResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListProjectsResponse();
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationResponse.fromPartial(object.pagination)
: undefined;
message.projects = object.projects?.map((e) => Project.fromPartial(e)) || [];
return message;
},
};
function createBaseDeactivateProjectRequest() {
return { id: "" };
}
export const DeactivateProjectRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
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 = createBaseDeactivateProjectRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
},
toJSON(message) {
const obj = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj;
},
create(base) {
return DeactivateProjectRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeactivateProjectRequest();
message.id = object.id ?? "";
return message;
},
};
function createBaseDeactivateProjectResponse() {
return { changeDate: undefined };
}
export const DeactivateProjectResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.changeDate !== undefined) {
Timestamp.encode(toTimestamp(message.changeDate), writer.uint32(10).fork()).join();
}
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 = createBaseDeactivateProjectResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.changeDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { changeDate: isSet(object.changeDate) ? fromJsonTimestamp(object.changeDate) : undefined };
},
toJSON(message) {
const obj = {};
if (message.changeDate !== undefined) {
obj.changeDate = message.changeDate.toISOString();
}
return obj;
},
create(base) {
return DeactivateProjectResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeactivateProjectResponse();
message.changeDate = object.changeDate ?? undefined;
return message;
},
};
function createBaseActivateProjectRequest() {
return { id: "" };
}
export const ActivateProjectRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
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 = createBaseActivateProjectRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
},
toJSON(message) {
const obj = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj;
},
create(base) {
return ActivateProjectRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseActivateProjectRequest();
message.id = object.id ?? "";
return message;
},
};
function createBaseActivateProjectResponse() {
return { changeDate: undefined };
}
export const ActivateProjectResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.changeDate !== undefined) {
Timestamp.encode(toTimestamp(message.changeDate), writer.uint32(10).fork()).join();
}
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 = createBaseActivateProjectResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.changeDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { changeDate: isSet(object.changeDate) ? fromJsonTimestamp(object.changeDate) : undefined };
},
toJSON(message) {
const obj = {};
if (message.changeDate !== undefined) {
obj.changeDate = message.changeDate.toISOString();
}
return obj;
},
create(base) {
return ActivateProjectResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseActivateProjectResponse();
message.changeDate = object.changeDate ?? undefined;
return message;
},
};
function createBaseAddProjectRoleRequest() {
return { projectId: "", roleKey: "", displayName: "", group: undefined };
}
export const AddProjectRoleRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.projectId !== "") {
writer.uint32(10).string(message.projectId);
}
if (message.roleKey !== "") {
writer.uint32(18).string(message.roleKey);
}
if (message.displayName !== "") {
writer.uint32(26).string(message.displayName);
}
if (message.group !== undefined) {
writer.uint32(34).string(message.group);
}
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 = createBaseAddProjectRoleRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.projectId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.roleKey = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.displayName = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.group = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "",
roleKey: isSet(object.roleKey) ? globalThis.String(object.roleKey) : "",
displayName: isSet(object.displayName) ? globalThis.String(object.displayName) : "",
group: isSet(object.group) ? globalThis.String(object.group) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.projectId !== "") {
obj.projectId = message.projectId;
}
if (message.roleKey !== "") {
obj.roleKey = message.roleKey;
}
if (message.displayName !== "") {
obj.displayName = message.displayName;
}
if (message.group !== undefined) {
obj.group = message.group;
}
return obj;
},
create(base) {
return AddProjectRoleRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddProjectRoleRequest();
message.projectId = object.projectId ?? "";
message.roleKey = object.roleKey ?? "";
message.displayName = object.displayName ?? "";
message.group = object.group ?? undefined;
return message;
},
};
function createBaseAddProjectRoleResponse() {
return { creationDate: undefined };
}
export const AddProjectRoleResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.creationDate !== undefined) {
Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(18).fork()).join();
}
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 = createBaseAddProjectRoleResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2: {
if (tag !== 18) {
break;
}
message.creationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { creationDate: isSet(object.creationDate) ? fromJsonTimestamp(object.creationDate) : undefined };
},
toJSON(message) {
const obj = {};
if (message.creationDate !== undefined) {
obj.creationDate = message.creationDate.toISOString();
}
return obj;
},
create(base) {
return AddProjectRoleResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddProjectRoleResponse();
message.creationDate = object.creationDate ?? undefined;
return message;
},
};
function createBaseUpdateProjectRoleRequest() {
return { projectId: "", roleKey: "", displayName: undefined, group: undefined };
}
export const UpdateProjectRoleRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.projectId !== "") {
writer.uint32(10).string(message.projectId);
}
if (message.roleKey !== "") {
writer.uint32(18).string(message.roleKey);
}
if (message.displayName !== undefined) {
writer.uint32(26).string(message.displayName);
}
if (message.group !== undefined) {
writer.uint32(34).string(message.group);
}
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 = createBaseUpdateProjectRoleRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.projectId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.roleKey = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.displayName = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.group = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "",
roleKey: isSet(object.roleKey) ? globalThis.String(object.roleKey) : "",
displayName: isSet(object.displayName) ? globalThis.String(object.displayName) : undefined,
group: isSet(object.group) ? globalThis.String(object.group) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.projectId !== "") {
obj.projectId = message.projectId;
}
if (message.roleKey !== "") {
obj.roleKey = message.roleKey;
}
if (message.displayName !== undefined) {
obj.displayName = message.displayName;
}
if (message.group !== undefined) {
obj.group = message.group;
}
return obj;
},
create(base) {
return UpdateProjectRoleRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateProjectRoleRequest();
message.projectId = object.projectId ?? "";
message.roleKey = object.roleKey ?? "";
message.displayName = object.displayName ?? undefined;
message.group = object.group ?? undefined;
return message;
},
};
function createBaseUpdateProjectRoleResponse() {
return { changeDate: undefined };
}
export const UpdateProjectRoleResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.changeDate !== undefined) {
Timestamp.encode(toTimestamp(message.changeDate), writer.uint32(10).fork()).join();
}
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 = createBaseUpdateProjectRoleResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.changeDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { changeDate: isSet(object.changeDate) ? fromJsonTimestamp(object.changeDate) : undefined };
},
toJSON(message) {
const obj = {};
if (message.changeDate !== undefined) {
obj.changeDate = message.changeDate.toISOString();
}
return obj;
},
create(base) {
return UpdateProjectRoleResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateProjectRoleResponse();
message.changeDate = object.changeDate ?? undefined;
return message;
},
};
function createBaseRemoveProjectRoleRequest() {
return { projectId: "", roleKey: "" };
}
export const RemoveProjectRoleRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.projectId !== "") {
writer.uint32(10).string(message.projectId);
}
if (message.roleKey !== "") {
writer.uint32(18).string(message.roleKey);
}
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 = createBaseRemoveProjectRoleRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.projectId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.roleKey = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "",
roleKey: isSet(object.roleKey) ? globalThis.String(object.roleKey) : "",
};
},
toJSON(message) {
const obj = {};
if (message.projectId !== "") {
obj.projectId = message.projectId;
}
if (message.roleKey !== "") {
obj.roleKey = message.roleKey;
}
return obj;
},
create(base) {
return RemoveProjectRoleRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveProjectRoleRequest();
message.projectId = object.projectId ?? "";
message.roleKey = object.roleKey ?? "";
return message;
},
};
function createBaseRemoveProjectRoleResponse() {
return { removalDate: undefined };
}
export const RemoveProjectRoleResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.removalDate !== undefined) {
Timestamp.encode(toTimestamp(message.removalDate), writer.uint32(26).fork()).join();
}
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 = createBaseRemoveProjectRoleResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 3: {
if (tag !== 26) {
break;
}
message.removalDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { removalDate: isSet(object.removalDate) ? fromJsonTimestamp(object.removalDate) : undefined };
},
toJSON(message) {
const obj = {};
if (message.removalDate !== undefined) {
obj.removalDate = message.removalDate.toISOString();
}
return obj;
},
create(base) {
return RemoveProjectRoleResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveProjectRoleResponse();
message.removalDate = object.removalDate ?? undefined;
return message;
},
};
function createBaseListProjectRolesRequest() {
return { projectId: "", pagination: undefined, sortingColumn: undefined, filters: [] };
}
export const ListProjectRolesRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.projectId !== "") {
writer.uint32(10).string(message.projectI