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

org.optaplanner.openshift.employeerostering.shared.employee.EmployeeRestServiceBuilder Maven / Gradle / Ivy

The newest version!
package org.optaplanner.openshift.employeerostering.shared.employee;

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.Boolean;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Void;
import java.util.List;
import org.optaplanner.openshift.employeerostering.shared.employee.view.EmployeeAvailabilityView;

/**
 * Generated REST service builder for {@link org.optaplanner.openshift.employeerostering.shared.employee.EmployeeRestService}.
 */
public final class EmployeeRestServiceBuilder {
  private static ObjectReader1 objectreader1;

  private static ObjectReader2 objectreader2;

  private static ObjectMapper1 objectmapper1;

  private static ObjectMapper2 objectmapper2;

  private EmployeeRestServiceBuilder() {
  }

  private static ObjectReader1 getObjectReader1() {
    if (objectreader1 == null) {
      objectreader1 = GWT.create(ObjectReader1.class);
    }
    return objectreader1;
  }

  private static ObjectReader2 getObjectReader2() {
    if (objectreader2 == null) {
      objectreader2 = GWT.create(ObjectReader2.class);
    }
    return objectreader2;
  }

  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> getEmployeeList(final Integer tenantId) {
    return new RestRequestBuilder>()
          .method(RequestBuilder.GET)
          .url("/tenant/{tenantId}/employee/")
          .addPathParam("tenantId", tenantId)
          .responseConverter(getObjectReader1());
  }

  public static final Request getEmployeeList(final Integer tenantId, RestCallback> _callback_) {
    return getEmployeeList(tenantId)
          .callback(_callback_)
          .send();
  }

  public static final RestRequestBuilder getEmployee(final Integer tenantId, final Long id) {
    return new RestRequestBuilder()
          .method(RequestBuilder.GET)
          .url("/tenant/{tenantId}/employee/{id}")
          .addPathParam("tenantId", tenantId)
          .addPathParam("id", id)
          .responseConverter(getObjectMapper1());
  }

  public static final Request getEmployee(final Integer tenantId, final Long id, RestCallback _callback_) {
    return getEmployee(tenantId, id)
          .callback(_callback_)
          .send();
  }

  public static final RestRequestBuilder addEmployee(final Integer tenantId, final Employee employee) {
    return new RestRequestBuilder()
          .method(RequestBuilder.POST)
          .url("/tenant/{tenantId}/employee/add")
          .body(employee)
          .bodyConverter(getObjectMapper1())
          .addPathParam("tenantId", tenantId)
          .responseConverter(getObjectMapper1());
  }

  public static final Request addEmployee(final Integer tenantId, final Employee employee, RestCallback _callback_) {
    return addEmployee(tenantId, employee)
          .callback(_callback_)
          .send();
  }

  public static final RestRequestBuilder updateEmployee(final Integer tenantId, final Employee employee) {
    return new RestRequestBuilder()
          .method(RequestBuilder.POST)
          .url("/tenant/{tenantId}/employee/update")
          .body(employee)
          .bodyConverter(getObjectMapper1())
          .addPathParam("tenantId", tenantId)
          .responseConverter(getObjectMapper1());
  }

  public static final Request updateEmployee(final Integer tenantId, final Employee employee, RestCallback _callback_) {
    return updateEmployee(tenantId, employee)
          .callback(_callback_)
          .send();
  }

  public static final RestRequestBuilder removeEmployee(final Integer tenantId, final Long id) {
    return new RestRequestBuilder()
          .method(RequestBuilder.DELETE)
          .url("/tenant/{tenantId}/employee/{id}")
          .addPathParam("tenantId", tenantId)
          .addPathParam("id", id)
          .responseConverter(getObjectReader2());
  }

  public static final Request removeEmployee(final Integer tenantId, final Long id, RestCallback _callback_) {
    return removeEmployee(tenantId, id)
          .callback(_callback_)
          .send();
  }

  public static final RestRequestBuilder addEmployeeAvailability(final Integer tenantId, final EmployeeAvailabilityView employeeAvailability) {
    return new RestRequestBuilder()
          .method(RequestBuilder.POST)
          .url("/tenant/{tenantId}/employee/availability/add")
          .body(employeeAvailability)
          .bodyConverter(getObjectMapper2())
          .addPathParam("tenantId", tenantId)
          .responseConverter(getObjectMapper2());
  }

  public static final Request addEmployeeAvailability(final Integer tenantId, final EmployeeAvailabilityView employeeAvailability, RestCallback _callback_) {
    return addEmployeeAvailability(tenantId, employeeAvailability)
          .callback(_callback_)
          .send();
  }

  public static final RestRequestBuilder updateEmployeeAvailability(final Integer tenantId, final EmployeeAvailabilityView employeeAvailability) {
    return new RestRequestBuilder()
          .method(RequestBuilder.PUT)
          .url("/tenant/{tenantId}/employee/availability/update")
          .body(employeeAvailability)
          .bodyConverter(getObjectMapper2())
          .addPathParam("tenantId", tenantId)
          .responseConverter(getObjectMapper2());
  }

  public static final Request updateEmployeeAvailability(final Integer tenantId, final EmployeeAvailabilityView employeeAvailability, RestCallback _callback_) {
    return updateEmployeeAvailability(tenantId, employeeAvailability)
          .callback(_callback_)
          .send();
  }

  public static final RestRequestBuilder removeEmployeeAvailability(final Integer tenantId, final Long id) {
    return new RestRequestBuilder()
          .method(RequestBuilder.DELETE)
          .url("/tenant/{tenantId}/employee/availability/{id}")
          .addPathParam("tenantId", tenantId)
          .addPathParam("id", id)
          .responseConverter(getObjectReader2());
  }

  public static final Request removeEmployeeAvailability(final Integer tenantId, final Long id, RestCallback _callback_) {
    return removeEmployeeAvailability(tenantId, id)
          .callback(_callback_)
          .send();
  }

  interface ObjectReader1 extends ObjectReader> {
  }

  interface ObjectReader2 extends ObjectReader {
  }

  interface ObjectMapper1 extends ObjectMapper {
  }

  interface ObjectMapper2 extends ObjectMapper {
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy