mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-08-29 06:06:22 +00:00
Add required = true to all the required attributes
This commit is contained in:
parent
9580ab0777
commit
04b7b1e47d
@ -7,7 +7,10 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "AdminDelete")
|
||||
public record JsonAdminDelete(
|
||||
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
||||
@Schema(required = true) @Deprecated String targetAuthor,
|
||||
@Schema(required = true) String targetAuthorNumber,
|
||||
@Schema(required = true) String targetAuthorUuid,
|
||||
@Schema(required = true) long targetSentTimestamp
|
||||
) {
|
||||
|
||||
static JsonAdminDelete from(MessageEnvelope.Data.AdminDelete adminDelete) {
|
||||
|
||||
@ -5,14 +5,14 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@Schema(name = "Attachment")
|
||||
record JsonAttachment(
|
||||
String contentType,
|
||||
String filename,
|
||||
String id,
|
||||
Long size,
|
||||
Integer width,
|
||||
Integer height,
|
||||
String caption,
|
||||
Long uploadTimestamp
|
||||
@Schema(required = true) String contentType,
|
||||
@Schema(required = true) String filename,
|
||||
@Schema(required = true) String id,
|
||||
@Schema(required = true) Long size,
|
||||
@Schema(required = true) Integer width,
|
||||
@Schema(required = true) Integer height,
|
||||
@Schema(required = true) String caption,
|
||||
@Schema(required = true) Long uploadTimestamp
|
||||
) {
|
||||
|
||||
static JsonAttachment from(MessageEnvelope.Data.Attachment attachment) {
|
||||
|
||||
@ -25,35 +25,49 @@ record JsonCallMessage(
|
||||
callMessage.iceUpdate().stream().map(IceUpdate::from).toList());
|
||||
}
|
||||
|
||||
record Offer(long id, String type, String opaque) {
|
||||
record Offer(
|
||||
@Schema(required = true) long id,
|
||||
@Schema(required = true) String type,
|
||||
@Schema(required = true) String opaque
|
||||
) {
|
||||
|
||||
public static Offer from(final MessageEnvelope.Call.Offer offer) {
|
||||
return new Offer(offer.id(), offer.type().name(), Base64.getEncoder().encodeToString(offer.opaque()));
|
||||
}
|
||||
}
|
||||
|
||||
public record Answer(long id, String opaque) {
|
||||
public record Answer(
|
||||
@Schema(required = true) long id,
|
||||
@Schema(required = true) String opaque
|
||||
) {
|
||||
|
||||
public static Answer from(final MessageEnvelope.Call.Answer answer) {
|
||||
return new Answer(answer.id(), Base64.getEncoder().encodeToString(answer.opaque()));
|
||||
}
|
||||
}
|
||||
|
||||
public record Busy(long id) {
|
||||
public record Busy(@Schema(required = true) long id) {
|
||||
|
||||
public static Busy from(final MessageEnvelope.Call.Busy busy) {
|
||||
return new Busy(busy.id());
|
||||
}
|
||||
}
|
||||
|
||||
public record Hangup(long id, String type, int deviceId) {
|
||||
public record Hangup(
|
||||
@Schema(required = true) long id,
|
||||
@Schema(required = true) String type,
|
||||
@Schema(required = true) int deviceId
|
||||
) {
|
||||
|
||||
public static Hangup from(final MessageEnvelope.Call.Hangup hangup) {
|
||||
return new Hangup(hangup.id(), hangup.type().name(), hangup.deviceId());
|
||||
}
|
||||
}
|
||||
|
||||
public record IceUpdate(long id, String opaque) {
|
||||
public record IceUpdate(
|
||||
@Schema(required = true) long id,
|
||||
@Schema(required = true) String opaque
|
||||
) {
|
||||
|
||||
public static IceUpdate from(final MessageEnvelope.Call.IceUpdate iceUpdate) {
|
||||
return new IceUpdate(iceUpdate.id(), Base64.getEncoder().encodeToString(iceUpdate.opaque()));
|
||||
|
||||
@ -6,15 +6,15 @@ import org.asamk.signal.util.Util;
|
||||
|
||||
@Schema(name = "ContactAddress")
|
||||
public record JsonContactAddress(
|
||||
String type,
|
||||
String label,
|
||||
String street,
|
||||
String pobox,
|
||||
String neighborhood,
|
||||
String city,
|
||||
String region,
|
||||
String postcode,
|
||||
String country
|
||||
@Schema(required = true) String type,
|
||||
@Schema(required = true) String label,
|
||||
@Schema(required = true) String street,
|
||||
@Schema(required = true) String pobox,
|
||||
@Schema(required = true) String neighborhood,
|
||||
@Schema(required = true) String city,
|
||||
@Schema(required = true) String region,
|
||||
@Schema(required = true) String postcode,
|
||||
@Schema(required = true) String country
|
||||
) {
|
||||
|
||||
static JsonContactAddress from(MessageEnvelope.Data.SharedContact.Address address) {
|
||||
|
||||
@ -4,7 +4,10 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@Schema(name = "ContactAvatar")
|
||||
public record JsonContactAvatar(JsonAttachment attachment, boolean isProfile) {
|
||||
public record JsonContactAvatar(
|
||||
@Schema(required = true) JsonAttachment attachment,
|
||||
@Schema(required = true) boolean isProfile
|
||||
) {
|
||||
|
||||
static JsonContactAvatar from(MessageEnvelope.Data.SharedContact.Avatar avatar) {
|
||||
return new JsonContactAvatar(JsonAttachment.from(avatar.attachment()), avatar.isProfile());
|
||||
|
||||
@ -5,7 +5,11 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
||||
@Schema(name = "ContactEmail")
|
||||
public record JsonContactEmail(String value, String type, String label) {
|
||||
public record JsonContactEmail(
|
||||
@Schema(required = true) String value,
|
||||
@Schema(required = true) String type,
|
||||
@Schema(required = true) String label
|
||||
) {
|
||||
|
||||
static JsonContactEmail from(MessageEnvelope.Data.SharedContact.Email email) {
|
||||
return new JsonContactEmail(email.value(), email.type().name(), Util.getStringIfNotBlank(email.label()));
|
||||
|
||||
@ -6,7 +6,12 @@ import org.asamk.signal.util.Util;
|
||||
|
||||
@Schema(name = "ContactName")
|
||||
public record JsonContactName(
|
||||
String nickname, String given, String family, String prefix, String suffix, String middle
|
||||
@Schema(required = true) String nickname,
|
||||
@Schema(required = true) String given,
|
||||
@Schema(required = true) String family,
|
||||
@Schema(required = true) String prefix,
|
||||
@Schema(required = true) String suffix,
|
||||
@Schema(required = true) String middle
|
||||
) {
|
||||
|
||||
static JsonContactName from(MessageEnvelope.Data.SharedContact.Name name) {
|
||||
|
||||
@ -5,7 +5,11 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
||||
@Schema(name = "ContactPhone")
|
||||
public record JsonContactPhone(String value, String type, String label) {
|
||||
public record JsonContactPhone(
|
||||
@Schema(required = true) String value,
|
||||
@Schema(required = true) String type,
|
||||
@Schema(required = true) String label
|
||||
) {
|
||||
|
||||
static JsonContactPhone from(MessageEnvelope.Data.SharedContact.Phone phone) {
|
||||
return new JsonContactPhone(phone.value(), phone.type().name(), Util.getStringIfNotBlank(phone.label()));
|
||||
|
||||
@ -10,9 +10,9 @@ import java.util.List;
|
||||
|
||||
@Schema(name = "DataMessage")
|
||||
record JsonDataMessage(
|
||||
long timestamp,
|
||||
String message,
|
||||
Integer expiresInSeconds,
|
||||
@Schema(required = true) long timestamp,
|
||||
@Schema(required = true) String message,
|
||||
@Schema(required = true) Integer expiresInSeconds,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) Boolean isExpirationUpdate,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) Boolean viewOnce,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonReaction reaction,
|
||||
|
||||
@ -5,7 +5,10 @@ import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@Schema(name = "EditMessage")
|
||||
record JsonEditMessage(long targetSentTimestamp, JsonDataMessage dataMessage) {
|
||||
record JsonEditMessage(
|
||||
@Schema(required = true) long targetSentTimestamp,
|
||||
@Schema(required = true) JsonDataMessage dataMessage
|
||||
) {
|
||||
|
||||
static JsonEditMessage from(MessageEnvelope.Edit editMessage, Manager m) {
|
||||
return new JsonEditMessage(editMessage.targetSentTimestamp(),
|
||||
|
||||
@ -5,7 +5,12 @@ import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@Schema(name = "GroupInfo")
|
||||
record JsonGroupInfo(String groupId, String groupName, int revision, String type) {
|
||||
record JsonGroupInfo(
|
||||
@Schema(required = true) String groupId,
|
||||
@Schema(required = true) String groupName,
|
||||
@Schema(required = true) int revision,
|
||||
@Schema(required = true) String type
|
||||
) {
|
||||
|
||||
static JsonGroupInfo from(MessageEnvelope.Data.GroupContext groupContext, Manager m) {
|
||||
return new JsonGroupInfo(groupContext.groupId().toBase64(),
|
||||
|
||||
@ -6,7 +6,13 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import java.util.UUID;
|
||||
|
||||
@Schema(name = "Mention")
|
||||
public record JsonMention(@Deprecated String name, String number, String uuid, int start, int length) {
|
||||
public record JsonMention(
|
||||
@Schema(required = true) @Deprecated String name,
|
||||
@Schema(required = true) String number,
|
||||
@Schema(required = true) String uuid,
|
||||
@Schema(required = true) int start,
|
||||
@Schema(required = true) int length
|
||||
) {
|
||||
|
||||
static JsonMention from(MessageEnvelope.Data.Mention mention) {
|
||||
final var address = mention.recipient();
|
||||
|
||||
@ -4,7 +4,10 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@Schema(name = "Payment")
|
||||
public record JsonPayment(String note, byte[] receipt) {
|
||||
public record JsonPayment(
|
||||
@Schema(required = true) String note,
|
||||
@Schema(required = true) byte[] receipt
|
||||
) {
|
||||
|
||||
static JsonPayment from(MessageEnvelope.Data.Payment payment) {
|
||||
return new JsonPayment(payment.note(), payment.receipt());
|
||||
|
||||
@ -7,11 +7,11 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "PinMessage")
|
||||
public record JsonPinMessage(
|
||||
@Deprecated String targetAuthor,
|
||||
String targetAuthorNumber,
|
||||
String targetAuthorUuid,
|
||||
long targetSentTimestamp,
|
||||
long pinDurationSeconds
|
||||
@Schema(required = true) @Deprecated String targetAuthor,
|
||||
@Schema(required = true) String targetAuthorNumber,
|
||||
@Schema(required = true) String targetAuthorUuid,
|
||||
@Schema(required = true) long targetSentTimestamp,
|
||||
@Schema(required = true) long pinDurationSeconds
|
||||
) {
|
||||
|
||||
static JsonPinMessage from(MessageEnvelope.Data.PinMessage pinMessage) {
|
||||
|
||||
@ -7,7 +7,9 @@ import java.util.List;
|
||||
|
||||
@Schema(name = "PollCreate")
|
||||
public record JsonPollCreate(
|
||||
String question, boolean allowMultiple, List<String> options
|
||||
@Schema(required = true) String question,
|
||||
@Schema(required = true) boolean allowMultiple,
|
||||
@Schema(required = true) List<String> options
|
||||
) {
|
||||
|
||||
static JsonPollCreate from(MessageEnvelope.Data.PollCreate pollCreate) {
|
||||
|
||||
@ -4,7 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@Schema(name = "PollTerminate")
|
||||
public record JsonPollTerminate(long targetSentTimestamp) {
|
||||
public record JsonPollTerminate(@Schema(required = true) long targetSentTimestamp) {
|
||||
|
||||
static JsonPollTerminate from(MessageEnvelope.Data.PollTerminate pollTerminate) {
|
||||
final var targetSentTimestamp = pollTerminate.targetSentTimestamp();
|
||||
|
||||
@ -8,12 +8,12 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "PollVote")
|
||||
public record JsonPollVote(
|
||||
@Deprecated String author,
|
||||
String authorNumber,
|
||||
String authorUuid,
|
||||
long targetSentTimestamp,
|
||||
List<Integer> optionIndexes,
|
||||
int voteCount
|
||||
@Schema(required = true) @Deprecated String author,
|
||||
@Schema(required = true) String authorNumber,
|
||||
@Schema(required = true) String authorUuid,
|
||||
@Schema(required = true) long targetSentTimestamp,
|
||||
@Schema(required = true) List<Integer> optionIndexes,
|
||||
@Schema(required = true) int voteCount
|
||||
) {
|
||||
|
||||
static JsonPollVote from(MessageEnvelope.Data.PollVote pollVote) {
|
||||
|
||||
@ -4,7 +4,12 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@Schema(name = "Preview")
|
||||
public record JsonPreview(String url, String title, String description, JsonAttachment image) {
|
||||
public record JsonPreview(
|
||||
@Schema(required = true) String url,
|
||||
@Schema(required = true) String title,
|
||||
@Schema(required = true) String description,
|
||||
@Schema(required = true) JsonAttachment image
|
||||
) {
|
||||
|
||||
static JsonPreview from(MessageEnvelope.Data.Preview preview) {
|
||||
return new JsonPreview(preview.url(),
|
||||
|
||||
@ -10,13 +10,13 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "Quote")
|
||||
public record JsonQuote(
|
||||
long id,
|
||||
@Deprecated String author,
|
||||
String authorNumber,
|
||||
String authorUuid,
|
||||
String text,
|
||||
@Schema(required = true) long id,
|
||||
@Schema(required = true) @Deprecated String author,
|
||||
@Schema(required = true) String authorNumber,
|
||||
@Schema(required = true) String authorUuid,
|
||||
@Schema(required = true) String text,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonMention> mentions,
|
||||
List<JsonQuotedAttachment> attachments,
|
||||
@Schema(required = true) List<JsonQuotedAttachment> attachments,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonTextStyle> textStyles
|
||||
) {
|
||||
|
||||
|
||||
@ -7,7 +7,9 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@Schema(name = "QuotedAttachment")
|
||||
public record JsonQuotedAttachment(
|
||||
String contentType, String filename, @JsonInclude(JsonInclude.Include.NON_NULL) JsonAttachment thumbnail
|
||||
@Schema(required = true) String contentType,
|
||||
@Schema(required = true) String filename,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonAttachment thumbnail
|
||||
) {
|
||||
|
||||
static JsonQuotedAttachment from(MessageEnvelope.Data.Attachment quotedAttachment) {
|
||||
|
||||
@ -7,12 +7,12 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "Reaction")
|
||||
public record JsonReaction(
|
||||
String emoji,
|
||||
@Deprecated String targetAuthor,
|
||||
String targetAuthorNumber,
|
||||
String targetAuthorUuid,
|
||||
long targetSentTimestamp,
|
||||
boolean isRemove
|
||||
@Schema(required = true) String emoji,
|
||||
@Schema(required = true) @Deprecated String targetAuthor,
|
||||
@Schema(required = true) String targetAuthorNumber,
|
||||
@Schema(required = true) String targetAuthorUuid,
|
||||
@Schema(required = true) long targetSentTimestamp,
|
||||
@Schema(required = true) boolean isRemove
|
||||
) {
|
||||
|
||||
static JsonReaction from(MessageEnvelope.Data.Reaction reaction) {
|
||||
|
||||
@ -6,7 +6,13 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(name = "ReceiptMessage")
|
||||
record JsonReceiptMessage(long when, boolean isDelivery, boolean isRead, boolean isViewed, List<Long> timestamps) {
|
||||
record JsonReceiptMessage(
|
||||
@Schema(required = true) long when,
|
||||
@Schema(required = true) boolean isDelivery,
|
||||
@Schema(required = true) boolean isRead,
|
||||
@Schema(required = true) boolean isViewed,
|
||||
@Schema(required = true) List<Long> timestamps
|
||||
) {
|
||||
|
||||
static JsonReceiptMessage from(MessageEnvelope.Receipt receiptMessage) {
|
||||
final var when = receiptMessage.when();
|
||||
|
||||
@ -6,7 +6,11 @@ import org.asamk.signal.manager.api.RecipientAddress;
|
||||
import java.util.UUID;
|
||||
|
||||
@Schema(name = "RecipientAddress")
|
||||
public record JsonRecipientAddress(String uuid, String number, String username) {
|
||||
public record JsonRecipientAddress(
|
||||
@Schema(required = true) String uuid,
|
||||
@Schema(required = true) String number,
|
||||
@Schema(required = true) String username
|
||||
) {
|
||||
|
||||
public static JsonRecipientAddress from(RecipientAddress address) {
|
||||
return new JsonRecipientAddress(address.uuid().map(UUID::toString).orElse(null),
|
||||
|
||||
@ -3,4 +3,4 @@ package org.asamk.signal.json;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(name = "RemoteDelete")
|
||||
record JsonRemoteDelete(long timestamp) {}
|
||||
record JsonRemoteDelete(@Schema(required = true) long timestamp) {}
|
||||
|
||||
@ -8,9 +8,9 @@ import org.asamk.signal.manager.api.SendMessageResult;
|
||||
|
||||
@Schema(name = "SendMessageResult")
|
||||
public record JsonSendMessageResult(
|
||||
JsonRecipientAddress recipientAddress,
|
||||
@Schema(required = true) JsonRecipientAddress recipientAddress,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
||||
Type type,
|
||||
@Schema(required = true) Type type,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String token,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) Long retryAfterSeconds
|
||||
) {
|
||||
|
||||
@ -9,12 +9,12 @@ import java.util.List;
|
||||
|
||||
@Schema(name = "SharedContact")
|
||||
public record JsonSharedContact(
|
||||
JsonContactName name,
|
||||
@Schema(required = true) JsonContactName name,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonContactAvatar avatar,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonContactPhone> phone,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonContactEmail> email,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonContactAddress> address,
|
||||
String organization
|
||||
@Schema(required = true) String organization
|
||||
) {
|
||||
|
||||
static JsonSharedContact from(MessageEnvelope.Data.SharedContact contact) {
|
||||
|
||||
@ -5,7 +5,10 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Hex;
|
||||
|
||||
@Schema(name = "Sticker")
|
||||
public record JsonSticker(String packId, int stickerId) {
|
||||
public record JsonSticker(
|
||||
@Schema(required = true) String packId,
|
||||
@Schema(required = true) int stickerId
|
||||
) {
|
||||
|
||||
static JsonSticker from(MessageEnvelope.Data.Sticker sticker) {
|
||||
final var packId = Hex.toStringCondensed(sticker.packId().serialize());
|
||||
|
||||
@ -7,7 +7,9 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "StoryContext")
|
||||
record JsonStoryContext(
|
||||
String authorNumber, String authorUuid, long sentTimestamp
|
||||
@Schema(required = true) String authorNumber,
|
||||
@Schema(required = true) String authorUuid,
|
||||
@Schema(required = true) long sentTimestamp
|
||||
) {
|
||||
|
||||
static JsonStoryContext from(MessageEnvelope.Data.StoryContext storyContext) {
|
||||
|
||||
@ -11,7 +11,7 @@ import java.util.List;
|
||||
|
||||
@Schema(name = "StoryMessage")
|
||||
record JsonStoryMessage(
|
||||
boolean allowsReplies,
|
||||
@Schema(required = true) boolean allowsReplies,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonAttachment fileAttachment,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) TextAttachment textAttachment
|
||||
@ -25,7 +25,7 @@ record JsonStoryMessage(
|
||||
}
|
||||
|
||||
public record TextAttachment(
|
||||
String text,
|
||||
@Schema(required = true) String text,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String style,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String textForegroundColor,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String textBackgroundColor,
|
||||
@ -45,7 +45,11 @@ record JsonStoryMessage(
|
||||
}
|
||||
|
||||
public record Gradient(
|
||||
String startColor, String endColor, List<String> colors, List<Float> positions, Integer angle
|
||||
@Schema(required = true) String startColor,
|
||||
@Schema(required = true) String endColor,
|
||||
@Schema(required = true) List<String> colors,
|
||||
@Schema(required = true) List<Float> positions,
|
||||
@Schema(required = true) Integer angle
|
||||
) {
|
||||
|
||||
static Gradient from(MessageEnvelope.Story.TextAttachment.Gradient gradient) {
|
||||
|
||||
@ -12,11 +12,11 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "SyncDataMessage")
|
||||
record JsonSyncDataMessage(
|
||||
@Deprecated String destination,
|
||||
String destinationNumber,
|
||||
String destinationUuid,
|
||||
@Schema(required = true) @Deprecated String destination,
|
||||
@Schema(required = true) String destinationNumber,
|
||||
@Schema(required = true) String destinationUuid,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonEditMessage editMessage,
|
||||
@JsonUnwrapped JsonDataMessage dataMessage
|
||||
@Schema(required = true) @JsonUnwrapped JsonDataMessage dataMessage
|
||||
) {
|
||||
|
||||
static JsonSyncDataMessage from(MessageEnvelope.Sync.Sent transcriptMessage, Manager m) {
|
||||
|
||||
@ -9,7 +9,9 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "SyncStoryMessage")
|
||||
record JsonSyncStoryMessage(
|
||||
String destinationNumber, String destinationUuid, @JsonUnwrapped JsonStoryMessage dataMessage
|
||||
@Schema(required = true) String destinationNumber,
|
||||
@Schema(required = true) String destinationUuid,
|
||||
@Schema(required = true) @JsonUnwrapped JsonStoryMessage dataMessage
|
||||
) {
|
||||
|
||||
static JsonSyncStoryMessage from(MessageEnvelope.Sync.Sent transcriptMessage) {
|
||||
|
||||
@ -4,7 +4,11 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.asamk.signal.manager.api.TextStyle;
|
||||
|
||||
@Schema(name = "TextStyle")
|
||||
public record JsonTextStyle(String style, int start, int length) {
|
||||
public record JsonTextStyle(
|
||||
@Schema(required = true) String style,
|
||||
@Schema(required = true) int start,
|
||||
@Schema(required = true) int length
|
||||
) {
|
||||
|
||||
static JsonTextStyle from(TextStyle textStyle) {
|
||||
return new JsonTextStyle(textStyle.style().name(), textStyle.start(), textStyle.length());
|
||||
|
||||
@ -7,7 +7,10 @@ import java.util.UUID;
|
||||
|
||||
@Schema(name = "UnpinMessage")
|
||||
public record JsonUnpinMessage(
|
||||
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
||||
@Schema(required = true) @Deprecated String targetAuthor,
|
||||
@Schema(required = true) String targetAuthorNumber,
|
||||
@Schema(required = true) String targetAuthorUuid,
|
||||
@Schema(required = true) long targetSentTimestamp
|
||||
) {
|
||||
|
||||
static JsonUnpinMessage from(MessageEnvelope.Data.UnpinMessage unpinMessage) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user