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

odata.msgraph.client.entity.VirtualEventRegistration Maven / Gradle / Ivy

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

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.ClientException;
import com.github.davidmoten.odata.client.CollectionPage;
import com.github.davidmoten.odata.client.HttpRequestOptions;
import com.github.davidmoten.odata.client.NameValue;
import com.github.davidmoten.odata.client.ODataEntityType;
import com.github.davidmoten.odata.client.RequestOptions;
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.RequestHelper;
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.time.OffsetDateTime;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

import odata.msgraph.client.complex.VirtualEventRegistrationQuestionAnswer;
import odata.msgraph.client.enums.VirtualEventAttendeeRegistrationStatus;

@JsonPropertyOrder({
    "@odata.type", 
    "cancelationDateTime", 
    "email", 
    "firstName", 
    "lastName", 
    "registrationDateTime", 
    "registrationQuestionAnswers", 
    "status", 
    "userId"})
@JsonInclude(Include.NON_NULL)
public class VirtualEventRegistration extends Entity implements ODataEntityType {

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

    @JsonProperty("cancelationDateTime")
    protected OffsetDateTime cancelationDateTime;

    @JsonProperty("email")
    protected String email;

    @JsonProperty("firstName")
    protected String firstName;

    @JsonProperty("lastName")
    protected String lastName;

    @JsonProperty("registrationDateTime")
    protected OffsetDateTime registrationDateTime;

    @JsonProperty("registrationQuestionAnswers")
    protected List registrationQuestionAnswers;

    @JsonProperty("registrationQuestionAnswers@nextLink")
    protected String registrationQuestionAnswersNextLink;

    @JsonProperty("status")
    protected VirtualEventAttendeeRegistrationStatus status;

    @JsonProperty("userId")
    protected String userId;

    protected VirtualEventRegistration() {
        super();
    }

    /**
     * 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 builderVirtualEventRegistration() {
        return new Builder();
    }

    public static final class Builder {
        private String id;
        private OffsetDateTime cancelationDateTime;
        private String email;
        private String firstName;
        private String lastName;
        private OffsetDateTime registrationDateTime;
        private List registrationQuestionAnswers;
        private String registrationQuestionAnswersNextLink;
        private VirtualEventAttendeeRegistrationStatus status;
        private String userId;
        private ChangedFields changedFields = ChangedFields.EMPTY;

        Builder() {
            // prevent instantiation
        }

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

        public Builder cancelationDateTime(OffsetDateTime cancelationDateTime) {
            this.cancelationDateTime = cancelationDateTime;
            this.changedFields = changedFields.add("cancelationDateTime");
            return this;
        }

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

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

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

        public Builder registrationDateTime(OffsetDateTime registrationDateTime) {
            this.registrationDateTime = registrationDateTime;
            this.changedFields = changedFields.add("registrationDateTime");
            return this;
        }

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

        public Builder registrationQuestionAnswers(VirtualEventRegistrationQuestionAnswer... registrationQuestionAnswers) {
            return registrationQuestionAnswers(Arrays.asList(registrationQuestionAnswers));
        }

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

        public Builder status(VirtualEventAttendeeRegistrationStatus status) {
            this.status = status;
            this.changedFields = changedFields.add("status");
            return this;
        }

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

        public VirtualEventRegistration build() {
            VirtualEventRegistration _x = new VirtualEventRegistration();
            _x.contextPath = null;
            _x.changedFields = changedFields;
            _x.unmappedFields = new UnmappedFieldsImpl();
            _x.odataType = "microsoft.graph.virtualEventRegistration";
            _x.id = id;
            _x.cancelationDateTime = cancelationDateTime;
            _x.email = email;
            _x.firstName = firstName;
            _x.lastName = lastName;
            _x.registrationDateTime = registrationDateTime;
            _x.registrationQuestionAnswers = registrationQuestionAnswers;
            _x.registrationQuestionAnswersNextLink = registrationQuestionAnswersNextLink;
            _x.status = status;
            _x.userId = userId;
            return _x;
        }
    }

    @Override
    @JsonIgnore
    public ChangedFields getChangedFields() {
        return changedFields;
    }

    @Override
    public void postInject(boolean addKeysToContextPath) {
        if (addKeysToContextPath && id != null) {
            contextPath = contextPath.clearQueries().addKeys(new NameValue(id, String.class));
        }
    }

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

    public VirtualEventRegistration withCancelationDateTime(OffsetDateTime cancelationDateTime) {
        VirtualEventRegistration _x = _copy();
        _x.changedFields = changedFields.add("cancelationDateTime");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.virtualEventRegistration");
        _x.cancelationDateTime = cancelationDateTime;
        return _x;
    }

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

    public VirtualEventRegistration withEmail(String email) {
        VirtualEventRegistration _x = _copy();
        _x.changedFields = changedFields.add("email");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.virtualEventRegistration");
        _x.email = email;
        return _x;
    }

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

    public VirtualEventRegistration withFirstName(String firstName) {
        VirtualEventRegistration _x = _copy();
        _x.changedFields = changedFields.add("firstName");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.virtualEventRegistration");
        _x.firstName = firstName;
        return _x;
    }

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

    public VirtualEventRegistration withLastName(String lastName) {
        VirtualEventRegistration _x = _copy();
        _x.changedFields = changedFields.add("lastName");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.virtualEventRegistration");
        _x.lastName = lastName;
        return _x;
    }

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

    public VirtualEventRegistration withRegistrationDateTime(OffsetDateTime registrationDateTime) {
        VirtualEventRegistration _x = _copy();
        _x.changedFields = changedFields.add("registrationDateTime");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.virtualEventRegistration");
        _x.registrationDateTime = registrationDateTime;
        return _x;
    }

    @Property(name="registrationQuestionAnswers")
    @JsonIgnore
    public CollectionPage getRegistrationQuestionAnswers() {
        return new CollectionPage(contextPath, VirtualEventRegistrationQuestionAnswer.class, this.registrationQuestionAnswers, Optional.ofNullable(registrationQuestionAnswersNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
    }

    public VirtualEventRegistration withRegistrationQuestionAnswers(List registrationQuestionAnswers) {
        VirtualEventRegistration _x = _copy();
        _x.changedFields = changedFields.add("registrationQuestionAnswers");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.virtualEventRegistration");
        _x.registrationQuestionAnswers = registrationQuestionAnswers;
        return _x;
    }

    @Property(name="registrationQuestionAnswers")
    @JsonIgnore
    public CollectionPage getRegistrationQuestionAnswers(HttpRequestOptions options) {
        return new CollectionPage(contextPath, VirtualEventRegistrationQuestionAnswer.class, this.registrationQuestionAnswers, Optional.ofNullable(registrationQuestionAnswersNextLink), Collections.emptyList(), options);
    }

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

    public VirtualEventRegistration withStatus(VirtualEventAttendeeRegistrationStatus status) {
        VirtualEventRegistration _x = _copy();
        _x.changedFields = changedFields.add("status");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.virtualEventRegistration");
        _x.status = status;
        return _x;
    }

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

    public VirtualEventRegistration withUserId(String userId) {
        VirtualEventRegistration _x = _copy();
        _x.changedFields = changedFields.add("userId");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.virtualEventRegistration");
        _x.userId = userId;
        return _x;
    }

    public VirtualEventRegistration withUnmappedField(String name, Object value) {
        VirtualEventRegistration _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();
    }

    /**
     * Submits only changed fields for update and returns an 
     * immutable copy of {@code this} with changed fields reset.
     *
     * @return a copy of {@code this} with changed fields reset
     * @throws ClientException if HTTP response is not as expected
     */
    public VirtualEventRegistration patch() {
        RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
        VirtualEventRegistration _x = _copy();
        _x.changedFields = null;
        return _x;
    }

    /**
     * Submits all fields for update and returns an immutable copy of {@code this}
     * with changed fields reset (they were ignored anyway).
     *
     * @return a copy of {@code this} with changed fields reset
     * @throws ClientException if HTTP response is not as expected
     */
    public VirtualEventRegistration put() {
        RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
        VirtualEventRegistration _x = _copy();
        _x.changedFields = null;
        return _x;
    }

    private VirtualEventRegistration _copy() {
        VirtualEventRegistration _x = new VirtualEventRegistration();
        _x.contextPath = contextPath;
        _x.changedFields = changedFields;
        _x.unmappedFields = unmappedFields.copy();
        _x.odataType = odataType;
        _x.id = id;
        _x.cancelationDateTime = cancelationDateTime;
        _x.email = email;
        _x.firstName = firstName;
        _x.lastName = lastName;
        _x.registrationDateTime = registrationDateTime;
        _x.registrationQuestionAnswers = registrationQuestionAnswers;
        _x.status = status;
        _x.userId = userId;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("VirtualEventRegistration[");
        b.append("id=");
        b.append(this.id);
        b.append(", ");
        b.append("cancelationDateTime=");
        b.append(this.cancelationDateTime);
        b.append(", ");
        b.append("email=");
        b.append(this.email);
        b.append(", ");
        b.append("firstName=");
        b.append(this.firstName);
        b.append(", ");
        b.append("lastName=");
        b.append(this.lastName);
        b.append(", ");
        b.append("registrationDateTime=");
        b.append(this.registrationDateTime);
        b.append(", ");
        b.append("registrationQuestionAnswers=");
        b.append(this.registrationQuestionAnswers);
        b.append(", ");
        b.append("status=");
        b.append(this.status);
        b.append(", ");
        b.append("userId=");
        b.append(this.userId);
        b.append("]");
        b.append(",unmappedFields=");
        b.append(unmappedFields);
        b.append(",odataType=");
        b.append(odataType);
        return b.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy