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

com.univapay.sdk.models.response.applicationtoken.ApplicationToken Maven / Gradle / Ivy

There is a newer version: 0.2.35
Show newest version
package com.univapay.sdk.models.response.applicationtoken;

import com.google.gson.annotations.SerializedName;
import com.univapay.sdk.models.common.AppTokenId;
import com.univapay.sdk.models.common.Domain;
import com.univapay.sdk.models.common.StoreId;
import com.univapay.sdk.models.common.auth.AppTokenStrategy;
import com.univapay.sdk.models.response.SimpleModel;
import com.univapay.sdk.models.response.UnivapayResponse;
import com.univapay.sdk.types.ProcessingMode;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class ApplicationToken extends UnivapayResponse implements SimpleModel {
  @SerializedName("id")
  private UUID id;

  @SerializedName("store_id")
  private UUID storeId;

  @SerializedName("token")
  private String token;

  @SerializedName("secret")
  private String secret;

  @SerializedName("domains")
  private List domains;

  @SerializedName("mode")
  private ProcessingMode mode;

  @SerializedName("created_on")
  private OffsetDateTime createdOn;

  public AppTokenId getId() {
    return new AppTokenId(id);
  }

  public StoreId getStoreId() {
    return new StoreId(storeId);
  }

  public String getToken() {
    return token;
  }

  public String getSecret() {
    return secret;
  }

  public List getDomains() {
    List formattedDomains = new ArrayList<>();
    for (String domain : domains) {
      formattedDomains.add(new Domain(domain));
    }
    return formattedDomains;
  }

  public ProcessingMode getMode() {
    return mode;
  }

  public OffsetDateTime getCreatedOn() {
    return createdOn;
  }

  public AppTokenStrategy getAppTokenAuthStrategy() {
    return new AppTokenStrategy(token, secret);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy