/// <summary> /// /// </summary> /// <param name="address"></param> /// <param name="key"></param> /// <param name="collections"></param> /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param> /// <returns></returns> public async Task <ThreadId> NewDbFromAdd(string address, string key, IList <Models.CollectionInfo> collections, CancellationToken cancellationToken = default) { Multiaddress addr = Multiaddress.Decode(address); byte[] keyBytes = ThreadKey.FromString(key).Bytes; NewDBFromAddrRequest request = new() { Addr = ByteString.CopyFrom(addr.ToBytes()), Key = ByteString.CopyFrom(keyBytes) }; if (collections != null) { //TODO: Finish mapping request.Collections.AddRange(collections.Select(c => { return(_mapper.Map <Grpc.CollectionConfig>(c)); }).ToArray()); } await _apiClient.NewDBFromAddrAsync(request, headers : _threadContext.Metadata, cancellationToken : cancellationToken); //TODO: Get the threadID and Address string threadId = string.Empty; return(ThreadId.FromString(threadId)); }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncDeltaNewGroupThread("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey == null ? "<null>" : ThreadKey.ToString()); } if (Participants != null && __isset.Participants) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Participants: "); __sb.Append(Participants); } __sb.Append(")"); return(__sb.ToString()); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncDeltaThreadMuteSettings"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (__isset.ExpireTime) { field.Name = "ExpireTime"; field.Type = TType.I64; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteI64(ExpireTime); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncDeltaPagesManagerEvent("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey == null ? "<null>" : ThreadKey.ToString()); } if (JsonBlob != null && __isset.JsonBlob) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("JsonBlob: "); __sb.Append(JsonBlob); } __sb.Append(")"); return(__sb.ToString()); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncDeltaPagesManagerEvent"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (JsonBlob != null && __isset.JsonBlob) { field.Name = "JsonBlob"; field.Type = TType.String; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteString(JsonBlob); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncDeltaMessageDelete("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey == null ? "<null>" : ThreadKey.ToString()); } if (MessageIds != null && __isset.MessageIds) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("MessageIds: "); __sb.Append(MessageIds); } __sb.Append(")"); return(__sb.ToString()); }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncDeltaThreadMuteSettings("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey == null ? "<null>" : ThreadKey.ToString()); } if (__isset.ExpireTime) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ExpireTime: "); __sb.Append(ExpireTime); } __sb.Append(")"); return(__sb.ToString()); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncDeltaReadReceipt"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (__isset.ActorFbId) { field.Name = "ActorFbId"; field.Type = TType.I64; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteI64(ActorFbId); oprot.WriteFieldEnd(); } if (__isset.ActionTimestampMs) { field.Name = "ActionTimestampMs"; field.Type = TType.I64; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteI64(ActionTimestampMs); oprot.WriteFieldEnd(); } if (__isset.WatermarkTimestampMs) { field.Name = "WatermarkTimestampMs"; field.Type = TType.I64; field.ID = 4; oprot.WriteFieldBegin(field); oprot.WriteI64(WatermarkTimestampMs); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
/// <summary> /// /// </summary> /// <param name="dbId">The ID of the database.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param> /// <returns></returns> public async Task <DBInfo> GetDbInfoAsync(ThreadId dbId, CancellationToken cancellationToken = default) { GetDBInfoRequest request = new() { DbID = ByteString.CopyFrom(dbId.Bytes) }; GetDBInfoReply dbInfo = await _apiClient.GetDBInfoAsync(request, headers : _threadContext.Metadata, cancellationToken : cancellationToken); return(new DBInfo() { Key = ThreadKey.FromBytes(dbInfo.Key.ToByteArray()).ToString(), Addrs = dbInfo.Addrs.Select(addr => Multiaddress.Decode(addr.ToByteArray()).ToString()).ToList() }); }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncDeltaReadReceipt("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey == null ? "<null>" : ThreadKey.ToString()); } if (__isset.ActorFbId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ActorFbId: "); __sb.Append(ActorFbId); } if (__isset.ActionTimestampMs) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ActionTimestampMs: "); __sb.Append(ActionTimestampMs); } if (__isset.WatermarkTimestampMs) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("WatermarkTimestampMs: "); __sb.Append(WatermarkTimestampMs); } __sb.Append(")"); return(__sb.ToString()); }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncDeltaNotificationSettings("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey== null ? "<null>" : ThreadKey.ToString()); } if (DoNotDisturbRanges != null && __isset.DoNotDisturbRanges) { if(!__first) { __sb.Append(", "); } __first = false; __sb.Append("DoNotDisturbRanges: "); __sb.Append(DoNotDisturbRanges); } __sb.Append(")"); return __sb.ToString(); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncDeltaForcedFetch"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (MessageId != null && __isset.MessageId) { field.Name = "MessageId"; field.Type = TType.String; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteString(MessageId); oprot.WriteFieldEnd(); } if (__isset.IsLazy) { field.Name = "IsLazy"; field.Type = TType.Bool; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteBool(IsLazy); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncDeltaNewGroupThread"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (Participants != null && __isset.Participants) { field.Name = "Participants"; field.Type = TType.List; field.ID = 2; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, Participants.Count)); foreach (MNMessagesSyncParticipantInfo _iter38 in Participants) { _iter38.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncDeltaMessageDelete"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (MessageIds != null && __isset.MessageIds) { field.Name = "MessageIds"; field.Type = TType.List; field.ID = 2; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.String, MessageIds.Count)); foreach (string _iter58 in MessageIds) { oprot.WriteString(_iter58); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncDeltaNotificationSettings"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (DoNotDisturbRanges != null && __isset.DoNotDisturbRanges) { field.Name = "DoNotDisturbRanges"; field.Type = TType.List; field.ID = 2; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, DoNotDisturbRanges.Count)); foreach (MNMessagesSyncNotificationDoNotDisturbRange _iter119 in DoNotDisturbRanges) { _iter119.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncDeltaForcedFetch("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey == null ? "<null>" : ThreadKey.ToString()); } if (MessageId != null && __isset.MessageId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("MessageId: "); __sb.Append(MessageId); } if (__isset.IsLazy) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("IsLazy: "); __sb.Append(IsLazy); } __sb.Append(")"); return(__sb.ToString()); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncMessageMetadata"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (MessageId != null && __isset.MessageId) { field.Name = "MessageId"; field.Type = TType.String; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteString(MessageId); oprot.WriteFieldEnd(); } if (__isset.OfflineThreadingId) { field.Name = "OfflineThreadingId"; field.Type = TType.I64; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteI64(OfflineThreadingId); oprot.WriteFieldEnd(); } if (__isset.ActorFbId) { field.Name = "ActorFbId"; field.Type = TType.I64; field.ID = 4; oprot.WriteFieldBegin(field); oprot.WriteI64(ActorFbId); oprot.WriteFieldEnd(); } if (__isset.Timestamp) { field.Name = "Timestamp"; field.Type = TType.I64; field.ID = 5; oprot.WriteFieldBegin(field); oprot.WriteI64(Timestamp); oprot.WriteFieldEnd(); } if (__isset.ShouldBuzzDevice) { field.Name = "ShouldBuzzDevice"; field.Type = TType.Bool; field.ID = 6; oprot.WriteFieldBegin(field); oprot.WriteBool(ShouldBuzzDevice); oprot.WriteFieldEnd(); } if (AdminText != null && __isset.AdminText) { field.Name = "AdminText"; field.Type = TType.String; field.ID = 7; oprot.WriteFieldBegin(field); oprot.WriteString(AdminText); oprot.WriteFieldEnd(); } if (Tags != null && __isset.Tags) { field.Name = "Tags"; field.Type = TType.List; field.ID = 9; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.String, Tags.Count)); foreach (string _iter25 in Tags) { oprot.WriteString(_iter25); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncMessageMetadata("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey == null ? "<null>" : ThreadKey.ToString()); } if (MessageId != null && __isset.MessageId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("MessageId: "); __sb.Append(MessageId); } if (__isset.OfflineThreadingId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("OfflineThreadingId: "); __sb.Append(OfflineThreadingId); } if (__isset.ActorFbId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ActorFbId: "); __sb.Append(ActorFbId); } if (__isset.Timestamp) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Timestamp: "); __sb.Append(Timestamp); } if (__isset.ShouldBuzzDevice) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ShouldBuzzDevice: "); __sb.Append(ShouldBuzzDevice); } if (AdminText != null && __isset.AdminText) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("AdminText: "); __sb.Append(AdminText); } if (Tags != null && __isset.Tags) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Tags: "); __sb.Append(Tags); } __sb.Append(")"); return(__sb.ToString()); }
public override string ToString() { StringBuilder __sb = new StringBuilder("MNMessagesSyncDeltaDeliveryReceipt("); bool __first = true; if (ThreadKey != null && __isset.ThreadKey) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ThreadKey: "); __sb.Append(ThreadKey == null ? "<null>" : ThreadKey.ToString()); } if (__isset.ActorFbId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("ActorFbId: "); __sb.Append(ActorFbId); } if (DeviceId != null && __isset.DeviceId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("DeviceId: "); __sb.Append(DeviceId); } if (__isset.AppId) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("AppId: "); __sb.Append(AppId); } if (__isset.TimestampMs) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("TimestampMs: "); __sb.Append(TimestampMs); } if (MessageIds != null && __isset.MessageIds) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("MessageIds: "); __sb.Append(MessageIds); } if (__isset.DeliveredWatermarkTimestampMs) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("DeliveredWatermarkTimestampMs: "); __sb.Append(DeliveredWatermarkTimestampMs); } __sb.Append(")"); return(__sb.ToString()); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("MNMessagesSyncDeltaDeliveryReceipt"); oprot.WriteStructBegin(struc); TField field = new TField(); if (ThreadKey != null && __isset.ThreadKey) { field.Name = "ThreadKey"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); ThreadKey.Write(oprot); oprot.WriteFieldEnd(); } if (__isset.ActorFbId) { field.Name = "ActorFbId"; field.Type = TType.I64; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteI64(ActorFbId); oprot.WriteFieldEnd(); } if (DeviceId != null && __isset.DeviceId) { field.Name = "DeviceId"; field.Type = TType.String; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteString(DeviceId); oprot.WriteFieldEnd(); } if (__isset.AppId) { field.Name = "AppId"; field.Type = TType.I64; field.ID = 4; oprot.WriteFieldBegin(field); oprot.WriteI64(AppId); oprot.WriteFieldEnd(); } if (__isset.TimestampMs) { field.Name = "TimestampMs"; field.Type = TType.I64; field.ID = 5; oprot.WriteFieldBegin(field); oprot.WriteI64(TimestampMs); oprot.WriteFieldEnd(); } if (MessageIds != null && __isset.MessageIds) { field.Name = "MessageIds"; field.Type = TType.List; field.ID = 6; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.String, MessageIds.Count)); foreach (string _iter110 in MessageIds) { oprot.WriteString(_iter110); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } if (__isset.DeliveredWatermarkTimestampMs) { field.Name = "DeliveredWatermarkTimestampMs"; field.Type = TType.I64; field.ID = 7; oprot.WriteFieldBegin(field); oprot.WriteI64(DeliveredWatermarkTimestampMs); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }