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

odata.msgraph.client.entity.request.BookingBusinessRequest Maven / Gradle / Ivy

package odata.msgraph.client.entity.request;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreType;
import com.github.davidmoten.guavamini.Preconditions;
import com.github.davidmoten.odata.client.ActionRequestNoReturn;
import com.github.davidmoten.odata.client.CollectionPageNonEntityRequest;
import com.github.davidmoten.odata.client.ContextPath;
import com.github.davidmoten.odata.client.EntityRequest;
import com.github.davidmoten.odata.client.NameValue;
import com.github.davidmoten.odata.client.annotation.Action;
import com.github.davidmoten.odata.client.internal.Checks;
import com.github.davidmoten.odata.client.internal.ParameterMap;
import com.github.davidmoten.odata.client.internal.TypedObject;

import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import odata.msgraph.client.complex.DateTimeTimeZone;
import odata.msgraph.client.complex.StaffAvailabilityItem;
import odata.msgraph.client.entity.BookingBusiness;
import odata.msgraph.client.entity.collection.request.BookingAppointmentCollectionRequest;
import odata.msgraph.client.entity.collection.request.BookingCustomQuestionCollectionRequest;
import odata.msgraph.client.entity.collection.request.BookingCustomerBaseCollectionRequest;
import odata.msgraph.client.entity.collection.request.BookingServiceCollectionRequest;
import odata.msgraph.client.entity.collection.request.BookingStaffMemberBaseCollectionRequest;

@JsonIgnoreType
public class BookingBusinessRequest extends EntityRequest {

    public BookingBusinessRequest(ContextPath contextPath, Optional value) {
        super(BookingBusiness.class, contextPath, value, false);
    }

    public BookingAppointmentRequest appointments(String id) {
        return new BookingAppointmentRequest(contextPath.addSegment("appointments").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    public BookingAppointmentCollectionRequest appointments() {
        return new BookingAppointmentCollectionRequest(
                        contextPath.addSegment("appointments"), Optional.empty());
    }

    public BookingAppointmentRequest calendarView(String id) {
        return new BookingAppointmentRequest(contextPath.addSegment("calendarView").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    public BookingAppointmentCollectionRequest calendarView() {
        return new BookingAppointmentCollectionRequest(
                        contextPath.addSegment("calendarView"), Optional.empty());
    }

    public BookingCustomerBaseRequest customers(String id) {
        return new BookingCustomerBaseRequest(contextPath.addSegment("customers").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    public BookingCustomerBaseCollectionRequest customers() {
        return new BookingCustomerBaseCollectionRequest(
                        contextPath.addSegment("customers"), Optional.empty());
    }

    public BookingCustomQuestionRequest customQuestions(String id) {
        return new BookingCustomQuestionRequest(contextPath.addSegment("customQuestions").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    public BookingCustomQuestionCollectionRequest customQuestions() {
        return new BookingCustomQuestionCollectionRequest(
                        contextPath.addSegment("customQuestions"), Optional.empty());
    }

    public BookingServiceRequest services(String id) {
        return new BookingServiceRequest(contextPath.addSegment("services").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    public BookingServiceCollectionRequest services() {
        return new BookingServiceCollectionRequest(
                        contextPath.addSegment("services"), Optional.empty());
    }

    public BookingStaffMemberBaseRequest staffMembers(String id) {
        return new BookingStaffMemberBaseRequest(contextPath.addSegment("staffMembers").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    public BookingStaffMemberBaseCollectionRequest staffMembers() {
        return new BookingStaffMemberBaseCollectionRequest(
                        contextPath.addSegment("staffMembers"), Optional.empty());
    }

    @Action(name = "getStaffAvailability")
    @JsonIgnore
    public CollectionPageNonEntityRequest getStaffAvailability(List staffIds, DateTimeTimeZone startDateTime, DateTimeTimeZone endDateTime) {
        Preconditions.checkNotNull(staffIds, "staffIds cannot be null");
        Preconditions.checkNotNull(startDateTime, "startDateTime cannot be null");
        Preconditions.checkNotNull(endDateTime, "endDateTime cannot be null");
        Map _parameters = ParameterMap
            .put("staffIds", "Collection(Edm.String)", Checks.checkIsAscii(staffIds))
            .put("startDateTime", "microsoft.graph.dateTimeTimeZone", startDateTime)
            .put("endDateTime", "microsoft.graph.dateTimeTimeZone", endDateTime)
            .build();
        return CollectionPageNonEntityRequest.forAction(this.contextPath.addActionOrFunctionSegment("microsoft.graph.getStaffAvailability"), StaffAvailabilityItem.class, _parameters);
    }

    @Action(name = "publish")
    @JsonIgnore
    public ActionRequestNoReturn publish() {
        Map _parameters = ParameterMap.empty();
        return new ActionRequestNoReturn(this.contextPath.addActionOrFunctionSegment("microsoft.graph.publish"), _parameters);
    }

    @Action(name = "unpublish")
    @JsonIgnore
    public ActionRequestNoReturn unpublish() {
        Map _parameters = ParameterMap.empty();
        return new ActionRequestNoReturn(this.contextPath.addActionOrFunctionSegment("microsoft.graph.unpublish"), _parameters);
    }

}