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

odata.msgraph.client.complex.ScheduleInformation Maven / Gradle / Ivy

There is a newer version: 0.2.2
Show newest version
package odata.msgraph.client.complex;

import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.github.davidmoten.odata.client.CollectionPage;
import com.github.davidmoten.odata.client.ContextPath;
import com.github.davidmoten.odata.client.HttpRequestOptions;
import com.github.davidmoten.odata.client.ODataType;
import com.github.davidmoten.odata.client.UnmappedFields;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.annotation.Property;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.UnmappedFieldsImpl;

import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

@JsonPropertyOrder({
    "@odata.type", 
    "availabilityView", 
    "error", 
    "scheduleId", 
    "scheduleItems", 
    "workingHours"})
@JsonInclude(Include.NON_NULL)
public class ScheduleInformation implements ODataType {

    @JacksonInject
    @JsonIgnore
    protected ContextPath contextPath;

    @JacksonInject
    @JsonIgnore
    protected UnmappedFieldsImpl unmappedFields;

    @JsonProperty("@odata.type")
    protected String odataType;

    @JsonProperty("availabilityView")
    protected String availabilityView;

    @JsonProperty("error")
    protected FreeBusyError error;

    @JsonProperty("scheduleId")
    protected String scheduleId;

    @JsonProperty("scheduleItems")
    protected List scheduleItems;

    @JsonProperty("scheduleItems@nextLink")
    protected String scheduleItemsNextLink;

    @JsonProperty("workingHours")
    protected WorkingHours workingHours;

    protected ScheduleInformation() {
    }

    @Override
    public String odataTypeName() {
        return "microsoft.graph.scheduleInformation";
    }

    @Property(name="availabilityView")
    @JsonIgnore
    public Optional getAvailabilityView() {
        return Optional.ofNullable(availabilityView);
    }

    public ScheduleInformation withAvailabilityView(String availabilityView) {
        ScheduleInformation _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.scheduleInformation");
        _x.availabilityView = availabilityView;
        return _x;
    }

    @Property(name="error")
    @JsonIgnore
    public Optional getError() {
        return Optional.ofNullable(error);
    }

    public ScheduleInformation withError(FreeBusyError error) {
        ScheduleInformation _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.scheduleInformation");
        _x.error = error;
        return _x;
    }

    @Property(name="scheduleId")
    @JsonIgnore
    public Optional getScheduleId() {
        return Optional.ofNullable(scheduleId);
    }

    public ScheduleInformation withScheduleId(String scheduleId) {
        ScheduleInformation _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.scheduleInformation");
        _x.scheduleId = scheduleId;
        return _x;
    }

    @Property(name="scheduleItems")
    @JsonIgnore
    public CollectionPage getScheduleItems() {
        return new CollectionPage(contextPath, ScheduleItem.class, this.scheduleItems, Optional.ofNullable(scheduleItemsNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
    }

    @Property(name="scheduleItems")
    @JsonIgnore
    public CollectionPage getScheduleItems(HttpRequestOptions options) {
        return new CollectionPage(contextPath, ScheduleItem.class, this.scheduleItems, Optional.ofNullable(scheduleItemsNextLink), Collections.emptyList(), options);
    }

    @Property(name="workingHours")
    @JsonIgnore
    public Optional getWorkingHours() {
        return Optional.ofNullable(workingHours);
    }

    public ScheduleInformation withWorkingHours(WorkingHours workingHours) {
        ScheduleInformation _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.scheduleInformation");
        _x.workingHours = workingHours;
        return _x;
    }

    public ScheduleInformation withUnmappedField(String name, Object value) {
        ScheduleInformation _x = _copy();
        _x.setUnmappedField(name, value);
        return _x;
    }

    @JsonAnySetter
    private void setUnmappedField(String name, Object value) {
        if (unmappedFields == null) {
            unmappedFields = new UnmappedFieldsImpl();
        }
        unmappedFields.put(name, value);
    }

    @JsonAnyGetter
    private UnmappedFieldsImpl unmappedFields() {
        return unmappedFields == null ? UnmappedFieldsImpl.EMPTY : unmappedFields;
    }

    @Override
    public UnmappedFields getUnmappedFields() {
        return unmappedFields();
    }

    @Override
    public void postInject(boolean addKeysToContextPath) {
        // do nothing;
    }

    /**
     * Returns a builder which is used to create a new
     * instance of this class (given that this class is immutable).
     *
     * @return a new Builder for this class
     */
    // Suffix used on builder factory method to differentiate the method
    // from static builder methods on superclasses
    public static Builder builder() {
        return new Builder();
    }

    public static final class Builder {
        private String availabilityView;
        private FreeBusyError error;
        private String scheduleId;
        private List scheduleItems;
        private String scheduleItemsNextLink;
        private WorkingHours workingHours;
        private ChangedFields changedFields = ChangedFields.EMPTY;

        Builder() {
            // prevent instantiation
        }

        public Builder availabilityView(String availabilityView) {
            this.availabilityView = availabilityView;
            this.changedFields = changedFields.add("availabilityView");
            return this;
        }

        public Builder error(FreeBusyError error) {
            this.error = error;
            this.changedFields = changedFields.add("error");
            return this;
        }

        public Builder scheduleId(String scheduleId) {
            this.scheduleId = scheduleId;
            this.changedFields = changedFields.add("scheduleId");
            return this;
        }

        public Builder scheduleItems(List scheduleItems) {
            this.scheduleItems = scheduleItems;
            this.changedFields = changedFields.add("scheduleItems");
            return this;
        }

        public Builder scheduleItems(ScheduleItem... scheduleItems) {
            return scheduleItems(Arrays.asList(scheduleItems));
        }

        public Builder scheduleItemsNextLink(String scheduleItemsNextLink) {
            this.scheduleItemsNextLink = scheduleItemsNextLink;
            this.changedFields = changedFields.add("scheduleItems");
            return this;
        }

        public Builder workingHours(WorkingHours workingHours) {
            this.workingHours = workingHours;
            this.changedFields = changedFields.add("workingHours");
            return this;
        }

        public ScheduleInformation build() {
            ScheduleInformation _x = new ScheduleInformation();
            _x.contextPath = null;
            _x.unmappedFields = new UnmappedFieldsImpl();
            _x.odataType = "microsoft.graph.scheduleInformation";
            _x.availabilityView = availabilityView;
            _x.error = error;
            _x.scheduleId = scheduleId;
            _x.scheduleItems = scheduleItems;
            _x.scheduleItemsNextLink = scheduleItemsNextLink;
            _x.workingHours = workingHours;
            return _x;
        }
    }

    private ScheduleInformation _copy() {
        ScheduleInformation _x = new ScheduleInformation();
        _x.contextPath = contextPath;
        _x.unmappedFields = unmappedFields.copy();
        _x.odataType = odataType;
        _x.availabilityView = availabilityView;
        _x.error = error;
        _x.scheduleId = scheduleId;
        _x.scheduleItems = scheduleItems;
        _x.workingHours = workingHours;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("ScheduleInformation[");
        b.append("availabilityView=");
        b.append(this.availabilityView);
        b.append(", ");
        b.append("error=");
        b.append(this.error);
        b.append(", ");
        b.append("scheduleId=");
        b.append(this.scheduleId);
        b.append(", ");
        b.append("scheduleItems=");
        b.append(this.scheduleItems);
        b.append(", ");
        b.append("workingHours=");
        b.append(this.workingHours);
        b.append("]");
        b.append(",unmappedFields=");
        b.append(unmappedFields);
        b.append(",odataType=");
        b.append(odataType);
        return b.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy