odata.test.trip.pin.entity.request.TripRequest Maven / Gradle / Ivy
package odata.test.trip.pin.entity.request;
import com.fasterxml.jackson.annotation.JsonIgnoreType;
import com.github.davidmoten.odata.client.CollectionPageEntityRequest;
import com.github.davidmoten.odata.client.ContextPath;
import com.github.davidmoten.odata.client.EntityRequest;
import com.github.davidmoten.odata.client.NameValue;
import odata.test.trip.pin.entity.Photo;
import odata.test.trip.pin.entity.PlanItem;
import odata.test.trip.pin.entity.Trip;
import odata.test.trip.pin.entity.request.PhotoRequest;
import odata.test.trip.pin.entity.request.PlanItemRequest;
import odata.test.trip.pin.schema.SchemaInfo;
@JsonIgnoreType
public final class TripRequest extends EntityRequest {
public TripRequest(ContextPath contextPath) {
super(Trip.class, contextPath, SchemaInfo.INSTANCE);
}
public CollectionPageEntityRequest photos() {
return new CollectionPageEntityRequest(
contextPath.addSegment("Photos"),
Photo.class,
contextPath -> new PhotoRequest(contextPath), SchemaInfo.INSTANCE);
}
public PhotoRequest photos(Long id) {
return new PhotoRequest(contextPath.addSegment("Photos").addKeys(new NameValue(id.toString())));
}
public CollectionPageEntityRequest planItems() {
return new CollectionPageEntityRequest(
contextPath.addSegment("PlanItems"),
PlanItem.class,
contextPath -> new PlanItemRequest(contextPath), SchemaInfo.INSTANCE);
}
public PlanItemRequest planItems(Integer planItemId) {
return new PlanItemRequest(contextPath.addSegment("PlanItems").addKeys(new NameValue(planItemId.toString())));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy