@zitadel/node
Version:
Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.
1,409 lines (1,408 loc) • 88.9 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.7.5
// protoc unknown
// source: zitadel/instance/v2beta/instance_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 { Domain, domainFieldNameFromJSON, domainFieldNameToJSON, DomainSearchQuery, fieldNameFromJSON, fieldNameToJSON, Instance, Query, TrustedDomain, trustedDomainFieldNameFromJSON, trustedDomainFieldNameToJSON, TrustedDomainSearchQuery, } from "./instance.js";
export const protobufPackage = "zitadel.instance.v2beta";
function createBaseDeleteInstanceRequest() {
return { instanceId: "" };
}
export const DeleteInstanceRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
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 = createBaseDeleteInstanceRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "" };
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
return obj;
},
create(base) {
return DeleteInstanceRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteInstanceRequest();
message.instanceId = object.instanceId ?? "";
return message;
},
};
function createBaseDeleteInstanceResponse() {
return { deletionDate: undefined };
}
export const DeleteInstanceResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.deletionDate !== undefined) {
Timestamp.encode(toTimestamp(message.deletionDate), 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 = createBaseDeleteInstanceResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
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 DeleteInstanceResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteInstanceResponse();
message.deletionDate = object.deletionDate ?? undefined;
return message;
},
};
function createBaseGetInstanceRequest() {
return { instanceId: "" };
}
export const GetInstanceRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
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 = createBaseGetInstanceRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "" };
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
return obj;
},
create(base) {
return GetInstanceRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetInstanceRequest();
message.instanceId = object.instanceId ?? "";
return message;
},
};
function createBaseGetInstanceResponse() {
return { instance: undefined };
}
export const GetInstanceResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.instance !== undefined) {
Instance.encode(message.instance, 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 = createBaseGetInstanceResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instance = Instance.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined };
},
toJSON(message) {
const obj = {};
if (message.instance !== undefined) {
obj.instance = Instance.toJSON(message.instance);
}
return obj;
},
create(base) {
return GetInstanceResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetInstanceResponse();
message.instance = (object.instance !== undefined && object.instance !== null)
? Instance.fromPartial(object.instance)
: undefined;
return message;
},
};
function createBaseUpdateInstanceRequest() {
return { instanceId: "", instanceName: "" };
}
export const UpdateInstanceRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.instanceName !== "") {
writer.uint32(18).string(message.instanceName);
}
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 = createBaseUpdateInstanceRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.instanceName = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
instanceName: isSet(object.instanceName) ? globalThis.String(object.instanceName) : "",
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.instanceName !== "") {
obj.instanceName = message.instanceName;
}
return obj;
},
create(base) {
return UpdateInstanceRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateInstanceRequest();
message.instanceId = object.instanceId ?? "";
message.instanceName = object.instanceName ?? "";
return message;
},
};
function createBaseUpdateInstanceResponse() {
return { changeDate: undefined };
}
export const UpdateInstanceResponse = {
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 = createBaseUpdateInstanceResponse();
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 UpdateInstanceResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateInstanceResponse();
message.changeDate = object.changeDate ?? undefined;
return message;
},
};
function createBaseListInstancesRequest() {
return { queries: [], pagination: undefined, sortingColumn: undefined };
}
export const ListInstancesRequest = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.queries) {
Query.encode(v, writer.uint32(10).fork()).join();
}
if (message.pagination !== undefined) {
PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
}
if (message.sortingColumn !== undefined) {
writer.uint32(24).int32(message.sortingColumn);
}
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 = createBaseListInstancesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.queries.push(Query.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = PaginationRequest.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.sortingColumn = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e) => Query.fromJSON(e)) : [],
pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
sortingColumn: isSet(object.sortingColumn) ? fieldNameFromJSON(object.sortingColumn) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.queries?.length) {
obj.queries = message.queries.map((e) => Query.toJSON(e));
}
if (message.pagination !== undefined) {
obj.pagination = PaginationRequest.toJSON(message.pagination);
}
if (message.sortingColumn !== undefined) {
obj.sortingColumn = fieldNameToJSON(message.sortingColumn);
}
return obj;
},
create(base) {
return ListInstancesRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListInstancesRequest();
message.queries = object.queries?.map((e) => Query.fromPartial(e)) || [];
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationRequest.fromPartial(object.pagination)
: undefined;
message.sortingColumn = object.sortingColumn ?? undefined;
return message;
},
};
function createBaseListInstancesResponse() {
return { instances: [], pagination: undefined };
}
export const ListInstancesResponse = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.instances) {
Instance.encode(v, writer.uint32(10).fork()).join();
}
if (message.pagination !== undefined) {
PaginationResponse.encode(message.pagination, 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 = createBaseListInstancesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instances.push(Instance.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = PaginationResponse.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instances: globalThis.Array.isArray(object?.instances)
? object.instances.map((e) => Instance.fromJSON(e))
: [],
pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.instances?.length) {
obj.instances = message.instances.map((e) => Instance.toJSON(e));
}
if (message.pagination !== undefined) {
obj.pagination = PaginationResponse.toJSON(message.pagination);
}
return obj;
},
create(base) {
return ListInstancesResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListInstancesResponse();
message.instances = object.instances?.map((e) => Instance.fromPartial(e)) || [];
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationResponse.fromPartial(object.pagination)
: undefined;
return message;
},
};
function createBaseAddCustomDomainRequest() {
return { instanceId: "", domain: "" };
}
export const AddCustomDomainRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.domain !== "") {
writer.uint32(18).string(message.domain);
}
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 = createBaseAddCustomDomainRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.domain = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.domain !== "") {
obj.domain = message.domain;
}
return obj;
},
create(base) {
return AddCustomDomainRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddCustomDomainRequest();
message.instanceId = object.instanceId ?? "";
message.domain = object.domain ?? "";
return message;
},
};
function createBaseAddCustomDomainResponse() {
return { creationDate: undefined };
}
export const AddCustomDomainResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.creationDate !== undefined) {
Timestamp.encode(toTimestamp(message.creationDate), 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 = createBaseAddCustomDomainResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
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 AddCustomDomainResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddCustomDomainResponse();
message.creationDate = object.creationDate ?? undefined;
return message;
},
};
function createBaseRemoveCustomDomainRequest() {
return { instanceId: "", domain: "" };
}
export const RemoveCustomDomainRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.domain !== "") {
writer.uint32(18).string(message.domain);
}
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 = createBaseRemoveCustomDomainRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.domain = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.domain !== "") {
obj.domain = message.domain;
}
return obj;
},
create(base) {
return RemoveCustomDomainRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveCustomDomainRequest();
message.instanceId = object.instanceId ?? "";
message.domain = object.domain ?? "";
return message;
},
};
function createBaseRemoveCustomDomainResponse() {
return { deletionDate: undefined };
}
export const RemoveCustomDomainResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.deletionDate !== undefined) {
Timestamp.encode(toTimestamp(message.deletionDate), 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 = createBaseRemoveCustomDomainResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
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 RemoveCustomDomainResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveCustomDomainResponse();
message.deletionDate = object.deletionDate ?? undefined;
return message;
},
};
function createBaseListCustomDomainsRequest() {
return { instanceId: "", pagination: undefined, sortingColumn: 0, queries: [] };
}
export const ListCustomDomainsRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.pagination !== undefined) {
PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
}
if (message.sortingColumn !== 0) {
writer.uint32(24).int32(message.sortingColumn);
}
for (const v of message.queries) {
DomainSearchQuery.encode(v, writer.uint32(34).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 = createBaseListCustomDomainsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = PaginationRequest.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.sortingColumn = reader.int32();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.queries.push(DomainSearchQuery.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
sortingColumn: isSet(object.sortingColumn) ? domainFieldNameFromJSON(object.sortingColumn) : 0,
queries: globalThis.Array.isArray(object?.queries)
? object.queries.map((e) => DomainSearchQuery.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.pagination !== undefined) {
obj.pagination = PaginationRequest.toJSON(message.pagination);
}
if (message.sortingColumn !== 0) {
obj.sortingColumn = domainFieldNameToJSON(message.sortingColumn);
}
if (message.queries?.length) {
obj.queries = message.queries.map((e) => DomainSearchQuery.toJSON(e));
}
return obj;
},
create(base) {
return ListCustomDomainsRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListCustomDomainsRequest();
message.instanceId = object.instanceId ?? "";
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationRequest.fromPartial(object.pagination)
: undefined;
message.sortingColumn = object.sortingColumn ?? 0;
message.queries = object.queries?.map((e) => DomainSearchQuery.fromPartial(e)) || [];
return message;
},
};
function createBaseListCustomDomainsResponse() {
return { domains: [], pagination: undefined };
}
export const ListCustomDomainsResponse = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.domains) {
Domain.encode(v, writer.uint32(10).fork()).join();
}
if (message.pagination !== undefined) {
PaginationResponse.encode(message.pagination, 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 = createBaseListCustomDomainsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.domains.push(Domain.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = PaginationResponse.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
domains: globalThis.Array.isArray(object?.domains) ? object.domains.map((e) => Domain.fromJSON(e)) : [],
pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.domains?.length) {
obj.domains = message.domains.map((e) => Domain.toJSON(e));
}
if (message.pagination !== undefined) {
obj.pagination = PaginationResponse.toJSON(message.pagination);
}
return obj;
},
create(base) {
return ListCustomDomainsResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListCustomDomainsResponse();
message.domains = object.domains?.map((e) => Domain.fromPartial(e)) || [];
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationResponse.fromPartial(object.pagination)
: undefined;
return message;
},
};
function createBaseAddTrustedDomainRequest() {
return { instanceId: "", domain: "" };
}
export const AddTrustedDomainRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.domain !== "") {
writer.uint32(18).string(message.domain);
}
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 = createBaseAddTrustedDomainRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.domain = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.domain !== "") {
obj.domain = message.domain;
}
return obj;
},
create(base) {
return AddTrustedDomainRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddTrustedDomainRequest();
message.instanceId = object.instanceId ?? "";
message.domain = object.domain ?? "";
return message;
},
};
function createBaseAddTrustedDomainResponse() {
return { creationDate: undefined };
}
export const AddTrustedDomainResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.creationDate !== undefined) {
Timestamp.encode(toTimestamp(message.creationDate), 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 = createBaseAddTrustedDomainResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
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 AddTrustedDomainResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddTrustedDomainResponse();
message.creationDate = object.creationDate ?? undefined;
return message;
},
};
function createBaseRemoveTrustedDomainRequest() {
return { instanceId: "", domain: "" };
}
export const RemoveTrustedDomainRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.domain !== "") {
writer.uint32(18).string(message.domain);
}
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 = createBaseRemoveTrustedDomainRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.domain = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.domain !== "") {
obj.domain = message.domain;
}
return obj;
},
create(base) {
return RemoveTrustedDomainRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveTrustedDomainRequest();
message.instanceId = object.instanceId ?? "";
message.domain = object.domain ?? "";
return message;
},
};
function createBaseRemoveTrustedDomainResponse() {
return { deletionDate: undefined };
}
export const RemoveTrustedDomainResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.deletionDate !== undefined) {
Timestamp.encode(toTimestamp(message.deletionDate), 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 = createBaseRemoveTrustedDomainResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
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 RemoveTrustedDomainResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveTrustedDomainResponse();
message.deletionDate = object.deletionDate ?? undefined;
return message;
},
};
function createBaseListTrustedDomainsRequest() {
return { instanceId: "", pagination: undefined, sortingColumn: 0, queries: [] };
}
export const ListTrustedDomainsRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.pagination !== undefined) {
PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
}
if (message.sortingColumn !== 0) {
writer.uint32(24).int32(message.sortingColumn);
}
for (const v of message.queries) {
TrustedDomainSearchQuery.encode(v, writer.uint32(34).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 = createBaseListTrustedDomainsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = PaginationRequest.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.sortingColumn = reader.int32();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.queries.push(TrustedDomainSearchQuery.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
sortingColumn: isSet(object.sortingColumn) ? trustedDomainFieldNameFromJSON(object.sortingColumn) : 0,
queries: globalThis.Array.isArray(object?.queries)
? object.queries.map((e) => TrustedDomainSearchQuery.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.pagination !== undefined) {
obj.pagination = PaginationRequest.toJSON(message.pagination);
}
if (message.sortingColumn !== 0) {
obj.sortingColumn = trustedDomainFieldNameToJSON(message.sortingColumn);
}
if (message.queries?.length) {
obj.queries = message.queries.map((e) => TrustedDomainSearchQuery.toJSON(e));
}
return obj;
},
create(base) {
return ListTrustedDomainsRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListTrustedDomainsRequest();
message.instanceId = object.instanceId ?? "";
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationRequest.fromPartial(object.pagination)
: undefined;
message.sortingColumn = object.sortingColumn ?? 0;
message.queries = object.queries?.map((e) => TrustedDomainSearchQuery.fromPartial(e)) || [];
return message;
},
};
function createBaseListTrustedDomainsResponse() {
return { trustedDomain: [], pagination: undefined };
}
export const ListTrustedDomainsResponse = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.trustedDomain) {
TrustedDomain.encode(v, writer.uint32(10).fork()).join();
}
if (message.pagination !== undefined) {
PaginationResponse.encode(message.pagination, 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 = createBaseListTrustedDomainsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.trustedDomain.push(TrustedDomain.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = PaginationResponse.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
trustedDomain: globalThis.Array.isArray(object?.trustedDomain)
? object.trustedDomain.map((e) => TrustedDomain.fromJSON(e))
: [],
pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.trustedDomain?.length) {
obj.trustedDomain = message.trustedDomain.map((e) => TrustedDomain.toJSON(e));
}
if (message.pagination !== undefined) {
obj.pagination = PaginationResponse.toJSON(message.pagination);
}
return obj;
},
create(base) {
return ListTrustedDomainsResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListTrustedDomainsResponse();
message.trustedDomain = object.trustedDomain?.map((e) => TrustedDomain.fromPartial(e)) || [];
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationResponse.fromPartial(object.pagination)
: undefined;
return message;
},
};
export const InstanceServiceDefinition = {
name: "InstanceService",
fullName: "zitadel.instance.v2beta.InstanceService",
methods: {
/**
* Delete Instance
*
* Deletes an instance with the given ID.
*
* Required permissions:
* - `system.instance.delete`
*/
deleteInstance: {
name: "DeleteInstance",
requestType: DeleteInstanceRequest,
requestStream: false,
responseType: DeleteInstanceResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
32,
74,
30,
10,
3,
50,
48,
48,
18,
23,
10,
21,
84,
104,
101,
32,
100,
101,
108,
101,
116,
101,
100,
32,
105,
110,
115,
116,
97,
110,
99,
101,
46,
]),
],
400010: [
Buffer.from([
26,
10,
24,
10,
22,
115,
121,
115,
116,
101,
109,
46,
105,
110,
115,
116,
97,
110,
99,
101,
46,
100,
101,
108,
101,
116,
101,
]),
],
578365826: [
Buffer.from([
33,
42,