@zitadel/node
Version:
Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.
1,893 lines • 64.3 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.7.5
// protoc unknown
// source: zitadel/authorization/v2beta/authorization_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 { Authorization, authorizationFieldNameFromJSON, authorizationFieldNameToJSON, AuthorizationsSearchFilter, } from "./authorization.js";
export const protobufPackage = "zitadel.authorization.v2beta";
function createBaseListAuthorizationsRequest() {
return { pagination: undefined, sortingColumn: undefined, filters: [] };
}
export const ListAuthorizationsRequest = {
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) {
AuthorizationsSearchFilter.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 = createBaseListAuthorizationsRequest();
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(AuthorizationsSearchFilter.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) ? authorizationFieldNameFromJSON(object.sortingColumn) : undefined,
filters: globalThis.Array.isArray(object?.filters)
? object.filters.map((e) => AuthorizationsSearchFilter.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.pagination !== undefined) {
obj.pagination = PaginationRequest.toJSON(message.pagination);
}
if (message.sortingColumn !== undefined) {
obj.sortingColumn = authorizationFieldNameToJSON(message.sortingColumn);
}
if (message.filters?.length) {
obj.filters = message.filters.map((e) => AuthorizationsSearchFilter.toJSON(e));
}
return obj;
},
create(base) {
return ListAuthorizationsRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListAuthorizationsRequest();
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationRequest.fromPartial(object.pagination)
: undefined;
message.sortingColumn = object.sortingColumn ?? undefined;
message.filters = object.filters?.map((e) => AuthorizationsSearchFilter.fromPartial(e)) || [];
return message;
},
};
function createBaseListAuthorizationsResponse() {
return { pagination: undefined, authorizations: [] };
}
export const ListAuthorizationsResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.pagination !== undefined) {
PaginationResponse.encode(message.pagination, writer.uint32(10).fork()).join();
}
for (const v of message.authorizations) {
Authorization.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 = createBaseListAuthorizationsResponse();
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.authorizations.push(Authorization.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,
authorizations: globalThis.Array.isArray(object?.authorizations)
? object.authorizations.map((e) => Authorization.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.pagination !== undefined) {
obj.pagination = PaginationResponse.toJSON(message.pagination);
}
if (message.authorizations?.length) {
obj.authorizations = message.authorizations.map((e) => Authorization.toJSON(e));
}
return obj;
},
create(base) {
return ListAuthorizationsResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListAuthorizationsResponse();
message.pagination = (object.pagination !== undefined && object.pagination !== null)
? PaginationResponse.fromPartial(object.pagination)
: undefined;
message.authorizations = object.authorizations?.map((e) => Authorization.fromPartial(e)) || [];
return message;
},
};
function createBaseCreateAuthorizationRequest() {
return { userId: "", projectId: "", organizationId: undefined, roleKeys: [] };
}
export const CreateAuthorizationRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.userId !== "") {
writer.uint32(10).string(message.userId);
}
if (message.projectId !== "") {
writer.uint32(18).string(message.projectId);
}
if (message.organizationId !== undefined) {
writer.uint32(26).string(message.organizationId);
}
for (const v of message.roleKeys) {
writer.uint32(34).string(v);
}
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 = createBaseCreateAuthorizationRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.userId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.projectId = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.organizationId = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.roleKeys.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "",
organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : undefined,
roleKeys: globalThis.Array.isArray(object?.roleKeys) ? object.roleKeys.map((e) => globalThis.String(e)) : [],
};
},
toJSON(message) {
const obj = {};
if (message.userId !== "") {
obj.userId = message.userId;
}
if (message.projectId !== "") {
obj.projectId = message.projectId;
}
if (message.organizationId !== undefined) {
obj.organizationId = message.organizationId;
}
if (message.roleKeys?.length) {
obj.roleKeys = message.roleKeys;
}
return obj;
},
create(base) {
return CreateAuthorizationRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseCreateAuthorizationRequest();
message.userId = object.userId ?? "";
message.projectId = object.projectId ?? "";
message.organizationId = object.organizationId ?? undefined;
message.roleKeys = object.roleKeys?.map((e) => e) || [];
return message;
},
};
function createBaseCreateAuthorizationResponse() {
return { id: "", creationDate: undefined };
}
export const CreateAuthorizationResponse = {
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 = createBaseCreateAuthorizationResponse();
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 CreateAuthorizationResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseCreateAuthorizationResponse();
message.id = object.id ?? "";
message.creationDate = object.creationDate ?? undefined;
return message;
},
};
function createBaseUpdateAuthorizationRequest() {
return { id: "", roleKeys: [] };
}
export const UpdateAuthorizationRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
for (const v of message.roleKeys) {
writer.uint32(18).string(v);
}
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 = createBaseUpdateAuthorizationRequest();
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.roleKeys.push(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) : "",
roleKeys: globalThis.Array.isArray(object?.roleKeys) ? object.roleKeys.map((e) => globalThis.String(e)) : [],
};
},
toJSON(message) {
const obj = {};
if (message.id !== "") {
obj.id = message.id;
}
if (message.roleKeys?.length) {
obj.roleKeys = message.roleKeys;
}
return obj;
},
create(base) {
return UpdateAuthorizationRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateAuthorizationRequest();
message.id = object.id ?? "";
message.roleKeys = object.roleKeys?.map((e) => e) || [];
return message;
},
};
function createBaseUpdateAuthorizationResponse() {
return { changeDate: undefined };
}
export const UpdateAuthorizationResponse = {
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 = createBaseUpdateAuthorizationResponse();
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 UpdateAuthorizationResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateAuthorizationResponse();
message.changeDate = object.changeDate ?? undefined;
return message;
},
};
function createBaseDeleteAuthorizationRequest() {
return { id: "" };
}
export const DeleteAuthorizationRequest = {
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 = createBaseDeleteAuthorizationRequest();
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 DeleteAuthorizationRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteAuthorizationRequest();
message.id = object.id ?? "";
return message;
},
};
function createBaseDeleteAuthorizationResponse() {
return { deletionDate: undefined };
}
export const DeleteAuthorizationResponse = {
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 = createBaseDeleteAuthorizationResponse();
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 DeleteAuthorizationResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteAuthorizationResponse();
message.deletionDate = object.deletionDate ?? undefined;
return message;
},
};
function createBaseActivateAuthorizationRequest() {
return { id: "" };
}
export const ActivateAuthorizationRequest = {
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 = createBaseActivateAuthorizationRequest();
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 ActivateAuthorizationRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseActivateAuthorizationRequest();
message.id = object.id ?? "";
return message;
},
};
function createBaseActivateAuthorizationResponse() {
return { changeDate: undefined };
}
export const ActivateAuthorizationResponse = {
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 = createBaseActivateAuthorizationResponse();
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 ActivateAuthorizationResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseActivateAuthorizationResponse();
message.changeDate = object.changeDate ?? undefined;
return message;
},
};
function createBaseDeactivateAuthorizationRequest() {
return { id: "" };
}
export const DeactivateAuthorizationRequest = {
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 = createBaseDeactivateAuthorizationRequest();
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 DeactivateAuthorizationRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeactivateAuthorizationRequest();
message.id = object.id ?? "";
return message;
},
};
function createBaseDeactivateAuthorizationResponse() {
return { changeDate: undefined };
}
export const DeactivateAuthorizationResponse = {
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 = createBaseDeactivateAuthorizationResponse();
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 DeactivateAuthorizationResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeactivateAuthorizationResponse();
message.changeDate = object.changeDate ?? undefined;
return message;
},
};
export const AuthorizationServiceDefinition = {
name: "AuthorizationService",
fullName: "zitadel.authorization.v2beta.AuthorizationService",
methods: {
/**
* List Authorizations
*
* ListAuthorizations returns all authorizations matching the request and necessary permissions.
*
* Required permissions:
* - "user.grant.read"
* - no permissions required for listing own authorizations
*/
listAuthorizations: {
name: "ListAuthorizations",
requestType: ListAuthorizationsRequest,
requestStream: false,
responseType: ListAuthorizationsResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
87,
74,
56,
10,
3,
50,
48,
48,
18,
49,
10,
47,
65,
32,
108,
105,
115,
116,
32,
111,
102,
32,
97,
108,
108,
32,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
115,
32,
109,
97,
116,
99,
104,
105,
110,
103,
32,
116,
104,
101,
32,
113,
117,
101,
114,
121,
74,
27,
10,
3,
52,
48,
48,
18,
20,
10,
18,
105,
110,
118,
97,
108,
105,
100,
32,
108,
105,
115,
116,
32,
113,
117,
101,
114,
121,
]),
],
400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
578365826: [
Buffer.from([
34,
58,
1,
42,
34,
29,
47,
118,
50,
98,
101,
116,
97,
47,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
115,
47,
115,
101,
97,
114,
99,
104,
]),
],
},
},
},
/**
* Create Authorization
*
* CreateAuthorization creates a new authorization for a user in an owned or granted project.
*
* Required permissions:
* - "user.grant.write"
*/
createAuthorization: {
name: "CreateAuthorization",
requestType: CreateAuthorizationRequest,
requestStream: false,
responseType: CreateAuthorizationResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
148,
1,
74,
40,
10,
3,
50,
48,
48,
18,
33,
10,
31,
84,
104,
101,
32,
110,
101,
119,
108,
121,
32,
99,
114,
101,
97,
116,
101,
100,
32,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
74,
31,
10,
3,
52,
48,
48,
18,
24,
10,
22,
105,
110,
118,
97,
108,
105,
100,
32,
99,
114,
101,
97,
116,
101,
32,
114,
101,
113,
117,
101,
115,
116,
74,
71,
10,
3,
52,
48,
57,
18,
64,
10,
33,
84,
104,
101,
32,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
32,
97,
108,
114,
101,
97,
100,
121,
32,
101,
120,
105,
115,
116,
115,
46,
18,
27,
10,
25,
26,
23,
35,
47,
100,
101,
102,
105,
110,
105,
116,
105,
111,
110,
115,
47,
114,
112,
99,
83,
116,
97,
116,
117,
115,
]),
],
400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
578365826: [
Buffer.from([
27,
58,
1,
42,
34,
22,
47,
118,
50,
98,
101,
116,
97,
47,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
115,
]),
],
},
},
},
/**
* Update Authorization
*
* UpdateAuthorization updates the authorization.
*
* Note that any role keys previously granted to the user and not present in the request will be revoked.
*
* Required permissions:
* - "user.grant.write"
*/
updateAuthorization: {
name: "UpdateAuthorization",
requestType: UpdateAuthorizationRequest,
requestStream: false,
responseType: UpdateAuthorizationResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
100,
74,
11,
10,
3,
50,
48,
48,
18,
4,
10,
2,
79,
75,
74,
85,
10,
3,
52,
48,
52,
18,
78,
10,
47,
65,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
32,
111,
114,
32,
111,
110,
101,
32,
111,
102,
32,
116,
104,
101,
32,
114,
111,
108,
101,
115,
32,
100,
111,
32,
110,
111,
116,
32,
101,
120,
105,
115,
116,
46,
18,
27,
10,
25,
26,
23,
35,
47,
100,
101,
102,
105,
110,
105,
116,
105,
111,
110,
115,
47,
114,
112,
99,
83,
116,
97,
116,
117,
115,
]),
],
400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
578365826: [
Buffer.from([
32,
58,
1,
42,
50,
27,
47,
118,
50,
98,
101,
116,
97,
47,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
115,
47,
123,
105,
100,
125,
]),
],
},
},
},
/**
* Delete Authorization
*
* DeleteAuthorization deletes the authorization.
*
* In case the authorization is not found, the request will return a successful response as
* the desired state is already achieved.
* You can check the deletion date in the response to verify if the authorization was deleted by the request.
*
* Required permissions:
* - "user.grant.delete"
*/
deleteAuthorization: {
name: "DeleteAuthorization",
requestType: DeleteAuthorizationRequest,
requestStream: false,
responseType: DeleteAuthorizationResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
118,
74,
52,
10,
3,
50,
48,
48,
18,
45,
10,
43,
84,
104,
101,
32,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
32,
119,
97,
115,
32,
100,
101,
108,
101,
116,
101,
100,
32,
115,
117,
99,
99,
101,
115,
115,
102,
117,
108,
108,
121,
46,
74,
62,
10,
3,
52,
48,
52,
18,
55,
10,
24,
65,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
32,
110,
111,
116,
32,
102,
111,
117,
110,
100,
46,
18,
27,
10,
25,
26,
23,
35,
47,
100,
101,
102,
105,
110,
105,
116,
105,
111,
110,
115,
47,
114,
112,
99,
83,
116,
97,
116,
117,
115,
]),
],
400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
578365826: [
Buffer.from([
29,
42,
27,
47,
118,
50,
98,
101,
116,
97,
47,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
115,
47,
123,
105,
100,
125,
]),
],
},
},
},
/**
* Activate Authorization
*
* ActivateAuthorization activates an existing but inactive authorization.
*
* In case the authorization is already active, the request will return a successful response as
* the desired state is already achieved.
* You can check the change date in the response to verify if the authorization was activated by the request.
*
* Required permissions:
* - "user.grant.write"
*/
activateAuthorization: {
name: "ActivateAuthorization",
requestType: ActivateAuthorizationRequest,
requestStream: false,
responseType: ActivateAuthorizationResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
120,
74,
54,
10,
3,
50,
48,
48,
18,
47,
10,
45,
84,
104,
101,
32,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
32,
119,
97,
115,
32,
97,
99,
116,
105,
118,
97,
116,
101,
100,
32,
115,
117,
99,
99,
101,
115,
115,
102,
117,
108,
108,
121,
46,
74,
62,
10,
3,
52,
48,
52,
18,
55,
10,
24,
65,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
32,
110,
111,
116,
32,
102,
111,
117,
110,
100,
46,
18,
27,
10,
25,
26,
23,
35,
47,
100,
101,
102,
105,
110,
105,
116,
105,
111,
110,
115,
47,
114,
112,
99,
83,
116,
97,
116,
117,
115,
]),
],
400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
578365826: [
Buffer.from([
41,
58,
1,
42,
34,
36,
47,
118,
50,
98,
101,
116,
97,
47,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
115,
47,
123,
105,
100,
125,
47,
97,
99,
116,
105,
118,
97,
116,
101,
]),
],
},
},
},
/**
* Deactivate Authorization
*
* DeactivateAuthorization deactivates an existing and active authorization.
*
* In case the authorization is already inactive, the request will return a successful response as
* the desired state is already achieved.
* You can check the change date in the response to verify if the authorization was deactivated by the request.
*
* Required permissions:
* - "user.grant.write"
*/
deactivateAuthorization: {
name: "DeactivateAuthorization",
requestType: DeactivateAuthorizationRequest,
requestStream: false,
responseType: DeactivateAuthorizationResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
122,
74,
56,
10,
3,
50,
48,
48,
18,
49,
10,
47,
84,
104,
101,
32,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
32,
119,
97,
115,
32,
100,
101,
97,
99,
116,
105,
118,
97,
116,
101,
100,
32,
115,
117,
99,
99,
101,
115,
115,
102,
117,
108,
108,
121,
46,
74,
62,
10,
3,
52,
48,
52,
18,
55,
10,
24,
65,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
32,
110,
111,
116,
32,
102,
111,
117,
110,
100,
46,
18,
27,
10,
25,
26,
23,
35,
47,
100,
101,
102,
105,
110,
105,
116,
105,
111,
110,
115,
47,
114,
112,
99,
83,
116,
97,
116,
117,
115,
]),
],
400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
578365826: [
Buffer.from([
43,
58,
1,
42,
34,
38,
47,
118,
50,
98,
101,
116,
97,
47,
97,
117,
116,
104,
111,
114,
105,
122,
97,
116,
105,
111,
110,
115,
47,
123,
105,
100,
125,
47,
100,
101,
97,
99,
116,
105,
118,
97,
116,
101,
]),
],
},
},
},
},
};
function toTimestamp(date) {
const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t) {
let millis = (t.seconds.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
function fromJsonTimestamp(o) {
if (o instanceof globalThis.Date) {
return o;
}
else if (typeof o === "string") {
return new globalThis.Date(o);
}
else {
return fromTimestamp(Timestamp.fromJSON(o));
}
}
function numberToLong(number) {
return Long.fromNumber(number);
}
function isSet(value) {
return value !== null && value !== undefined;
}