mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 03:08:04 +01:00
Include media TTL in backup config
This commit is contained in:
committed by
ravi-signal
parent
776c147ea4
commit
fc6075f19c
@@ -6,6 +6,7 @@
|
||||
package org.whispersystems.textsecuregcm.configuration;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
@@ -30,6 +31,7 @@ public sealed interface SubscriptionLevelConfiguration permits
|
||||
|
||||
record Backup(
|
||||
@JsonProperty("playProductId") @NotEmpty String playProductId,
|
||||
@JsonProperty("mediaTtl") @NotNull Duration mediaTtl,
|
||||
@JsonProperty("prices") @Valid Map<@NotEmpty String, @NotNull @Valid SubscriptionPriceConfiguration> prices)
|
||||
implements SubscriptionLevelConfiguration {}
|
||||
|
||||
|
||||
@@ -206,7 +206,10 @@ public class SubscriptionController {
|
||||
.entrySet().stream()
|
||||
.collect(Collectors.toMap(
|
||||
e -> String.valueOf(e.getKey()),
|
||||
e -> new BackupLevelConfiguration(BackupManager.MAX_TOTAL_BACKUP_MEDIA_BYTES, e.getValue().playProductId())));
|
||||
e -> new BackupLevelConfiguration(
|
||||
BackupManager.MAX_TOTAL_BACKUP_MEDIA_BYTES,
|
||||
e.getValue().playProductId(),
|
||||
e.getValue().mediaTtl().toDays())));
|
||||
|
||||
return new GetSubscriptionConfigurationResponse(buildCurrencyConfiguration(), donationLevels,
|
||||
new BackupConfiguration(backupLevels, subscriptionConfiguration.getbackupFreeTierMediaDuration().toDays()),
|
||||
@@ -517,7 +520,9 @@ public class SubscriptionController {
|
||||
@Schema(description = "The amount of media storage in bytes that a paying subscriber may store")
|
||||
long storageAllowanceBytes,
|
||||
@Schema(description = "The play billing productID associated with this backup level")
|
||||
String playProductId) {}
|
||||
String playProductId,
|
||||
@Schema(description = "The duration, in days, for which your backed up media is retained on the server after you stop refreshing with a paid credential")
|
||||
long mediaTtlDays) {}
|
||||
|
||||
@GET
|
||||
@Path("/configuration")
|
||||
|
||||
Reference in New Issue
Block a user