// Path: provider/src/main/java/com/cloudera/director/google/compute/util/ComputeUrls.java
// public class ComputeUrls {
// 
//   private ComputeUrls() {}
// 
//   public static String buildDiskTypeUrl(String projectId, String zone, String dataDiskType) {
//     String diskTypePath;
// 
//     if (dataDiskType.equals("LocalSSD")) {
//       diskTypePath = "local-ssd";
//     } else if (dataDiskType.equals("SSD")) {
//       diskTypePath = "pd-ssd";
//     } else {
//       // The value will already have been checked by the validator.
//       // Assume 'Standard'.
//       diskTypePath = "pd-standard";
//     }
// 
//     return buildZonalUrl(projectId, zone, "diskTypes", diskTypePath);
//   }
// 
//   public static String buildDiskUrl(String projectId, String zone, String diskName) {
//     return buildZonalUrl(projectId, zone, "disks", diskName);
//   }
// 
//   public static String buildMachineTypeUrl(String projectId, String zone, String machineType) {
//     return buildZonalUrl(projectId, zone, "machineTypes", machineType);
//   }
// 
//   public static String buildNetworkUrl(String projectId, String networkName) {
//     return buildGlobalUrl(projectId, "networks", networkName);
//   }
// 
//   public static String buildSubnetUrl(String projectId, String region, String subnetName){
//     return buildRegionalUrl(projectId, region, "subnetworks", subnetName);
//   }
// 
//   public static String buildZonalUrl(String projectId, String zone, String... resourcePathParts) {
//     List<String> pathParts = Lists.newArrayList("zones", zone);
// 
//     if (resourcePathParts != null) {
//       pathParts.addAll(Lists.newArrayList(resourcePathParts));
//     }
// 
//     return buildGoogleComputeApisUrl(projectId, Iterables.toArray(pathParts, String.class));
//   }
// 
//   public static String buildRegionalUrl(String projectId, String region, String... resourcePathParts) {
//     List<String> pathParts = Lists.newArrayList("regions", region);
// 
//     if (resourcePathParts != null) {
//       pathParts.addAll(Lists.newArrayList(resourcePathParts));
//     }
// 
//     return buildGoogleComputeApisUrl(projectId, Iterables.toArray(pathParts, String.class));
//   }
// 
//   public static String buildGlobalUrl(String projectId, String... resourcePathParts) {
//     List<String> pathParts = Lists.newArrayList("global");
// 
//     if (resourcePathParts != null) {
//       pathParts.addAll(Lists.newArrayList(resourcePathParts));
//     }
// 
//     return buildGoogleComputeApisUrl(projectId, Iterables.toArray(pathParts, String.class));
//   }
// 
//   static String buildGoogleComputeApisUrl(String projectId, String... resourcePathParts) {
//     return Urls.buildGenericApisUrl("compute", "v1", projectId, resourcePathParts);
//   }
// }
// 
// Path: provider/src/main/java/com/cloudera/director/google/sql/util/SQLUrls.java
// public class SQLUrls {
// 
//   public static String buildGoogleCloudSQLApisUrl(String projectId, String... resourcePathParts) {
//     return Urls.buildGenericApisUrl("sql", "v1beta4", projectId, resourcePathParts);
//   }
// }


import static org.junit.Assert.fail;
import com.cloudera.director.google.compute.util.ComputeUrls;
import com.cloudera.director.google.shaded.com.typesafe.config.Config;
import com.cloudera.director.google.shaded.com.typesafe.config.ConfigFactory;
import com.cloudera.director.google.sql.util.SQLUrls;
import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;

  public static Config buildGoogleConfig() throws IOException {
    Map<String, String> googleConfig = new HashMap<String, String>();
    googleConfig.put(
        Configurations.IMAGE_ALIASES_SECTION + "centos6",
        buildImageUrl("centos-cloud", "centos-6-v20150526"));
    googleConfig.put(
        Configurations.IMAGE_ALIASES_SECTION + "rhel6",
        buildImageUrl("rhel-cloud", "rhel-6-v20150526"));
    googleConfig.put(
        Configurations.CLOUD_SQL_REGIONS_ALIASES_SECTION + "us-central", "us-central1");
    googleConfig.put(
        Configurations.CLOUD_SQL_REGIONS_ALIASES_SECTION + "europe-west1", "europe-west1");
    googleConfig.put(
        Configurations.CLOUD_SQL_REGIONS_ALIASES_SECTION + "asia-east1", "asia-east1");
    googleConfig.put(Configurations.COMPUTE_POLLING_TIMEOUT_KEY, "180");
    googleConfig.put(Configurations.COMPUTE_MAX_POLLING_INTERVAL_KEY, "8");

    return ConfigFactory.parseMap(googleConfig);
  }

  public static String buildImageUrl(String projectId, String image) {
    return ComputeUrls.buildGlobalUrl(projectId, "images", image);
  }

  public static String buildComputeInstanceUrl(String projectId, String zone, String instanceName) {
    return ComputeUrls.buildZonalUrl(projectId, zone, "instances", instanceName);
  }

  public static String buildDatabaseInstanceUrl(String projectId, String instanceName) {
// Path: provider/src/main/java/com/cloudera/director/google/compute/util/ComputeUrls.java
// public class ComputeUrls {
// 
//   private ComputeUrls() {}
// 
//   public static String buildDiskTypeUrl(String projectId, String zone, String dataDiskType) {
//     String diskTypePath;
// 
//     if (dataDiskType.equals("LocalSSD")) {
//       diskTypePath = "local-ssd";
//     } else if (dataDiskType.equals("SSD")) {
//       diskTypePath = "pd-ssd";
//     } else {
//       // The value will already have been checked by the validator.
//       // Assume 'Standard'.
//       diskTypePath = "pd-standard";
//     }
// 
//     return buildZonalUrl(projectId, zone, "diskTypes", diskTypePath);
//   }
// 
//   public static String buildDiskUrl(String projectId, String zone, String diskName) {
//     return buildZonalUrl(projectId, zone, "disks", diskName);
//   }
// 
//   public static String buildMachineTypeUrl(String projectId, String zone, String machineType) {
//     return buildZonalUrl(projectId, zone, "machineTypes", machineType);
//   }
// 
//   public static String buildNetworkUrl(String projectId, String networkName) {
//     return buildGlobalUrl(projectId, "networks", networkName);
//   }
// 
//   public static String buildSubnetUrl(String projectId, String region, String subnetName){
//     return buildRegionalUrl(projectId, region, "subnetworks", subnetName);
//   }
// 
//   public static String buildZonalUrl(String projectId, String zone, String... resourcePathParts) {
//     List<String> pathParts = Lists.newArrayList("zones", zone);
// 
//     if (resourcePathParts != null) {
//       pathParts.addAll(Lists.newArrayList(resourcePathParts));
//     }
// 
//     return buildGoogleComputeApisUrl(projectId, Iterables.toArray(pathParts, String.class));
//   }
// 
//   public static String buildRegionalUrl(String projectId, String region, String... resourcePathParts) {
//     List<String> pathParts = Lists.newArrayList("regions", region);
// 
//     if (resourcePathParts != null) {
//       pathParts.addAll(Lists.newArrayList(resourcePathParts));
//     }
// 
//     return buildGoogleComputeApisUrl(projectId, Iterables.toArray(pathParts, String.class));
//   }
// 
//   public static String buildGlobalUrl(String projectId, String... resourcePathParts) {
//     List<String> pathParts = Lists.newArrayList("global");
// 
//     if (resourcePathParts != null) {
//       pathParts.addAll(Lists.newArrayList(resourcePathParts));
//     }
// 
//     return buildGoogleComputeApisUrl(projectId, Iterables.toArray(pathParts, String.class));
//   }
// 
//   static String buildGoogleComputeApisUrl(String projectId, String... resourcePathParts) {
//     return Urls.buildGenericApisUrl("compute", "v1", projectId, resourcePathParts);
//   }
// }
// 
// Path: provider/src/main/java/com/cloudera/director/google/sql/util/SQLUrls.java
// public class SQLUrls {
// 
//   public static String buildGoogleCloudSQLApisUrl(String projectId, String... resourcePathParts) {
//     return Urls.buildGenericApisUrl("sql", "v1beta4", projectId, resourcePathParts);
//   }
// }


// Path: tests/src/test/java/com/cloudera/director/google/TestUtils.java
import static org.junit.Assert.fail;
import com.cloudera.director.google.compute.util.ComputeUrls;
import com.cloudera.director.google.shaded.com.typesafe.config.Config;
import com.cloudera.director.google.shaded.com.typesafe.config.ConfigFactory;
import com.cloudera.director.google.sql.util.SQLUrls;
import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;


  public static Config buildGoogleConfig() throws IOException {
    Map<String, String> googleConfig = new HashMap<String, String>();
    googleConfig.put(
        Configurations.IMAGE_ALIASES_SECTION + "centos6",
        buildImageUrl("centos-cloud", "centos-6-v20150526"));
    googleConfig.put(
        Configurations.IMAGE_ALIASES_SECTION + "rhel6",
        buildImageUrl("rhel-cloud", "rhel-6-v20150526"));
    googleConfig.put(
        Configurations.CLOUD_SQL_REGIONS_ALIASES_SECTION + "us-central", "us-central1");
    googleConfig.put(
        Configurations.CLOUD_SQL_REGIONS_ALIASES_SECTION + "europe-west1", "europe-west1");
    googleConfig.put(
        Configurations.CLOUD_SQL_REGIONS_ALIASES_SECTION + "asia-east1", "asia-east1");
    googleConfig.put(Configurations.COMPUTE_POLLING_TIMEOUT_KEY, "180");
    googleConfig.put(Configurations.COMPUTE_MAX_POLLING_INTERVAL_KEY, "8");

    return ConfigFactory.parseMap(googleConfig);
  }

  public static String buildImageUrl(String projectId, String image) {
    return ComputeUrls.buildGlobalUrl(projectId, "images", image);
  }

  public static String buildComputeInstanceUrl(String projectId, String zone, String instanceName) {
    return ComputeUrls.buildZonalUrl(projectId, zone, "instances", instanceName);
  }

  public static String buildDatabaseInstanceUrl(String projectId, String instanceName) {
    return SQLUrls.buildGoogleCloudSQLApisUrl(projectId, "instances", instanceName);