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

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

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.ContextPath;
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.time.OffsetDateTime;
import java.util.Optional;

import odata.msgraph.client.enums.ChangeType;
import odata.msgraph.client.enums.LifecycleEventType;

@JsonPropertyOrder({
    "@odata.type", 
    "changeType", 
    "clientState", 
    "encryptedContent", 
    "id", 
    "lifecycleEvent", 
    "resource", 
    "resourceData", 
    "subscriptionExpirationDateTime", 
    "subscriptionId", 
    "tenantId"})
@JsonInclude(Include.NON_NULL)
public class ChangeNotification implements ODataType {

    @JacksonInject
    @JsonIgnore
    protected ContextPath contextPath;

    @JacksonInject
    @JsonIgnore
    protected UnmappedFieldsImpl unmappedFields;

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

    @JsonProperty("changeType")
    protected ChangeType changeType;

    @JsonProperty("clientState")
    protected String clientState;

    @JsonProperty("encryptedContent")
    protected ChangeNotificationEncryptedContent encryptedContent;

    @JsonProperty("id")
    protected String id;

    @JsonProperty("lifecycleEvent")
    protected LifecycleEventType lifecycleEvent;

    @JsonProperty("resource")
    protected String resource;

    @JsonProperty("resourceData")
    protected ResourceData resourceData;

    @JsonProperty("subscriptionExpirationDateTime")
    protected OffsetDateTime subscriptionExpirationDateTime;

    @JsonProperty("subscriptionId")
    protected String subscriptionId;

    @JsonProperty("tenantId")
    protected String tenantId;

    protected ChangeNotification() {
    }

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

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

    public ChangeNotification withChangeType(ChangeType changeType) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.changeType = changeType;
        return _x;
    }

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

    public ChangeNotification withClientState(String clientState) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.clientState = clientState;
        return _x;
    }

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

    public ChangeNotification withEncryptedContent(ChangeNotificationEncryptedContent encryptedContent) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.encryptedContent = encryptedContent;
        return _x;
    }

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

    public ChangeNotification withId(String id) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.id = id;
        return _x;
    }

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

    public ChangeNotification withLifecycleEvent(LifecycleEventType lifecycleEvent) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.lifecycleEvent = lifecycleEvent;
        return _x;
    }

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

    public ChangeNotification withResource(String resource) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.resource = resource;
        return _x;
    }

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

    public ChangeNotification withResourceData(ResourceData resourceData) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.resourceData = resourceData;
        return _x;
    }

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

    public ChangeNotification withSubscriptionExpirationDateTime(OffsetDateTime subscriptionExpirationDateTime) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.subscriptionExpirationDateTime = subscriptionExpirationDateTime;
        return _x;
    }

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

    public ChangeNotification withSubscriptionId(String subscriptionId) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.subscriptionId = subscriptionId;
        return _x;
    }

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

    public ChangeNotification withTenantId(String tenantId) {
        ChangeNotification _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.changeNotification");
        _x.tenantId = tenantId;
        return _x;
    }

    public ChangeNotification withUnmappedField(String name, String value) {
        ChangeNotification _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 ChangeType changeType;
        private String clientState;
        private ChangeNotificationEncryptedContent encryptedContent;
        private String id;
        private LifecycleEventType lifecycleEvent;
        private String resource;
        private ResourceData resourceData;
        private OffsetDateTime subscriptionExpirationDateTime;
        private String subscriptionId;
        private String tenantId;
        private ChangedFields changedFields = ChangedFields.EMPTY;

        Builder() {
            // prevent instantiation
        }

        public Builder changeType(ChangeType changeType) {
            this.changeType = changeType;
            this.changedFields = changedFields.add("changeType");
            return this;
        }

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

        public Builder encryptedContent(ChangeNotificationEncryptedContent encryptedContent) {
            this.encryptedContent = encryptedContent;
            this.changedFields = changedFields.add("encryptedContent");
            return this;
        }

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

        public Builder lifecycleEvent(LifecycleEventType lifecycleEvent) {
            this.lifecycleEvent = lifecycleEvent;
            this.changedFields = changedFields.add("lifecycleEvent");
            return this;
        }

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

        public Builder resourceData(ResourceData resourceData) {
            this.resourceData = resourceData;
            this.changedFields = changedFields.add("resourceData");
            return this;
        }

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

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

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

        public ChangeNotification build() {
            ChangeNotification _x = new ChangeNotification();
            _x.contextPath = null;
            _x.unmappedFields = new UnmappedFieldsImpl();
            _x.odataType = "microsoft.graph.changeNotification";
            _x.changeType = changeType;
            _x.clientState = clientState;
            _x.encryptedContent = encryptedContent;
            _x.id = id;
            _x.lifecycleEvent = lifecycleEvent;
            _x.resource = resource;
            _x.resourceData = resourceData;
            _x.subscriptionExpirationDateTime = subscriptionExpirationDateTime;
            _x.subscriptionId = subscriptionId;
            _x.tenantId = tenantId;
            return _x;
        }
    }

    private ChangeNotification _copy() {
        ChangeNotification _x = new ChangeNotification();
        _x.contextPath = contextPath;
        _x.unmappedFields = unmappedFields.copy();
        _x.odataType = odataType;
        _x.changeType = changeType;
        _x.clientState = clientState;
        _x.encryptedContent = encryptedContent;
        _x.id = id;
        _x.lifecycleEvent = lifecycleEvent;
        _x.resource = resource;
        _x.resourceData = resourceData;
        _x.subscriptionExpirationDateTime = subscriptionExpirationDateTime;
        _x.subscriptionId = subscriptionId;
        _x.tenantId = tenantId;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("ChangeNotification[");
        b.append("changeType=");
        b.append(this.changeType);
        b.append(", ");
        b.append("clientState=");
        b.append(this.clientState);
        b.append(", ");
        b.append("encryptedContent=");
        b.append(this.encryptedContent);
        b.append(", ");
        b.append("id=");
        b.append(this.id);
        b.append(", ");
        b.append("lifecycleEvent=");
        b.append(this.lifecycleEvent);
        b.append(", ");
        b.append("resource=");
        b.append(this.resource);
        b.append(", ");
        b.append("resourceData=");
        b.append(this.resourceData);
        b.append(", ");
        b.append("subscriptionExpirationDateTime=");
        b.append(this.subscriptionExpirationDateTime);
        b.append(", ");
        b.append("subscriptionId=");
        b.append(this.subscriptionId);
        b.append(", ");
        b.append("tenantId=");
        b.append(this.tenantId);
        b.append("]");
        b.append(",unmappedFields=");
        b.append(unmappedFields);
        b.append(",odataType=");
        b.append(odataType);
        return b.toString();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy