// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "metadatadef.proto" (package "api", syntax proto3)
// tslint:disable
import { ServiceType } from "@protobuf-ts/runtime-rpc";
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 { RequestProjectHeader } from "./shared";
import { MetadataDisplayType } from "./metadata";
import { MetadataType } from "./metadata";
/**
 * @generated from protobuf message api.PrjMetadata
 */
export interface PrjMetadata {
    /**
     * The segmentation keys are used to complete the segmentation criteria of the project stock. They also apply to order lines and stock movements
     *
     * @generated from protobuf field: bool IsSegmentationKey = 2 [json_name = "IsSegmentationKey"];
     */
    isSegmentationKey: boolean;
    /**
     * @generated from protobuf field: string Domain = 3 [json_name = "Domain"];
     */
    domain: string;
    /**
     * Entity where the metadata will be created. It can be \"executionflow\", \"handlingunit\", \"item\", \"order\", \"stock\"
     *
     * @generated from protobuf field: string Entity = 4 [json_name = "Entity"];
     */
    entity: string;
    /**
     * Where the metadata is located, either \"Payload.Metadata\" or \"Payload.Goods.SegmentationKeys\"
     *
     * @generated from protobuf field: string Parent = 5 [json_name = "Parent"];
     */
    parent: string;
    /**
     * @generated from protobuf field: string Name = 6 [json_name = "Name"];
     */
    name: string;
    /**
     * Type attached to the metadata, can be anything such as Item, Actor, Order...
     *
     * @generated from protobuf field: string Type = 7 [json_name = "Type"];
     */
    type: string;
    /**
     * @generated from protobuf field: bool IsMandatory = 8 [json_name = "IsMandatory"];
     */
    isMandatory: boolean;
    /**
     * @generated from protobuf field: string Example = 9 [json_name = "Example"];
     */
    example: string;
    /**
     * @generated from protobuf field: string RegularExpression = 10 [json_name = "RegularExpression"];
     */
    regularExpression: string;
    /**
     * @generated from protobuf field: api.MetadataType Typology = 11 [json_name = "Typology"];
     */
    typology: MetadataType;
    /**
     * Customizable enumeration
     *
     * @generated from protobuf field: repeated string Enumeration = 12 [json_name = "Enumeration"];
     */
    enumeration: string[];
    /**
     * @generated from protobuf field: api.MetadataDisplayType ShowOnCreation = 13 [json_name = "ShowOnCreation"];
     */
    showOnCreation: MetadataDisplayType;
}
/**
 * @generated from protobuf message api.PrjMetadataTransitive
 */
export interface PrjMetadataTransitive {
    /**
     * Where the metadata is located, either \"Payload.Metadata\" or \"Payload.Goods.SegmentationKeys\"
     *
     * @generated from protobuf field: string Parent = 1 [json_name = "Parent"];
     */
    parent: string;
    /**
     * @generated from protobuf field: string Name = 2 [json_name = "Name"];
     */
    name: string;
    /**
     * The segmentation keys are used to complete the segmentation criteria of the project stock. They also apply to order lines and stock movements
     *
     * @generated from protobuf field: bool IsSegmentationKey = 3 [json_name = "IsSegmentationKey"];
     */
    isSegmentationKey: boolean;
    /**
     * Type attached to the metadata, can be anything such as Item, Actor, Order...
     *
     * @generated from protobuf field: string Type = 4 [json_name = "Type"];
     */
    type: string;
    /**
     * @generated from protobuf field: bool IsMandatory = 5 [json_name = "IsMandatory"];
     */
    isMandatory: boolean;
    /**
     * @generated from protobuf field: string Example = 6 [json_name = "Example"];
     */
    example: string;
    /**
     * @generated from protobuf field: string RegularExpression = 7 [json_name = "RegularExpression"];
     */
    regularExpression: string;
    /**
     * Customizable enumeration
     *
     * @generated from protobuf field: repeated string Enumeration = 8 [json_name = "Enumeration"];
     */
    enumeration: string[];
    /**
     * @generated from protobuf field: api.MetadataDisplayType ShowOnCreation = 9 [json_name = "ShowOnCreation"];
     */
    showOnCreation: MetadataDisplayType;
}
/**
 * @generated from protobuf message api.PrjMetadataFilters
 */
export interface PrjMetadataFilters {
    // string Project = 1 
    //    [
    //        (validate.rules).string.min_len = 1
    //    ];

    /**
     * @generated from protobuf field: string Domain = 2 [json_name = "Domain"];
     */
    domain: string;
    /**
     * Entity where the metadata will be created. It can be \"executionflow\", \"handlingunit\", \"item\", \"order\", \"stock\"
     *
     * @generated from protobuf field: string Entity = 3 [json_name = "Entity"];
     */
    entity: string;
    /**
     * The segmentation keys are used to complete the segmentation criteria of the project stock. They also apply to order lines and stock movements
     *
     * @generated from protobuf field: bool IsSegmentationKey = 4 [json_name = "IsSegmentationKey"];
     */
    isSegmentationKey: boolean;
    /**
     * Where the metadata is located, either \"Payload.Metadata\" or \"Payload.Goods.SegmentationKeys\"
     *
     * @generated from protobuf field: string Parent = 5 [json_name = "Parent"];
     */
    parent: string;
    /**
     * @generated from protobuf field: string Name = 6 [json_name = "Name"];
     */
    name: string;
}
/**
 * @generated from protobuf message api.PrjMetadatasByDomain
 */
