// @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
// @generated from file item.proto (package api, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import { AttachmentSummary, EntityID, EventHeader, MetadataElement } from "./shared_pb.js";
import { ExpiryConstraint, ItemStatusStruct, LogisticVariant, TradeItemDescriptions } from "./repositoryShared_pb.js";

/**
 *
 * Aggregation object message
 *
 * @generated from message api.Item
 */
export class Item extends Message<Item> {
  /**
   * @generated from field: api.EventHeader LastEventHeader = 1;
   */
  LastEventHeader?: EventHeader;

  /**
   * @generated from field: api.EntityID ID = 2;
   */
  ID?: EntityID;

  /**
   * @generated from field: api.ItemPayload Payload = 3;
   */
  Payload?: ItemPayload;

  constructor(data?: PartialMessage<Item>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "api.Item";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "LastEventHeader", kind: "message", T: EventHeader },
    { no: 2, name: "ID", kind: "message", T: EntityID },
    { no: 3, name: "Payload", kind: "message", T: ItemPayload },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Item {
    return new Item().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Item {
    return new Item().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Item {
    return new Item().fromJsonString(jsonString, options);
  }

  static equals(a: Item | PlainMessage<Item> | undefined, b: Item | PlainMessage<Item> | undefined): boolean {
    return proto3.util.equals(Item, a, b);
  }
}

/**
 * @generated from message api.ItemPayload
 */
export class ItemPayload extends Message<ItemPayload> {
  /**
   * Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)
   *
   * @generated from field: repeated api.MetadataElement MetaData = 1;
   */
  MetaData: MetadataElement[] = [];

  /**
   * Item components
   *
   * @generated from field: api.ExpiryConstraint ExpiryConstraint = 6;
   */
  ExpiryConstraint?: ExpiryConstraint;

  /**
   * @generated from field: string PhotoURI = 7;
   */
  PhotoURI = "";

  /**
   * @option language
   *
   * @generated from field: repeated api.TradeItemDescriptions DescriptionsByLanguage = 3;
   */
  DescriptionsByLanguage: TradeItemDescriptions[] = [];

  /**
   * @generated from field: repeated api.LogisticVariant LogisticVariants = 4;
   */
  LogisticVariants: LogisticVariant[] = [];

  /**
   * Status field is not accessible from APIs
   *
   * @generated from field: api.ItemStatusStruct Status = 5;
   */
  Status?: ItemStatusStruct;

  /**
   * @generated from field: repeated api.AttachmentSummary Attachments = 8;
   */
  Attachments: AttachmentSummary[] = [];

  /**
   * @generated from field: int32 AttachmentNumber = 9;
   */
  AttachmentNumber = 0;

  /**
   * @generated from field: repeated string RemovedLogisticVariantIDs = 10;
   */
  RemovedLogisticVariantIDs: string[] = [];

  constructor(data?: PartialMessage<ItemPayload>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "api.ItemPayload";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "MetaData", kind: "message", T: MetadataElement, repeated: true },
    { no: 6, name: "ExpiryConstraint", kind: "message", T: ExpiryConstraint },
    { no: 7, name: "PhotoURI", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 3, name: "DescriptionsByLanguage", kind: "message", T: TradeItemDescriptions, repeated: true },
    { no: 4, name: "LogisticVariants", kind: "message", T: LogisticVariant, repeated: true },
    { no: 5, name: "Status", kind: "message", T: ItemStatusStruct },
    { no: 8, name: "Attachments", kind: "message", T: AttachmentSummary, repeated: true },
    { no: 9, name: "AttachmentNumber", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 10, name: "RemovedLogisticVariantIDs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ItemPayload {
    return new ItemPayload().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ItemPayload {
    return new ItemPayload().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ItemPayload {
    return new ItemPayload().fromJsonString(jsonString, options);
  }

  static equals(a: ItemPayload | PlainMessage<ItemPayload> | undefined, b: ItemPayload | PlainMessage<ItemPayload> | undefined): boolean {
    return proto3.util.equals(ItemPayload, a, b);
  }
}

/**
 * @generated from message api.ItemTriplet
 */
export class ItemTriplet extends Message<ItemTriplet> {
  /**
   * @generated from field: api.Item Current = 1;
   */
  Current?: Item;

  /**
   * @generated from field: api.Item Previous = 2;
   */
  Previous?: Item;

  /**
   * @generated from field: api.Item LastEvent = 3;
   */
  LastEvent?: Item;

  constructor(data?: PartialMessage<ItemTriplet>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "api.ItemTriplet";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "Current", kind: "message", T: Item },
    { no: 2, name: "Previous", kind: "message", T: Item },
    { no: 3, name: "LastEvent", kind: "message", T: Item },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ItemTriplet {
    return new ItemTriplet().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ItemTriplet {
    return new ItemTriplet().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ItemTriplet {
    return new ItemTriplet().fromJsonString(jsonString, options);
  }

  static equals(a: ItemTriplet | PlainMessage<ItemTriplet> | undefined, b: ItemTriplet | PlainMessage<ItemTriplet> | undefined): boolean {
    return proto3.util.equals(ItemTriplet, a, b);
  }
}

