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

com.saucelabs.visual.DataCenter Maven / Gradle / Ivy

The newest version!
package com.saucelabs.visual;

import com.saucelabs.visual.exception.VisualApiException;

public enum DataCenter {
  US_WEST_1("https://api.us-west-1.saucelabs.com/v1/visual/graphql"),
  US_EAST_4("https://api.us-east-4.saucelabs.com/v1/visual/graphql"),
  EU_CENTRAL_1("https://api.eu-central-1.saucelabs.com/v1/visual/graphql");

  public final String endpoint;

  DataCenter(String endpoint) {
    this.endpoint = endpoint;
  }

  static DataCenter fromSauceRegion(String sauceRegion) {
    if (sauceRegion == null) {
      return US_WEST_1;
    }
    switch (sauceRegion) {
      case "us-west-1":
        return US_WEST_1;
      case "eu-central-1":
        return EU_CENTRAL_1;
      case "us-east-4":
        return US_EAST_4;
      default:
        throw new VisualApiException("Unknown region: " + sauceRegion);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy