Struct GroupId
- Namespace
- Signal.Domain.ValueObjects
- Assembly
- Signal.Domain.dll
A group identifier in the form used by the REST API: group. followed by the base64 encoded signal-cli internal id.
public readonly record struct GroupId : IParsable<GroupId>, IEquatable<GroupId>
- Implements
- Inherited Members
Remarks
Received envelopes carry the internal id, while REST endpoints and /v2/send recipients expect the
group.… form. Use FromInternalId(string) and InternalId to convert between the two.
Fields
Prefix
The prefix of every REST API group id.
public const string Prefix = "group."
Field Value
Properties
InternalId
The signal-cli internal id (the form used inside received envelopes).
public string InternalId { get; }
Property Value
Exceptions
- FormatException
The part after Prefix is not valid base64.
Value
The REST API form, e.g. group.ZWtKTm....
public string Value { get; }
Property Value
Methods
FromInternalId(string)
Creates the REST API id from the signal-cli internal id found in received messages.
public static GroupId FromInternalId(string internalId)
Parameters
internalIdstringThe internal id, e.g. the
groupInfo.groupIdof an envelope.
Returns
- GroupId
The REST API group id (
group.+ base64 ofinternalId).
Parse(string)
Parses a REST API group id.
public static GroupId Parse(string value)
Parameters
Returns
- GroupId
The group id.
Exceptions
- InvalidRecipientException
valuedoes not start with Prefix.
ToString()
Returns Value.
public override string ToString()
Returns
TryParse(string?, out GroupId)
Tries to parse a REST API group id.
public static bool TryParse(string? value, out GroupId id)