org.optaplanner.openshift.employeerostering.shared.tenant.TenantRestServiceBuilder Maven / Gradle / Ivy
The newest version!
package org.optaplanner.openshift.employeerostering.shared.tenant;
import com.github.nmorel.gwtjackson.client.ObjectMapper;
import com.github.nmorel.gwtjackson.client.ObjectReader;
import com.github.nmorel.gwtjackson.rest.api.RestCallback;
import com.github.nmorel.gwtjackson.rest.api.RestRequestBuilder;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import java.lang.Integer;
import java.lang.Void;
import java.util.List;
/**
* Generated REST service builder for {@link org.optaplanner.openshift.employeerostering.shared.tenant.TenantRestService}.
*/
public final class TenantRestServiceBuilder {
private static ObjectReader1 objectreader1;
private static ObjectMapper1 objectmapper1;
private static ObjectMapper2 objectmapper2;
private TenantRestServiceBuilder() {
}
private static ObjectReader1 getObjectReader1() {
if (objectreader1 == null) {
objectreader1 = GWT.create(ObjectReader1.class);
}
return objectreader1;
}
private static ObjectMapper1 getObjectMapper1() {
if (objectmapper1 == null) {
objectmapper1 = GWT.create(ObjectMapper1.class);
}
return objectmapper1;
}
private static ObjectMapper2 getObjectMapper2() {
if (objectmapper2 == null) {
objectmapper2 = GWT.create(ObjectMapper2.class);
}
return objectmapper2;
}
public static final RestRequestBuilder> getTenantList() {
return new RestRequestBuilder>()
.method(RequestBuilder.GET)
.url("/tenant/")
.responseConverter(getObjectReader1());
}
public static final Request getTenantList(RestCallback> _callback_) {
return getTenantList()
.callback(_callback_)
.send();
}
public static final RestRequestBuilder getTenant(final Integer id) {
return new RestRequestBuilder()
.method(RequestBuilder.GET)
.url("/tenant/{id : \\d+}")
.addPathParam("id", id)
.responseConverter(getObjectMapper1());
}
public static final Request getTenant(final Integer id, RestCallback _callback_) {
return getTenant(id)
.callback(_callback_)
.send();
}
public static final RestRequestBuilder addTenant(final Tenant tenant) {
return new RestRequestBuilder()
.method(RequestBuilder.POST)
.url("/tenant/add")
.body(tenant)
.bodyConverter(getObjectMapper1())
.responseConverter(getObjectMapper1());
}
public static final Request addTenant(final Tenant tenant, RestCallback _callback_) {
return addTenant(tenant)
.callback(_callback_)
.send();
}
public static final RestRequestBuilder getTenantConfiguration(final Integer id) {
return new RestRequestBuilder()
.method(RequestBuilder.GET)
.url("/tenant/{id}")
.addPathParam("id", id)
.responseConverter(getObjectMapper2());
}
public static final Request getTenantConfiguration(final Integer id, RestCallback _callback_) {
return getTenantConfiguration(id)
.callback(_callback_)
.send();
}
public static final RestRequestBuilder updateTenantConfiguration(final TenantConfiguration tenantConfiguration) {
return new RestRequestBuilder()
.method(RequestBuilder.POST)
.url("/tenant/config/update")
.body(tenantConfiguration)
.bodyConverter(getObjectMapper2())
.responseConverter(getObjectMapper2());
}
public static final Request updateTenantConfiguration(final TenantConfiguration tenantConfiguration, RestCallback _callback_) {
return updateTenantConfiguration(tenantConfiguration)
.callback(_callback_)
.send();
}
interface ObjectReader1 extends ObjectReader> {
}
interface ObjectMapper1 extends ObjectMapper {
}
interface ObjectMapper2 extends ObjectMapper {
}
}