All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.whispersystems.signalservice.internal.push.SubscriptionsConfiguration Maven / Gradle / Ivy

There is a newer version: 2.15.3_unofficial_107
Show newest version
package org.whispersystems.signalservice.internal.push;

import com.fasterxml.jackson.annotation.JsonProperty;

import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Response JSON for a call to /v1/subscriptions/configuration
 */
public class SubscriptionsConfiguration {

  public static final String PAYPAL     = "PAYPAL";
  public static final String CARD       = "CARD";
  public static final String SEPA_DEBIT = "SEPA_DEBIT";
  public static final String IDEAL      = "IDEAL";

  public static final int               BOOST_LEVEL        = 1;
  public static final int               GIFT_LEVEL         = 100;
  public static final int               BACKUPS_LEVEL      = 201;
  public static final HashSet  SUBSCRIPTION_LEVELS = new HashSet<>(Arrays.asList(500, 1000, 2000));

  @JsonProperty("currencies")
  private Map currencies;

  @JsonProperty("levels")
  private Map levels;

  @JsonProperty("sepaMaximumEuros")
  private BigDecimal sepaMaximumEuros;

  public static class CurrencyConfiguration {
    @JsonProperty("minimum")
    private BigDecimal minimum;

    @JsonProperty("oneTime")
    private Map> oneTime;

    @JsonProperty("subscription")
    private Map subscription;

    @JsonProperty("backupSubscription")
    private Map backupSubscription;

    @JsonProperty("supportedPaymentMethods")
    private Set supportedPaymentMethods;

    public BigDecimal getMinimum() {
      return minimum;
    }

    public Map> getOneTime() {
      return oneTime;
    }

    public Map getSubscription() {
      return subscription;
    }

    public Map getBackupSubscription() {
      return backupSubscription;
    }

    public Set getSupportedPaymentMethods() {
      return supportedPaymentMethods;
    }
  }

  public static class LevelConfiguration {
    @JsonProperty("name")
    private String name;

    @JsonProperty("badge")
    private SignalServiceProfile.Badge badge;

    public String getName() {
      return name;
    }

    public SignalServiceProfile.Badge getBadge() {
      return badge;
    }
  }

  public Map getCurrencies() {
    return currencies;
  }

  public Map getLevels() {
    return levels;
  }

  public BigDecimal getSepaMaximumEuros() {
    return sepaMaximumEuros;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy