com.microsoft.bingads.internal.ServiceInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of microsoft.bingads Show documentation
Show all versions of microsoft.bingads Show documentation
The Bing Ads Java SDK is a library improving developer experience when working with the Bing Ads services by providing high-level access to features such as Bulk API, OAuth Authorization and SOAP API.
package com.microsoft.bingads.internal;
import com.microsoft.bingads.ApiEnvironment;
public class ServiceInfo {
private String productionUrl;
private String sandboxUrl;
private String serviceNameAndVersion;
public String getProductionUrl() {
return productionUrl;
}
public void setProductionUrl(String productionUrl) {
this.productionUrl = productionUrl;
}
public String getSandboxUrl() {
return sandboxUrl;
}
public void setSandboxUrl(String sandboxUrl) {
this.sandboxUrl = sandboxUrl;
}
public String getServiceNameAndVersion() {
return serviceNameAndVersion;
}
public void setServiceNameAndVersion(String serviceNameAndVersion) {
this.serviceNameAndVersion = serviceNameAndVersion;
}
public String GetUrl(ApiEnvironment environment) {
switch (environment) {
case SANDBOX:
if (getSandboxUrl() == null) {
throw new UnsupportedOperationException("The service is not available in Sandbox");
}
return getSandboxUrl();
case PRODUCTION:
return getProductionUrl();
default:
throw new UnsupportedOperationException("Unknown environment name: " + environment);
}
}
}