Table of Contents

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

string

Properties

InternalId

The signal-cli internal id (the form used inside received envelopes).

public string InternalId { get; }

Property Value

string

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

string

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

internalId string

The internal id, e.g. the groupInfo.groupId of an envelope.

Returns

GroupId

The REST API group id (group. + base64 of internalId).

Parse(string)

Parses a REST API group id.

public static GroupId Parse(string value)

Parameters

value string

A value starting with Prefix.

Returns

GroupId

The group id.

Exceptions

InvalidRecipientException

value does not start with Prefix.

ToString()

Returns Value.

public override string ToString()

Returns

string

The REST API form, or an empty string for default.

TryParse(string?, out GroupId)

Tries to parse a REST API group id.

public static bool TryParse(string? value, out GroupId id)

Parameters

value string

A value starting with Prefix.

id GroupId

The group id when the method returns true.

Returns

bool

true if value is a group id.