odata.test.trip.pin.entity.request.PersonRequest 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.Person;
import odata.test.trip.pin.entity.Trip;
import odata.test.trip.pin.entity.request.PhotoRequest;
import odata.test.trip.pin.entity.request.TripRequest;
import odata.test.trip.pin.schema.SchemaInfo;
@JsonIgnoreType
public final class PersonRequest extends EntityRequest {
public PersonRequest(ContextPath contextPath) {
super(Person.class, contextPath, SchemaInfo.INSTANCE);
}
public CollectionPageEntityRequest friends() {
return new CollectionPageEntityRequest(
contextPath.addSegment("Friends"),
Person.class,
contextPath -> new odata.test.trip.pin.entity.request.PersonRequest(contextPath), SchemaInfo.INSTANCE);
}
public odata.test.trip.pin.entity.request.PersonRequest friends(String userName) {
return new odata.test.trip.pin.entity.request.PersonRequest(contextPath.addSegment("Friends").addKeys(new NameValue(userName.toString())));
}
public CollectionPageEntityRequest trips() {
return new CollectionPageEntityRequest(
contextPath.addSegment("Trips"),
Trip.class,
contextPath -> new TripRequest(contextPath), SchemaInfo.INSTANCE);
}
public TripRequest trips(Integer tripId) {
return new TripRequest(contextPath.addSegment("Trips").addKeys(new NameValue(tripId.toString())));
}
public PhotoRequest photo() {
return new PhotoRequest(contextPath.addSegment("Photo"));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy