001
002package com.commercetools.ml.defaultconfig;
003
004import io.vrap.rmf.base.client.ServiceRegionConfig;
005
006public enum ServiceRegion implements ServiceRegionConfig {
007
008    GCP_EUROPE(new RegionHosts("https://ml-eu.europe-west1.gcp.commercetools.com",
009        "https://auth.europe-west1.gcp.commercetools.com")),
010    GCP_US(new RegionHosts("https://ml-us.europe-west1.gcp.commercetools.com",
011        "https://auth.us-central1.gcp.commercetools.com")),
012
013    ;
014
015    public static class RegionHosts {
016        private final String apiUrl;
017        private final String authUrl;
018
019        private RegionHosts(String apiUrl, String authUrl) {
020            this.apiUrl = apiUrl;
021            this.authUrl = authUrl;
022        }
023    }
024
025    private final RegionHosts regionHosts;
026
027    ServiceRegion(RegionHosts regionHosts) {
028        this.regionHosts = regionHosts;
029    }
030
031    @Override
032    public String getApiUrl() {
033        return regionHosts.apiUrl;
034    }
035
036    @Override
037    public String getAuthUrl() {
038        return regionHosts.authUrl;
039    }
040}