// Path: src/main/java/com/xiaomi/infra/galaxy/fds/android/model/HttpHeaders.java
// public final class HttpHeaders {
//   /** RFC 1945 (HTTP/1.0) Section 10.2, RFC 2616 (HTTP/1.1) Section 14.8 */
//   public static final String AUTHORIZATION = "Authorization";
// 
//   /** RFC 2616 (HTTP/1.1) Section 14.9 */
//   public static final String CACHE_CONTROL = "Cache-Control";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.3, RFC 2616 (HTTP/1.1) Section 14.11 */
//   public static final String CONTENT_ENCODING = "Content-Encoding";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.4, RFC 2616 (HTTP/1.1) Section 14.13 */
//   public static final String CONTENT_LENGTH = "Content-Length";
// 
//   /** RFC 2616 (HTTP/1.1) Section 14.15 */
//   public static final String CONTENT_MD5 = "Content-MD5";
// 
//   /** RFC 2616 (HTTP/1.1) Section 14.16 */
//   public static final String CONTENT_RANGE = "Content-Range";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.5, RFC 2616 (HTTP/1.1) Section 14.17 */
//   public static final String CONTENT_TYPE = "Content-Type";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.6, RFC 2616 (HTTP/1.1) Section 14.18 */
//   public static final String DATE = "Date";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.10, RFC 2616 (HTTP/1.1) Section 14.29 */
//   public static final String LAST_MODIFIED = "Last-Modified";
// 
//   /** RFC 2616 (HTTP/1.1) Section 14.35 */
//   public static final String RANGE = "Range";
// }
// 
// Path: src/main/java/com/xiaomi/infra/galaxy/fds/android/util/Args.java
// public class Args {
// 
//   public static void check(final boolean expression, final String message) {
//     if (!expression) {
//       throw new IllegalArgumentException(message);
//     }
//   }
// 
//   public static void check(final boolean expression, final String message,
//       final Object... args) {
//     if (!expression) {
//       throw new IllegalArgumentException(String.format(message, args));
//     }
//   }
// 
//   public static void check(final boolean expression, final String message,
//       final Object arg) {
//     if (!expression) {
//       throw new IllegalArgumentException(String.format(message, arg));
//     }
//   }
// 
//   public static <T> T notNull(final T argument, final String name) {
//     if (argument == null) {
//       throw new IllegalArgumentException(name + " may not be null");
//     }
//     return argument;
//   }
// 
//   public static <T extends CharSequence> T notEmpty(final T argument,
//       final String name) {
//     if (argument == null) {
//       throw new IllegalArgumentException(name + " may not be null");
//     }
//     if (argument.length() == 0) {
//       throw new IllegalArgumentException(name + " may not be empty");
//     }
//     return argument;
//   }
// 
//   public static int positive(final int n, final String name) {
//     if (n <= 0) {
//       throw new IllegalArgumentException(name + " may not be negative or zero");
//     }
//     return n;
//   }
// 
//   public static long positive(final long n, final String name) {
//     if (n <= 0) {
//       throw new IllegalArgumentException(name + " may not be negative or zero");
//     }
//     return n;
//   }
// 
//   public static int notNegative(final int n, final String name) {
//     if (n < 0) {
//       throw new IllegalArgumentException(name + " may not be negative");
//     }
//     return n;
//   }
// 
//   public static long notNegative(final long n, final String name) {
//     if (n < 0) {
//       throw new IllegalArgumentException(name + " may not be negative");
//     }
//     return n;
//   }
// 
// }


import org.apache.http.client.methods.HttpRequestBase;
import com.xiaomi.infra.galaxy.fds.android.model.HttpHeaders;
import com.xiaomi.infra.galaxy.fds.android.util.Args;
package com.xiaomi.infra.galaxy.fds.android.auth;



public class SSOCredential implements GalaxyFDSCredential {
  private final String HEADER_VALUE = "SSO";
  private final String SERVICE_TOKEN_PARAM = "serviceToken";
  private final String APP_ID = "appId";

  private final String serviceToken;
  private final String appId;

  @Deprecated
  public SSOCredential(String serviceToken) {
    Args.notNull(serviceToken, "Service token");
    Args.notEmpty(serviceToken, "Service token");
    this.serviceToken = serviceToken;
    this.appId = null;
  }

  public SSOCredential(String serviceToken, String appId) {
    Args.notNull(serviceToken, "Service token");
    Args.notEmpty(serviceToken, "Service token");
    Args.notNull(appId, "App id");
    Args.notEmpty(appId, "App id");
    this.serviceToken = serviceToken;
    this.appId = appId;
  }

  @Override
  public void addHeader(HttpRequestBase request) {
// Path: src/main/java/com/xiaomi/infra/galaxy/fds/android/model/HttpHeaders.java
// public final class HttpHeaders {
//   /** RFC 1945 (HTTP/1.0) Section 10.2, RFC 2616 (HTTP/1.1) Section 14.8 */
//   public static final String AUTHORIZATION = "Authorization";
// 
//   /** RFC 2616 (HTTP/1.1) Section 14.9 */
//   public static final String CACHE_CONTROL = "Cache-Control";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.3, RFC 2616 (HTTP/1.1) Section 14.11 */
//   public static final String CONTENT_ENCODING = "Content-Encoding";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.4, RFC 2616 (HTTP/1.1) Section 14.13 */
//   public static final String CONTENT_LENGTH = "Content-Length";
// 
//   /** RFC 2616 (HTTP/1.1) Section 14.15 */
//   public static final String CONTENT_MD5 = "Content-MD5";
// 
//   /** RFC 2616 (HTTP/1.1) Section 14.16 */
//   public static final String CONTENT_RANGE = "Content-Range";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.5, RFC 2616 (HTTP/1.1) Section 14.17 */
//   public static final String CONTENT_TYPE = "Content-Type";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.6, RFC 2616 (HTTP/1.1) Section 14.18 */
//   public static final String DATE = "Date";
// 
//   /** RFC 1945 (HTTP/1.0) Section 10.10, RFC 2616 (HTTP/1.1) Section 14.29 */
//   public static final String LAST_MODIFIED = "Last-Modified";
// 
//   /** RFC 2616 (HTTP/1.1) Section 14.35 */
//   public static final String RANGE = "Range";
// }
// 
// Path: src/main/java/com/xiaomi/infra/galaxy/fds/android/util/Args.java
// public class Args {
// 
//   public static void check(final boolean expression, final String message) {
//     if (!expression) {
//       throw new IllegalArgumentException(message);
//     }
//   }
// 
//   public static void check(final boolean expression, final String message,
//       final Object... args) {
//     if (!expression) {
//       throw new IllegalArgumentException(String.format(message, args));
//     }
//   }
// 
//   public static void check(final boolean expression, final String message,
//       final Object arg) {
//     if (!expression) {
//       throw new IllegalArgumentException(String.format(message, arg));
//     }
//   }
// 
//   public static <T> T notNull(final T argument, final String name) {
//     if (argument == null) {
//       throw new IllegalArgumentException(name + " may not be null");
//     }
//     return argument;
//   }
// 
//   public static <T extends CharSequence> T notEmpty(final T argument,
//       final String name) {
//     if (argument == null) {
//       throw new IllegalArgumentException(name + " may not be null");
//     }
//     if (argument.length() == 0) {
//       throw new IllegalArgumentException(name + " may not be empty");
//     }
//     return argument;
//   }
// 
//   public static int positive(final int n, final String name) {
//     if (n <= 0) {
//       throw new IllegalArgumentException(name + " may not be negative or zero");
//     }
//     return n;
//   }
// 
//   public static long positive(final long n, final String name) {
//     if (n <= 0) {
//       throw new IllegalArgumentException(name + " may not be negative or zero");
//     }
//     return n;
//   }
// 
//   public static int notNegative(final int n, final String name) {
//     if (n < 0) {
//       throw new IllegalArgumentException(name + " may not be negative");
//     }
//     return n;
//   }
// 
//   public static long notNegative(final long n, final String name) {
//     if (n < 0) {
//       throw new IllegalArgumentException(name + " may not be negative");
//     }
//     return n;
//   }
// 
// }


// Path: src/main/java/com/xiaomi/infra/galaxy/fds/android/auth/SSOCredential.java
import org.apache.http.client.methods.HttpRequestBase;
import com.xiaomi.infra.galaxy.fds.android.model.HttpHeaders;
import com.xiaomi.infra.galaxy.fds.android.util.Args;

package com.xiaomi.infra.galaxy.fds.android.auth;



public class SSOCredential implements GalaxyFDSCredential {
  private final String HEADER_VALUE = "SSO";
  private final String SERVICE_TOKEN_PARAM = "serviceToken";
  private final String APP_ID = "appId";

  private final String serviceToken;
  private final String appId;

  @Deprecated
  public SSOCredential(String serviceToken) {
    Args.notNull(serviceToken, "Service token");
    Args.notEmpty(serviceToken, "Service token");
    this.serviceToken = serviceToken;
    this.appId = null;
  }

  public SSOCredential(String serviceToken, String appId) {
    Args.notNull(serviceToken, "Service token");
    Args.notEmpty(serviceToken, "Service token");
    Args.notNull(appId, "App id");
    Args.notEmpty(appId, "App id");
    this.serviceToken = serviceToken;
    this.appId = appId;
  }

  @Override
  public void addHeader(HttpRequestBase request) {
    request.addHeader(HttpHeaders.AUTHORIZATION, HEADER_VALUE);