// // automatically generated by the FlatBuffers compiler, do not modify // namespace SCHALE.Common.FlatData { using global::System; using global::System.Collections.Generic; using global::SCHALE.Common.Crypto; using global::Google.FlatBuffers; public struct ProductExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static ProductExcel GetRootAsProductExcel(ByteBuffer _bb) { return GetRootAsProductExcel(_bb, new ProductExcel()); } public static ProductExcel GetRootAsProductExcel(ByteBuffer _bb, ProductExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public ProductExcel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public long Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public string ProductId { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetProductIdBytes() { return __p.__vector_as_span(6, 1); } #else public ArraySegment? GetProductIdBytes() { return __p.__vector_as_arraysegment(6); } #endif public byte[] GetProductIdArray() { return __p.__vector_as_array(6); } public SCHALE.Common.FlatData.StoreType StoreType { get { int o = __p.__offset(8); return o != 0 ? (SCHALE.Common.FlatData.StoreType)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.StoreType.None; } } public long Price { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public string PriceReference { get { int o = __p.__offset(12); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetPriceReferenceBytes() { return __p.__vector_as_span(12, 1); } #else public ArraySegment? GetPriceReferenceBytes() { return __p.__vector_as_arraysegment(12); } #endif public byte[] GetPriceReferenceArray() { return __p.__vector_as_array(12); } public SCHALE.Common.FlatData.PurchasePeriodType PurchasePeriodType { get { int o = __p.__offset(14); return o != 0 ? (SCHALE.Common.FlatData.PurchasePeriodType)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.PurchasePeriodType.None; } } public long PurchasePeriodLimit { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public SCHALE.Common.FlatData.ParcelType ParcelType_(int j) { int o = __p.__offset(18); return o != 0 ? (SCHALE.Common.FlatData.ParcelType)__p.bb.GetInt(__p.__vector(o) + j * 4) : (SCHALE.Common.FlatData.ParcelType)0; } public int ParcelType_Length { get { int o = __p.__offset(18); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetParcelType_Bytes() { return __p.__vector_as_span(18, 4); } #else public ArraySegment? GetParcelType_Bytes() { return __p.__vector_as_arraysegment(18); } #endif public SCHALE.Common.FlatData.ParcelType[] GetParcelType_Array() { int o = __p.__offset(18); if (o == 0) return null; int p = __p.__vector(o); int l = __p.__vector_len(o); SCHALE.Common.FlatData.ParcelType[] a = new SCHALE.Common.FlatData.ParcelType[l]; for (int i = 0; i < l; i++) { a[i] = (SCHALE.Common.FlatData.ParcelType)__p.bb.GetInt(p + i * 4); } return a; } public long ParcelId(int j) { int o = __p.__offset(20); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int ParcelIdLength { get { int o = __p.__offset(20); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetParcelIdBytes() { return __p.__vector_as_span(20, 8); } #else public ArraySegment? GetParcelIdBytes() { return __p.__vector_as_arraysegment(20); } #endif public long[] GetParcelIdArray() { return __p.__vector_as_array(20); } public long ParcelAmount(int j) { int o = __p.__offset(22); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int ParcelAmountLength { get { int o = __p.__offset(22); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetParcelAmountBytes() { return __p.__vector_as_span(22, 8); } #else public ArraySegment? GetParcelAmountBytes() { return __p.__vector_as_arraysegment(22); } #endif public long[] GetParcelAmountArray() { return __p.__vector_as_array(22); } public static Offset CreateProductExcel(FlatBufferBuilder builder, long Id = 0, StringOffset ProductIdOffset = default(StringOffset), SCHALE.Common.FlatData.StoreType StoreType = SCHALE.Common.FlatData.StoreType.None, long Price = 0, StringOffset PriceReferenceOffset = default(StringOffset), SCHALE.Common.FlatData.PurchasePeriodType PurchasePeriodType = SCHALE.Common.FlatData.PurchasePeriodType.None, long PurchasePeriodLimit = 0, VectorOffset ParcelType_Offset = default(VectorOffset), VectorOffset ParcelIdOffset = default(VectorOffset), VectorOffset ParcelAmountOffset = default(VectorOffset)) { builder.StartTable(10); ProductExcel.AddPurchasePeriodLimit(builder, PurchasePeriodLimit); ProductExcel.AddPrice(builder, Price); ProductExcel.AddId(builder, Id); ProductExcel.AddParcelAmount(builder, ParcelAmountOffset); ProductExcel.AddParcelId(builder, ParcelIdOffset); ProductExcel.AddParcelType_(builder, ParcelType_Offset); ProductExcel.AddPurchasePeriodType(builder, PurchasePeriodType); ProductExcel.AddPriceReference(builder, PriceReferenceOffset); ProductExcel.AddStoreType(builder, StoreType); ProductExcel.AddProductId(builder, ProductIdOffset); return ProductExcel.EndProductExcel(builder); } public static void StartProductExcel(FlatBufferBuilder builder) { builder.StartTable(10); } public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); } public static void AddProductId(FlatBufferBuilder builder, StringOffset productIdOffset) { builder.AddOffset(1, productIdOffset.Value, 0); } public static void AddStoreType(FlatBufferBuilder builder, SCHALE.Common.FlatData.StoreType storeType) { builder.AddInt(2, (int)storeType, 0); } public static void AddPrice(FlatBufferBuilder builder, long price) { builder.AddLong(3, price, 0); } public static void AddPriceReference(FlatBufferBuilder builder, StringOffset priceReferenceOffset) { builder.AddOffset(4, priceReferenceOffset.Value, 0); } public static void AddPurchasePeriodType(FlatBufferBuilder builder, SCHALE.Common.FlatData.PurchasePeriodType purchasePeriodType) { builder.AddInt(5, (int)purchasePeriodType, 0); } public static void AddPurchasePeriodLimit(FlatBufferBuilder builder, long purchasePeriodLimit) { builder.AddLong(6, purchasePeriodLimit, 0); } public static void AddParcelType_(FlatBufferBuilder builder, VectorOffset parcelType_Offset) { builder.AddOffset(7, parcelType_Offset.Value, 0); } public static VectorOffset CreateParcelType_Vector(FlatBufferBuilder builder, SCHALE.Common.FlatData.ParcelType[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt((int)data[i]); return builder.EndVector(); } public static VectorOffset CreateParcelType_VectorBlock(FlatBufferBuilder builder, SCHALE.Common.FlatData.ParcelType[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateParcelType_VectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateParcelType_VectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartParcelType_Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } public static void AddParcelId(FlatBufferBuilder builder, VectorOffset parcelIdOffset) { builder.AddOffset(8, parcelIdOffset.Value, 0); } public static VectorOffset CreateParcelIdVector(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddLong(data[i]); return builder.EndVector(); } public static VectorOffset CreateParcelIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateParcelIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateParcelIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartParcelIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static void AddParcelAmount(FlatBufferBuilder builder, VectorOffset parcelAmountOffset) { builder.AddOffset(9, parcelAmountOffset.Value, 0); } public static VectorOffset CreateParcelAmountVector(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddLong(data[i]); return builder.EndVector(); } public static VectorOffset CreateParcelAmountVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateParcelAmountVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateParcelAmountVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartParcelAmountVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static Offset EndProductExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public ProductExcelT UnPack() { var _o = new ProductExcelT(); this.UnPackTo(_o); return _o; } public void UnPackTo(ProductExcelT _o) { byte[] key = TableEncryptionService.CreateKey("Product"); _o.Id = TableEncryptionService.Convert(this.Id, key); _o.ProductId = TableEncryptionService.Convert(this.ProductId, key); _o.StoreType = TableEncryptionService.Convert(this.StoreType, key); _o.Price = TableEncryptionService.Convert(this.Price, key); _o.PriceReference = TableEncryptionService.Convert(this.PriceReference, key); _o.PurchasePeriodType = TableEncryptionService.Convert(this.PurchasePeriodType, key); _o.PurchasePeriodLimit = TableEncryptionService.Convert(this.PurchasePeriodLimit, key); _o.ParcelType_ = new List(); for (var _j = 0; _j < this.ParcelType_Length; ++_j) {_o.ParcelType_.Add(TableEncryptionService.Convert(this.ParcelType_(_j), key));} _o.ParcelId = new List(); for (var _j = 0; _j < this.ParcelIdLength; ++_j) {_o.ParcelId.Add(TableEncryptionService.Convert(this.ParcelId(_j), key));} _o.ParcelAmount = new List(); for (var _j = 0; _j < this.ParcelAmountLength; ++_j) {_o.ParcelAmount.Add(TableEncryptionService.Convert(this.ParcelAmount(_j), key));} } public static Offset Pack(FlatBufferBuilder builder, ProductExcelT _o) { if (_o == null) return default(Offset); var _ProductId = _o.ProductId == null ? default(StringOffset) : builder.CreateString(_o.ProductId); var _PriceReference = _o.PriceReference == null ? default(StringOffset) : builder.CreateString(_o.PriceReference); var _ParcelType_ = default(VectorOffset); if (_o.ParcelType_ != null) { var __ParcelType_ = _o.ParcelType_.ToArray(); _ParcelType_ = CreateParcelType_Vector(builder, __ParcelType_); } var _ParcelId = default(VectorOffset); if (_o.ParcelId != null) { var __ParcelId = _o.ParcelId.ToArray(); _ParcelId = CreateParcelIdVector(builder, __ParcelId); } var _ParcelAmount = default(VectorOffset); if (_o.ParcelAmount != null) { var __ParcelAmount = _o.ParcelAmount.ToArray(); _ParcelAmount = CreateParcelAmountVector(builder, __ParcelAmount); } return CreateProductExcel( builder, _o.Id, _ProductId, _o.StoreType, _o.Price, _PriceReference, _o.PurchasePeriodType, _o.PurchasePeriodLimit, _ParcelType_, _ParcelId, _ParcelAmount); } } public class ProductExcelT { public long Id { get; set; } public string ProductId { get; set; } public SCHALE.Common.FlatData.StoreType StoreType { get; set; } public long Price { get; set; } public string PriceReference { get; set; } public SCHALE.Common.FlatData.PurchasePeriodType PurchasePeriodType { get; set; } public long PurchasePeriodLimit { get; set; } public List ParcelType_ { get; set; } public List ParcelId { get; set; } public List ParcelAmount { get; set; } public ProductExcelT() { this.Id = 0; this.ProductId = null; this.StoreType = SCHALE.Common.FlatData.StoreType.None; this.Price = 0; this.PriceReference = null; this.PurchasePeriodType = SCHALE.Common.FlatData.PurchasePeriodType.None; this.PurchasePeriodLimit = 0; this.ParcelType_ = null; this.ParcelId = null; this.ParcelAmount = null; } } static public class ProductExcelVerify { static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyField(tablePos, 4 /*Id*/, 8 /*long*/, 8, false) && verifier.VerifyString(tablePos, 6 /*ProductId*/, false) && verifier.VerifyField(tablePos, 8 /*StoreType*/, 4 /*SCHALE.Common.FlatData.StoreType*/, 4, false) && verifier.VerifyField(tablePos, 10 /*Price*/, 8 /*long*/, 8, false) && verifier.VerifyString(tablePos, 12 /*PriceReference*/, false) && verifier.VerifyField(tablePos, 14 /*PurchasePeriodType*/, 4 /*SCHALE.Common.FlatData.PurchasePeriodType*/, 4, false) && verifier.VerifyField(tablePos, 16 /*PurchasePeriodLimit*/, 8 /*long*/, 8, false) && verifier.VerifyVectorOfData(tablePos, 18 /*ParcelType_*/, 4 /*SCHALE.Common.FlatData.ParcelType*/, false) && verifier.VerifyVectorOfData(tablePos, 20 /*ParcelId*/, 8 /*long*/, false) && verifier.VerifyVectorOfData(tablePos, 22 /*ParcelAmount*/, 8 /*long*/, false) && verifier.VerifyTableEnd(tablePos); } } }