Files
npm-core-sdk/admin-actor.ts
2025-03-20 10:05:56 +00:00

156 lines
8.0 KiB
TypeScript

// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "admin-actor.proto" (package "api", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { ActorTypology } from "./repositoryShared";
import { ActorContact } from "./repositoryShared";
import { Address } from "./repositoryShared";
/**
* @generated from protobuf message api.AdminActor
*/
export interface AdminActor {
/**
* @generated from protobuf field: string ID = 1 [json_name = "ID"];
*/
iD: string;
/**
* @generated from protobuf field: string Name = 2 [json_name = "Name"];
*/
name: string;
/**
* @generated from protobuf field: string OrganisationID = 3 [json_name = "OrganisationID"];
*/
organisationID: string;
/**
* @generated from protobuf field: string PartnerID = 4 [json_name = "PartnerID"];
*/
partnerID: string;
// string AdditionalInformations = 5;
/**
* @generated from protobuf field: api.Address Address = 6 [json_name = "Address"];
*/
address?: Address;
/**
* @generated from protobuf field: api.ActorContact Contact = 7 [json_name = "Contact"];
*/
contact?: ActorContact;
/**
* @generated from protobuf field: api.ActorTypology Typology = 8 [json_name = "Typology"];
*/
typology: ActorTypology;
/**
* @generated from protobuf field: string AdditionalInformation = 9 [json_name = "AdditionalInformation"];
*/
additionalInformation: string;
}
// @generated message type with reflection information, may provide speed optimized methods
class AdminActor$Type extends MessageType<AdminActor> {
constructor() {
super("api.AdminActor", [
{ no: 1, name: "ID", kind: "scalar", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
{ no: 2, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
{ no: 3, name: "OrganisationID", kind: "scalar", jsonName: "OrganisationID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
{ no: 4, name: "PartnerID", kind: "scalar", jsonName: "PartnerID", T: 9 /*ScalarType.STRING*/ },
{ no: 6, name: "Address", kind: "message", jsonName: "Address", T: () => Address, options: { "validate.rules": { message: { required: true } } } },
{ no: 7, name: "Contact", kind: "message", jsonName: "Contact", T: () => ActorContact, options: { "validate.rules": { message: { required: true } } } },
{ no: 8, name: "Typology", kind: "enum", jsonName: "Typology", T: () => ["api.ActorTypology", ActorTypology] },
{ no: 9, name: "AdditionalInformation", kind: "scalar", jsonName: "AdditionalInformation", T: 9 /*ScalarType.STRING*/ }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ID", "Name", "OrganisationID"] } } });
}
create(value?: PartialMessage<AdminActor>): AdminActor {
const message = globalThis.Object.create((this.messagePrototype!));
message.iD = "";
message.name = "";
message.organisationID = "";
message.partnerID = "";
message.typology = 0;
message.additionalInformation = "";
if (value !== undefined)
reflectionMergePartial<AdminActor>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AdminActor): AdminActor {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string ID = 1 [json_name = "ID"];*/ 1:
message.iD = reader.string();
break;
case /* string Name = 2 [json_name = "Name"];*/ 2:
message.name = reader.string();
break;
case /* string OrganisationID = 3 [json_name = "OrganisationID"];*/ 3:
message.organisationID = reader.string();
break;
case /* string PartnerID = 4 [json_name = "PartnerID"];*/ 4:
message.partnerID = reader.string();
break;
case /* api.Address Address = 6 [json_name = "Address"];*/ 6:
message.address = Address.internalBinaryRead(reader, reader.uint32(), options, message.address);
break;
case /* api.ActorContact Contact = 7 [json_name = "Contact"];*/ 7:
message.contact = ActorContact.internalBinaryRead(reader, reader.uint32(), options, message.contact);
break;
case /* api.ActorTypology Typology = 8 [json_name = "Typology"];*/ 8:
message.typology = reader.int32();
break;
case /* string AdditionalInformation = 9 [json_name = "AdditionalInformation"];*/ 9:
message.additionalInformation = reader.string();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: AdminActor, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string ID = 1 [json_name = "ID"]; */
if (message.iD !== "")
writer.tag(1, WireType.LengthDelimited).string(message.iD);
/* string Name = 2 [json_name = "Name"]; */
if (message.name !== "")
writer.tag(2, WireType.LengthDelimited).string(message.name);
/* string OrganisationID = 3 [json_name = "OrganisationID"]; */
if (message.organisationID !== "")
writer.tag(3, WireType.LengthDelimited).string(message.organisationID);
/* string PartnerID = 4 [json_name = "PartnerID"]; */
if (message.partnerID !== "")
writer.tag(4, WireType.LengthDelimited).string(message.partnerID);
/* api.Address Address = 6 [json_name = "Address"]; */
if (message.address)
Address.internalBinaryWrite(message.address, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
/* api.ActorContact Contact = 7 [json_name = "Contact"]; */
if (message.contact)
ActorContact.internalBinaryWrite(message.contact, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
/* api.ActorTypology Typology = 8 [json_name = "Typology"]; */
if (message.typology !== 0)
writer.tag(8, WireType.Varint).int32(message.typology);
/* string AdditionalInformation = 9 [json_name = "AdditionalInformation"]; */
if (message.additionalInformation !== "")
writer.tag(9, WireType.LengthDelimited).string(message.additionalInformation);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.AdminActor
*/
export const AdminActor = new AdminActor$Type();