export interface PrjMetadatasByDomain {
    /**
     * @generated from protobuf field: map<string, int64> Entities = 1 [json_name = "Entities"];
     */
    entities: {
        [key: string]: bigint;
    };
    /**
     * @generated from protobuf field: int64 Total = 2 [json_name = "Total"];
     */
    total: bigint;
}
/**
 * @generated from protobuf message api.CreateMetadataRequest
 */
export interface CreateMetadataRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 2 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)
     *
     * @generated from protobuf field: api.PrjMetadata Metadata = 1 [json_name = "Metadata"];
     */
    metadata?: PrjMetadata;
}
/**
 * @generated from protobuf message api.CreateMetadataResult
 */
export interface CreateMetadataResult {
    /**
     * @generated from protobuf field: api.PrjMetadata Metadata = 1 [json_name = "Metadata"];
     */
    metadata?: PrjMetadata;
}
/**
 * @generated from protobuf message api.UpdateMetadataRequest
 */
export interface UpdateMetadataRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 2 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)
     *
     * @generated from protobuf field: api.PrjMetadata Metadata = 1 [json_name = "Metadata"];
     */
    metadata?: PrjMetadata;
}
/**
 * @generated from protobuf message api.UpdateMetadataResult
 */
export interface UpdateMetadataResult {
    /**
     * @generated from protobuf field: api.PrjMetadata Metadata = 1 [json_name = "Metadata"];
     */
    metadata?: PrjMetadata;
}
/**
 * @generated from protobuf message api.DeleteMetadatasRequest
 */
export interface DeleteMetadatasRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 2 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.PrjMetadataFilters Filters = 1 [json_name = "Filters"];
     */
    filters?: PrjMetadataFilters;
}
/**
 * @generated from protobuf message api.DeleteMetadatasResult
 */
export interface DeleteMetadatasResult {
}
/**
 * @generated from protobuf message api.GetMetadatasRequest
 */
export interface GetMetadatasRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 2 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.PrjMetadataFilters Filters = 1 [json_name = "Filters"];
     */
    filters?: PrjMetadataFilters;
}
/**
 * @generated from protobuf message api.GetMetadatasResult
 */
export interface GetMetadatasResult {
    /**
     * @generated from protobuf field: repeated api.PrjMetadata Metadatas = 1 [json_name = "Metadatas"];
     */
    metadatas: PrjMetadata[];
}
/**
 * @generated from protobuf message api.GetMetadataCountRequest
 */
export interface GetMetadataCountRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 3 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    // string Project = 1  
    //    [
    //        (validate.rules).string.min_len = 1
    //    ];

    /**
     * The segmentation keys are used to complete the segmentation criteria of the project stock. They also apply to order lines and stock movements
     *
     * @generated from protobuf field: bool IsSegmentationKey = 2 [json_name = "IsSegmentationKey"];
     */
    isSegmentationKey: boolean;
}
/**
 * @generated from protobuf message api.GetMetadataCountResult
 */
export interface GetMetadataCountResult {
    /**
     * @generated from protobuf field: map<string, api.PrjMetadatasByDomain> Domains = 1 [json_name = "Domains"];
     */
    domains: {
        [key: string]: PrjMetadatasByDomain;
    };
    /**
     * @generated from protobuf field: int64 Total = 2 [json_name = "Total"];
     */
    total: bigint;
}
/**
 * @generated from protobuf message api.GetTransitiveMetadatasRequest
 */
export interface GetTransitiveMetadatasRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 4 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    // string Project = 1 
    //    [
    //        (validate.rules).string.min_len = 1
    //    ];

    /**
     * @generated from protobuf field: string Domain = 2 [json_name = "Domain"];
     */
    domain: string;
    /**
     * Entity where the metadata will be created. It can be \"executionflow\", \"handlingunit\", \"item\", \"order\", \"stock\"
     *
     * @generated from protobuf field: string Entity = 3 [json_name = "Entity"];
     */
    entity: string;
}
/**
 * @generated from protobuf message api.GetTransitiveMetadatasResult
 */
export interface GetTransitiveMetadatasResult {
    /**
     * @generated from protobuf field: repeated api.PrjMetadataTransitive MetadataTransitive = 1 [json_name = "MetadataTransitive"];
     */
    metadataTransitive: PrjMetadataTransitive[];
}
/**
 * @generated from protobuf message api.RestoreMetadatasRequest
 */
export interface RestoreMetadatasRequest {
    /**
     * @generated from protobuf field: string ProjectID = 1 [json_name = "ProjectID"];
     */
    projectID: string;
    /**
     * @generated from protobuf field: bool AlterClickhouse = 2 [json_name = "AlterClickhouse"];
     */
    alterClickhouse: boolean;
}
/**
 * @generated from protobuf message api.RestoreMetadatasResult
 */
export interface RestoreMetadatasResult {
}
// @generated message type with reflection information, may provide speed optimized methods
class PrjMetadata$Type extends MessageType<PrjMetadata> {
    constructor() {
        super("api.PrjMetadata", [
            { no: 2, name: "IsSegmentationKey", kind: "scalar", jsonName: "IsSegmentationKey", T: 8 /*ScalarType.BOOL*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The segmentation keys are used to complete the segmentation criteria of the project stock. They also apply to order lines and stock movements" } } },
            { no: 3, name: "Domain", kind: "scalar", jsonName: "Domain", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { in: ["trade", "collab"] } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { default: "trade" } } },
            { no: 4, name: "Entity", kind: "scalar", jsonName: "Entity", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Entity where the metadata will be created. It can be \"executionflow\", \"handlingunit\", \"item\", \"order\", \"stock\"", example: "\"order\"" } } },
            { no: 5, name: "Parent", kind: "scalar", jsonName: "Parent", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Where the metadata is located, either \"Payload.Metadata\" or \"Payload.Goods.SegmentationKeys\"" } } },
            { no: 6, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1", pattern: "^[a-zA-Z]{1}[a-zA-Z0-9]*$" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "^[a-zA-Z]{1}[a-zA-Z0-9]*$" } } },
            { no: 7, name: "Type", kind: "scalar", jsonName: "Type", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Type attached to the metadata, can be anything such as Item, Actor, Order..." } } },
            { no: 8, name: "IsMandatory", kind: "scalar", jsonName: "IsMandatory", T: 8 /*ScalarType.BOOL*/ },
            { no: 9, name: "Example", kind: "scalar", jsonName: "Example", T: 9 /*ScalarType.STRING*/ },
            { no: 10, name: "RegularExpression", kind: "scalar", jsonName: "RegularExpression", T: 9 /*ScalarType.STRING*/ },
            { no: 11, name: "Typology", kind: "enum", jsonName: "Typology", T: () => ["api.MetadataType", MetadataType] },
            { no: 12, name: "Enumeration", kind: "scalar", jsonName: "Enumeration", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Customizable enumeration" } } },
            { no: 13, name: "ShowOnCreation", kind: "enum", jsonName: "ShowOnCreation", T: () => ["api.MetadataDisplayType", MetadataDisplayType] }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Entity", "Parent", "Name", "Type"] } } });
    }
    create(value?: PartialMessage<PrjMetadata>): PrjMetadata {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.isSegmentationKey = false;
        message.domain = "";
        message.entity = "";
        message.parent = "";
        message.name = "";
        message.type = "";
        message.isMandatory = false;
        message.example = "";
        message.regularExpression = "";
        message.typology = 0;
        message.enumeration = [];
        message.showOnCreation = 0;
        if (value !== undefined)
            reflectionMergePartial<PrjMetadata>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PrjMetadata): PrjMetadata {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* bool IsSegmentationKey = 2 [json_name = "IsSegmentationKey"];*/ 2:
                    message.isSegmentationKey = reader.bool();
                    break;
                case /* string Domain = 3 [json_name = "Domain"];*/ 3:
                    message.domain = reader.string();
                    break;
                case /* string Entity = 4 [json_name = "Entity"];*/ 4:
                    message.entity = reader.string();
                    break;
                case /* string Parent = 5 [json_name = "Parent"];*/ 5:
                    message.parent = reader.string();
                    break;
                case /* string Name = 6 [json_name = "Name"];*/ 6:
                    message.name = reader.string();
                    break;
                case /* string Type = 7 [json_name = "Type"];*/ 7:
                    message.type = reader.string();
                    break;
                case /* bool IsMandatory = 8 [json_name = "IsMandatory"];*/ 8:
                    message.isMandatory = reader.bool();
                    break;
                case /* string Example = 9 [json_name = "Example"];*/ 9:
                    message.example = reader.string();
                    break;
                case /* string RegularExpression = 10 [json_name = "RegularExpression"];*/ 10:
                    message.regularExpression = reader.string();
                    break;
                case /* api.MetadataType Typology = 11 [json_name = "Typology"];*/ 11:
                    message.typology = reader.int32();
                    break;
                case /* repeated string Enumeration = 12 [json_name = "Enumeration"];*/ 12:
                    message.enumeration.push(reader.string());
                    break;
                case /* api.MetadataDisplayType ShowOnCreation = 13 [json_name = "ShowOnCreation"];*/ 13:
                    message.showOnCreation = reader.int32();
                    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: PrjMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* bool IsSegmentationKey = 2 [json_name = "IsSegmentationKey"]; */
        if (message.isSegmentationKey !== false)
            writer.tag(2, WireType.Varint).bool(message.isSegmentationKey);
        /* string Domain = 3 [json_name = "Domain"]; */
        if (message.domain !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.domain);
        /* string Entity = 4 [json_name = "Entity"]; */
        if (message.entity !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.entity);
        /* string Parent = 5 [json_name = "Parent"]; */
        if (message.parent !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.parent);
        /* string Name = 6 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.name);
        /* string Type = 7 [json_name = "Type"]; */
        if (message.type !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.type);
        /* bool IsMandatory = 8 [json_name = "IsMandatory"]; */
        if (message.isMandatory !== false)
            writer.tag(8, WireType.Varint).bool(message.isMandatory);
        /* string Example = 9 [json_name = "Example"]; */
        if (message.example !== "")
            writer.tag(9, WireType.LengthDelimited).string(message.example);
        /* string RegularExpression = 10 [json_name = "RegularExpression"]; */
        if (message.regularExpression !== "")
            writer.tag(10, WireType.LengthDelimited).string(message.regularExpression);
        /* api.MetadataType Typology = 11 [json_name = "Typology"]; */
        if (message.typology !== 0)
            writer.tag(11, WireType.Varint).int32(message.typology);
        /* repeated string Enumeration = 12 [json_name = "Enumeration"]; */
        for (let i = 0; i < message.enumeration.length; i++)
            writer.tag(12, WireType.LengthDelimited).string(message.enumeration[i]);
        /* api.MetadataDisplayType ShowOnCreation = 13 [json_name = "ShowOnCreation"]; */
        if (message.showOnCreation !== 0)
            writer.tag(13, WireType.Varint).int32(message.showOnCreation);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PrjMetadata
 */
export const PrjMetadata = new PrjMetadata$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PrjMetadataTransitive$Type extends MessageType<PrjMetadataTransitive> {
    constructor() {
        super("api.PrjMetadataTransitive", [
            { no: 1, name: "Parent", kind: "scalar", jsonName: "Parent", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Where the metadata is located, either \"Payload.Metadata\" or \"Payload.Goods.SegmentationKeys\"" } } },
            { no: 2, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "IsSegmentationKey", kind: "scalar", jsonName: "IsSegmentationKey", T: 8 /*ScalarType.BOOL*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The segmentation keys are used to complete the segmentation criteria of the project stock. They also apply to order lines and stock movements" } } },
            { no: 4, name: "Type", kind: "scalar", jsonName: "Type", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Type attached to the metadata, can be anything such as Item, Actor, Order..." } } },
            { no: 5, name: "IsMandatory", kind: "scalar", jsonName: "IsMandatory", T: 8 /*ScalarType.BOOL*/ },
            { no: 6, name: "Example", kind: "scalar", jsonName: "Example", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 7, name: "RegularExpression", kind: "scalar", jsonName: "RegularExpression", T: 9 /*ScalarType.STRING*/ },
            { no: 8, name: "Enumeration", kind: "scalar", jsonName: "Enumeration", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Customizable enumeration" } } },
            { no: 9, name: "ShowOnCreation", kind: "enum", jsonName: "ShowOnCreation", T: () => ["api.MetadataDisplayType", MetadataDisplayType] }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Parent", "Name", "Type", "Example"] } } });
    }
    create(value?: PartialMessage<PrjMetadataTransitive>): PrjMetadataTransitive {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.parent = "";
        message.name = "";
        message.isSegmentationKey = false;
        message.type = "";
        message.isMandatory = false;
        message.example = "";
        message.regularExpression = "";
        message.enumeration = [];
        message.showOnCreation = 0;
        if (value !== undefined)
            reflectionMergePartial<PrjMetadataTransitive>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PrjMetadataTransitive): PrjMetadataTransitive {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Parent = 1 [json_name = "Parent"];*/ 1:
                    message.parent = reader.string();
                    break;
                case /* string Name = 2 [json_name = "Name"];*/ 2:
                    message.name = reader.string();
                    break;
                case /* bool IsSegmentationKey = 3 [json_name = "IsSegmentationKey"];*/ 3:
                    message.isSegmentationKey = reader.bool();
                    break;
                case /* string Type = 4 [json_name = "Type"];*/ 4:
                    message.type = reader.string();
                    break;
                case /* bool IsMandatory = 5 [json_name = "IsMandatory"];*/ 5:
                    message.isMandatory = reader.bool();
                    break;
                case /* string Example = 6 [json_name = "Example"];*/ 6:
                    message.example = reader.string();
                    break;
                case /* string RegularExpression = 7 [json_name = "RegularExpression"];*/ 7:
                    message.regularExpression = reader.string();
                    break;
                case /* repeated string Enumeration = 8 [json_name = "Enumeration"];*/ 8:
                    message.enumeration.push(reader.string());
                    break;
                case /* api.MetadataDisplayType ShowOnCreation = 9 [json_name = "ShowOnCreation"];*/ 9:
                    message.showOnCreation = reader.int32();
                    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: PrjMetadataTransitive, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Parent = 1 [json_name = "Parent"]; */
        if (message.parent !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.parent);
        /* string Name = 2 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.name);
        /* bool IsSegmentationKey = 3 [json_name = "IsSegmentationKey"]; */
        if (message.isSegmentationKey !== false)
            writer.tag(3, WireType.Varint).bool(message.isSegmentationKey);
        /* string Type = 4 [json_name = "Type"]; */
        if (message.type !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.type);
        /* bool IsMandatory = 5 [json_name = "IsMandatory"]; */
        if (message.isMandatory !== false)
            writer.tag(5, WireType.Varint).bool(message.isMandatory);
        /* string Example = 6 [json_name = "Example"]; */
        if (message.example !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.example);
        /* string RegularExpression = 7 [json_name = "RegularExpression"]; */
        if (message.regularExpression !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.regularExpression);
        /* repeated string Enumeration = 8 [json_name = "Enumeration"]; */
        for (let i = 0; i < message.enumeration.length; i++)
            writer.tag(8, WireType.LengthDelimited).string(message.enumeration[i]);
        /* api.MetadataDisplayType ShowOnCreation = 9 [json_name = "ShowOnCreation"]; */
        if (message.showOnCreation !== 0)
            writer.tag(9, WireType.Varint).int32(message.showOnCreation);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PrjMetadataTransitive
 */
export const PrjMetadataTransitive = new PrjMetadataTransitive$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PrjMetadataFilters$Type extends MessageType<PrjMetadataFilters> {
    constructor() {
        super("api.PrjMetadataFilters", [
            { no: 2, name: "Domain", kind: "scalar", jsonName: "Domain", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { in: ["trade", "collab", "core"] } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { default: "trade" } } },
            { no: 3, name: "Entity", kind: "scalar", jsonName: "Entity", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Entity where the metadata will be created. It can be \"executionflow\", \"handlingunit\", \"item\", \"order\", \"stock\"", example: "\"order\"" } } },
            { no: 4, name: "IsSegmentationKey", kind: "scalar", jsonName: "IsSegmentationKey", T: 8 /*ScalarType.BOOL*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The segmentation keys are used to complete the segmentation criteria of the project stock. They also apply to order lines and stock movements" } } },
            { no: 5, name: "Parent", kind: "scalar", jsonName: "Parent", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Where the metadata is located, either \"Payload.Metadata\" or \"Payload.Goods.SegmentationKeys\"" } } },
            { no: 6, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<PrjMetadataFilters>): PrjMetadataFilters {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.domain = "";
        message.entity = "";
        message.isSegmentationKey = false;
        message.parent = "";
        message.name = "";
        if (value !== undefined)
            reflectionMergePartial<PrjMetadataFilters>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PrjMetadataFilters): PrjMetadataFilters {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Domain = 2 [json_name = "Domain"];*/ 2:
                    message.domain = reader.string();
                    break;
                case /* string Entity = 3 [json_name = "Entity"];*/ 3:
                    message.entity = reader.string();
                    break;
                case /* bool IsSegmentationKey = 4 [json_name = "IsSegmentationKey"];*/ 4:
                    message.isSegmentationKey = reader.bool();
                    break;
                case /* string Parent = 5 [json_name = "Parent"];*/ 5:
                    message.parent = reader.string();
                    break;
                case /* string Name = 6 [json_name = "Name"];*/ 6:
                    message.name = 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: PrjMetadataFilters, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Domain = 2 [json_name = "Domain"]; */
        if (message.domain !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.domain);
        /* string Entity = 3 [json_name = "Entity"]; */
        if (message.entity !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.entity);
        /* bool IsSegmentationKey = 4 [json_name = "IsSegmentationKey"]; */
        if (message.isSegmentationKey !== false)
            writer.tag(4, WireType.Varint).bool(message.isSegmentationKey);
        /* string Parent = 5 [json_name = "Parent"]; */
        if (message.parent !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.parent);
        /* string Name = 6 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.name);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PrjMetadataFilters
 */
export const PrjMetadataFilters = new PrjMetadataFilters$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PrjMetadatasByDomain$Type extends MessageType<PrjMetadatasByDomain> {
    constructor() {
        super("api.PrjMetadatasByDomain", [
            { no: 1, name: "Entities", kind: "map", jsonName: "Entities", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } },
            { no: 2, name: "Total", kind: "scalar", jsonName: "Total", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
        ]);
    }
    create(value?: PartialMessage<PrjMetadatasByDomain>): PrjMetadatasByDomain {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.entities = {};
        message.total = 0n;
        if (value !== undefined)
            reflectionMergePartial<PrjMetadatasByDomain>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PrjMetadatasByDomain): PrjMetadatasByDomain {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* map<string, int64> Entities = 1 [json_name = "Entities"];*/ 1:
                    this.binaryReadMap1(message.entities, reader, options);
                    break;
                case /* int64 Total = 2 [json_name = "Total"];*/ 2:
                    message.total = reader.int64().toBigInt();
                    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;
    }
    private binaryReadMap1(map: PrjMetadatasByDomain["entities"], reader: IBinaryReader, options: BinaryReadOptions): void {
        let len = reader.uint32(), end = reader.pos + len, key: keyof PrjMetadatasByDomain["entities"] | undefined, val: PrjMetadatasByDomain["entities"][any] | undefined;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case 1:
                    key = reader.string();
                    break;
                case 2:
                    val = reader.int64().toBigInt();
                    break;
                default: throw new globalThis.Error("unknown map entry field for field api.PrjMetadatasByDomain.Entities");
            }
        }
        map[key ?? ""] = val ?? 0n;
    }
    internalBinaryWrite(message: PrjMetadatasByDomain, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* map<string, int64> Entities = 1 [json_name = "Entities"]; */
        for (let k of globalThis.Object.keys(message.entities))
            writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int64(message.entities[k]).join();
        /* int64 Total = 2 [json_name = "Total"]; */
        if (message.total !== 0n)
            writer.tag(2, WireType.Varint).int64(message.total);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PrjMetadatasByDomain
 */
export const PrjMetadatasByDomain = new PrjMetadatasByDomain$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateMetadataRequest$Type extends MessageType<CreateMetadataRequest> {
    constructor() {
        super("api.CreateMetadataRequest", [
            { no: 2, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 1, name: "Metadata", kind: "message", jsonName: "Metadata", T: () => PrjMetadata, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Metadata"] } } });
    }
    create(value?: PartialMessage<CreateMetadataRequest>): CreateMetadataRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<CreateMetadataRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateMetadataRequest): CreateMetadataRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 2 [json_name = "Header"];*/ 2:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.PrjMetadata Metadata = 1 [json_name = "Metadata"];*/ 1:
                    message.metadata = PrjMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata);
                    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: CreateMetadataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 2 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.PrjMetadata Metadata = 1 [json_name = "Metadata"]; */
        if (message.metadata)
            PrjMetadata.internalBinaryWrite(message.metadata, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.CreateMetadataRequest
 */
export const CreateMetadataRequest = new CreateMetadataRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateMetadataResult$Type extends MessageType<CreateMetadataResult> {
    constructor() {
        super("api.CreateMetadataResult", [
            { no: 1, name: "Metadata", kind: "message", jsonName: "Metadata", T: () => PrjMetadata }
        ]);
    }
    create(value?: PartialMessage<CreateMetadataResult>): CreateMetadataResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<CreateMetadataResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateMetadataResult): CreateMetadataResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.PrjMetadata Metadata = 1 [json_name = "Metadata"];*/ 1:
                    message.metadata = PrjMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata);
                    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: CreateMetadataResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.PrjMetadata Metadata = 1 [json_name = "Metadata"]; */
        if (message.metadata)
            PrjMetadata.internalBinaryWrite(message.metadata, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.CreateMetadataResult
 */
export const CreateMetadataResult = new CreateMetadataResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateMetadataRequest$Type extends MessageType<UpdateMetadataRequest> {
    constructor() {
        super("api.UpdateMetadataRequest", [
            { no: 2, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 1, name: "Metadata", kind: "message", jsonName: "Metadata", T: () => PrjMetadata, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Metadata"] } } });
    }
    create(value?: PartialMessage<UpdateMetadataRequest>): UpdateMetadataRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<UpdateMetadataRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateMetadataRequest): UpdateMetadataRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 2 [json_name = "Header"];*/ 2:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.PrjMetadata Metadata = 1 [json_name = "Metadata"];*/ 1:
                    message.metadata = PrjMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata);
                    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: UpdateMetadataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 2 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.PrjMetadata Metadata = 1 [json_name = "Metadata"]; */
        if (message.metadata)
            PrjMetadata.internalBinaryWrite(message.metadata, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.UpdateMetadataRequest
 */
export const UpdateMetadataRequest = new UpdateMetadataRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateMetadataResult$Type extends MessageType<UpdateMetadataResult> {
    constructor() {
        super("api.UpdateMetadataResult", [
            { no: 1, name: "Metadata", kind: "message", jsonName: "Metadata", T: () => PrjMetadata }
        ]);
    }
    create(value?: PartialMessage<UpdateMetadataResult>): UpdateMetadataResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<UpdateMetadataResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateMetadataResult): UpdateMetadataResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.PrjMetadata Metadata = 1 [json_name = "Metadata"];*/ 1:
                    message.metadata = PrjMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata);
                    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: UpdateMetadataResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.PrjMetadata Metadata = 1 [json_name = "Metadata"]; */
        if (message.metadata)
            PrjMetadata.internalBinaryWrite(message.metadata, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.UpdateMetadataResult
 */
export const UpdateMetadataResult = new UpdateMetadataResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteMetadatasRequest$Type extends MessageType<DeleteMetadatasRequest> {
    constructor() {
        super("api.DeleteMetadatasRequest", [
            { no: 2, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 1, name: "Filters", kind: "message", jsonName: "Filters", T: () => PrjMetadataFilters, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Metadata"] } } });
    }
    create(value?: PartialMessage<DeleteMetadatasRequest>): DeleteMetadatasRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteMetadatasRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMetadatasRequest): DeleteMetadatasRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 2 [json_name = "Header"];*/ 2:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.PrjMetadataFilters Filters = 1 [json_name = "Filters"];*/ 1:
                    message.filters = PrjMetadataFilters.internalBinaryRead(reader, reader.uint32(), options, message.filters);
                    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: DeleteMetadatasRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 2 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.PrjMetadataFilters Filters = 1 [json_name = "Filters"]; */
        if (message.filters)
            PrjMetadataFilters.internalBinaryWrite(message.filters, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DeleteMetadatasRequest
 */
export const DeleteMetadatasRequest = new DeleteMetadatasRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteMetadatasResult$Type extends MessageType<DeleteMetadatasResult> {
    constructor() {
        super("api.DeleteMetadatasResult", []);
    }
    create(value?: PartialMessage<DeleteMetadatasResult>): DeleteMetadatasResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteMetadatasResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMetadatasResult): DeleteMetadatasResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                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: DeleteMetadatasResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DeleteMetadatasResult
 */
export const DeleteMetadatasResult = new DeleteMetadatasResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetMetadatasRequest$Type extends MessageType<GetMetadatasRequest> {
    constructor() {
        super("api.GetMetadatasRequest", [
            { no: 2, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 1, name: "Filters", kind: "message", jsonName: "Filters", T: () => PrjMetadataFilters, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Metadata"] } } });
    }
    create(value?: PartialMessage<GetMetadatasRequest>): GetMetadatasRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<GetMetadatasRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMetadatasRequest): GetMetadatasRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 2 [json_name = "Header"];*/ 2:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.PrjMetadataFilters Filters = 1 [json_name = "Filters"];*/ 1:
                    message.filters = PrjMetadataFilters.internalBinaryRead(reader, reader.uint32(), options, message.filters);
                    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: GetMetadatasRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 2 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.PrjMetadataFilters Filters = 1 [json_name = "Filters"]; */
        if (message.filters)
            PrjMetadataFilters.internalBinaryWrite(message.filters, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetMetadatasRequest
 */
export const GetMetadatasRequest = new GetMetadatasRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetMetadatasResult$Type extends MessageType<GetMetadatasResult> {
    constructor() {
        super("api.GetMetadatasResult", [
            { no: 1, name: "Metadatas", kind: "message", jsonName: "Metadatas", repeat: 1 /*RepeatType.PACKED*/, T: () => PrjMetadata }
        ]);
    }
    create(value?: PartialMessage<GetMetadatasResult>): GetMetadatasResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.metadatas = [];
        if (value !== undefined)
            reflectionMergePartial<GetMetadatasResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMetadatasResult): GetMetadatasResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.PrjMetadata Metadatas = 1 [json_name = "Metadatas"];*/ 1:
                    message.metadatas.push(PrjMetadata.internalBinaryRead(reader, reader.uint32(), options));
                    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: GetMetadatasResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.PrjMetadata Metadatas = 1 [json_name = "Metadatas"]; */
        for (let i = 0; i < message.metadatas.length; i++)
            PrjMetadata.internalBinaryWrite(message.metadatas[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetMetadatasResult
 */
export const GetMetadatasResult = new GetMetadatasResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetMetadataCountRequest$Type extends MessageType<GetMetadataCountRequest> {
    constructor() {
        super("api.GetMetadataCountRequest", [
            { no: 3, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "IsSegmentationKey", kind: "scalar", jsonName: "IsSegmentationKey", T: 8 /*ScalarType.BOOL*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The segmentation keys are used to complete the segmentation criteria of the project stock. They also apply to order lines and stock movements" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
    }
    create(value?: PartialMessage<GetMetadataCountRequest>): GetMetadataCountRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.isSegmentationKey = false;
        if (value !== undefined)
            reflectionMergePartial<GetMetadataCountRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMetadataCountRequest): GetMetadataCountRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 3 [json_name = "Header"];*/ 3:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* bool IsSegmentationKey = 2 [json_name = "IsSegmentationKey"];*/ 2:
                    message.isSegmentationKey = reader.bool();
                    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: GetMetadataCountRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 3 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* bool IsSegmentationKey = 2 [json_name = "IsSegmentationKey"]; */
        if (message.isSegmentationKey !== false)
            writer.tag(2, WireType.Varint).bool(message.isSegmentationKey);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetMetadataCountRequest
 */
export const GetMetadataCountRequest = new GetMetadataCountRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetMetadataCountResult$Type extends MessageType<GetMetadataCountResult> {
    constructor() {
        super("api.GetMetadataCountResult", [
            { no: 1, name: "Domains", kind: "map", jsonName: "Domains", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => PrjMetadatasByDomain } },
            { no: 2, name: "Total", kind: "scalar", jsonName: "Total", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
        ]);
    }
    create(value?: PartialMessage<GetMetadataCountResult>): GetMetadataCountResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.domains = {};
        message.total = 0n;
        if (value !== undefined)
            reflectionMergePartial<GetMetadataCountResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMetadataCountResult): GetMetadataCountResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* map<string, api.PrjMetadatasByDomain> Domains = 1 [json_name = "Domains"];*/ 1:
                    this.binaryReadMap1(message.domains, reader, options);
                    break;
                case /* int64 Total = 2 [json_name = "Total"];*/ 2:
                    message.total = reader.int64().toBigInt();
                    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;
    }
    private binaryReadMap1(map: GetMetadataCountResult["domains"], reader: IBinaryReader, options: BinaryReadOptions): void {
        let len = reader.uint32(), end = reader.pos + len, key: keyof GetMetadataCountResult["domains"] | undefined, val: GetMetadataCountResult["domains"][any] | undefined;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case 1:
                    key = reader.string();
                    break;
                case 2:
                    val = PrjMetadatasByDomain.internalBinaryRead(reader, reader.uint32(), options);
                    break;
                default: throw new globalThis.Error("unknown map entry field for field api.GetMetadataCountResult.Domains");
            }
        }
        map[key ?? ""] = val ?? PrjMetadatasByDomain.create();
    }
    internalBinaryWrite(message: GetMetadataCountResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* map<string, api.PrjMetadatasByDomain> Domains = 1 [json_name = "Domains"]; */
        for (let k of globalThis.Object.keys(message.domains)) {
            writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
            writer.tag(2, WireType.LengthDelimited).fork();
            PrjMetadatasByDomain.internalBinaryWrite(message.domains[k], writer, options);
            writer.join().join();
        }
        /* int64 Total = 2 [json_name = "Total"]; */
        if (message.total !== 0n)
            writer.tag(2, WireType.Varint).int64(message.total);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetMetadataCountResult
 */
export const GetMetadataCountResult = new GetMetadataCountResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetTransitiveMetadatasRequest$Type extends MessageType<GetTransitiveMetadatasRequest> {
    constructor() {
        super("api.GetTransitiveMetadatasRequest", [
            { no: 4, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "Domain", kind: "scalar", jsonName: "Domain", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { in: ["trade", "collab"] } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { default: "trade" } } },
            { no: 3, name: "Entity", kind: "scalar", jsonName: "Entity", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Entity where the metadata will be created. It can be \"executionflow\", \"handlingunit\", \"item\", \"order\", \"stock\"", example: "\"order\"" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Entity"] } } });
    }
    create(value?: PartialMessage<GetTransitiveMetadatasRequest>): GetTransitiveMetadatasRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.domain = "";
        message.entity = "";
        if (value !== undefined)
            reflectionMergePartial<GetTransitiveMetadatasRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetTransitiveMetadatasRequest): GetTransitiveMetadatasRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 4 [json_name = "Header"];*/ 4:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* string Domain = 2 [json_name = "Domain"];*/ 2:
                    message.domain = reader.string();
                    break;
                case /* string Entity = 3 [json_name = "Entity"];*/ 3:
                    message.entity = 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: GetTransitiveMetadatasRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 4 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* string Domain = 2 [json_name = "Domain"]; */
        if (message.domain !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.domain);
        /* string Entity = 3 [json_name = "Entity"]; */
        if (message.entity !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.entity);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetTransitiveMetadatasRequest
 */
export const GetTransitiveMetadatasRequest = new GetTransitiveMetadatasRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetTransitiveMetadatasResult$Type extends MessageType<GetTransitiveMetadatasResult> {
    constructor() {
        super("api.GetTransitiveMetadatasResult", [
            { no: 1, name: "MetadataTransitive", kind: "message", jsonName: "MetadataTransitive", repeat: 1 /*RepeatType.PACKED*/, T: () => PrjMetadataTransitive }
        ]);
    }
    create(value?: PartialMessage<GetTransitiveMetadatasResult>): GetTransitiveMetadatasResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.metadataTransitive = [];
        if (value !== undefined)
            reflectionMergePartial<GetTransitiveMetadatasResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetTransitiveMetadatasResult): GetTransitiveMetadatasResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.PrjMetadataTransitive MetadataTransitive = 1 [json_name = "MetadataTransitive"];*/ 1:
                    message.metadataTransitive.push(PrjMetadataTransitive.internalBinaryRead(reader, reader.uint32(), options));
                    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: GetTransitiveMetadatasResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.PrjMetadataTransitive MetadataTransitive = 1 [json_name = "MetadataTransitive"]; */
        for (let i = 0; i < message.metadataTransitive.length; i++)
            PrjMetadataTransitive.internalBinaryWrite(message.metadataTransitive[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetTransitiveMetadatasResult
 */
export const GetTransitiveMetadatasResult = new GetTransitiveMetadatasResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RestoreMetadatasRequest$Type extends MessageType<RestoreMetadatasRequest> {
    constructor() {
        super("api.RestoreMetadatasRequest", [
            { no: 1, name: "ProjectID", kind: "scalar", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 2, name: "AlterClickhouse", kind: "scalar", jsonName: "AlterClickhouse", T: 8 /*ScalarType.BOOL*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Execute AlterTAble on clickhouse" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ProjectID"] } } });
    }
    create(value?: PartialMessage<RestoreMetadatasRequest>): RestoreMetadatasRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.projectID = "";
        message.alterClickhouse = false;
        if (value !== undefined)
            reflectionMergePartial<RestoreMetadatasRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestoreMetadatasRequest): RestoreMetadatasRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string ProjectID = 1 [json_name = "ProjectID"];*/ 1:
                    message.projectID = reader.string();
                    break;
                case /* bool AlterClickhouse = 2 [json_name = "AlterClickhouse"];*/ 2:
                    message.alterClickhouse = reader.bool();
                    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: RestoreMetadatasRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string ProjectID = 1 [json_name = "ProjectID"]; */
        if (message.projectID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.projectID);
        /* bool AlterClickhouse = 2 [json_name = "AlterClickhouse"]; */
        if (message.alterClickhouse !== false)
            writer.tag(2, WireType.Varint).bool(message.alterClickhouse);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.RestoreMetadatasRequest
 */
export const RestoreMetadatasRequest = new RestoreMetadatasRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RestoreMetadatasResult$Type extends MessageType<RestoreMetadatasResult> {
    constructor() {
        super("api.RestoreMetadatasResult", []);
    }
    create(value?: PartialMessage<RestoreMetadatasResult>): RestoreMetadatasResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<RestoreMetadatasResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestoreMetadatasResult): RestoreMetadatasResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                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: RestoreMetadatasResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.RestoreMetadatasResult
 */
export const RestoreMetadatasResult = new RestoreMetadatasResult$Type();
/**
 * @generated ServiceType for protobuf service api.MetadataService
 */
export const MetadataService = new ServiceType("api.MetadataService", [
    { name: "CreateMetadata", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Project Metadata"], description: "Create metadata" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: CreateMetadataRequest, O: CreateMetadataResult },
    { name: "UpdateMetadata", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Project Metadata"], description: "Update metadata" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: UpdateMetadataRequest, O: UpdateMetadataResult },
    { name: "GetMetadatas", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Project Metadata"], description: "Get metadata" }, "api.rscType": "Project", "api.roles": "Platform.Project-Metadata", "google.api.method_visibility": { restriction: "SDK" } }, I: GetMetadatasRequest, O: GetMetadatasResult },
    { name: "DeleteMetadatas", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Project Metadata"], description: "Delete metadata" }, "api.rscType": "Project", "api.roles": "Platform.Project-Metadata", "google.api.method_visibility": { restriction: "SDK" } }, I: DeleteMetadatasRequest, O: DeleteMetadatasResult },
    { name: "GetMetadataCount", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Project Metadata"], description: "Get metadata count" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetMetadataCountRequest, O: GetMetadataCountResult },
    { name: "GetTransitiveMetadatas", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Project Metadata"], description: "Get transitive metadata" }, "api.rscType": "Project", "api.roles": "Platform.Project-Metadata", "google.api.method_visibility": { restriction: "SDK" } }, I: GetTransitiveMetadatasRequest, O: GetTransitiveMetadatasResult },
    { name: "RestoreMetadatas", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin Project"], description: "Restore metadatas" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: RestoreMetadatasRequest, O: RestoreMetadatasResult }
], { "api.k8sService": "project-model-server" });
