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

odata.msgraph.client.entity.LearningContent 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.Boolean;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

@JsonPropertyOrder({
    "@odata.type", 
    "additionalTags", 
    "contentWebUrl", 
    "contributors", 
    "createdDateTime", 
    "description", 
    "duration", 
    "externalId", 
    "format", 
    "isActive", 
    "isPremium", 
    "isSearchable", 
    "languageTag", 
    "lastModifiedDateTime", 
    "numberOfPages", 
    "skillTags", 
    "sourceName", 
    "thumbnailWebUrl", 
    "title"})
@JsonInclude(Include.NON_NULL)
public class LearningContent extends Entity implements ODataEntityType {

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

    @JsonProperty("additionalTags")
    protected List additionalTags;

    @JsonProperty("additionalTags@nextLink")
    protected String additionalTagsNextLink;

    @JsonProperty("contentWebUrl")
    protected String contentWebUrl;

    @JsonProperty("contributors")
    protected List contributors;

    @JsonProperty("contributors@nextLink")
    protected String contributorsNextLink;

    @JsonProperty("createdDateTime")
    protected OffsetDateTime createdDateTime;

    @JsonProperty("description")
    protected String description;

    @JsonProperty("duration")
    protected Duration duration;

    @JsonProperty("externalId")
    protected String externalId;

    @JsonProperty("format")
    protected String format;

    @JsonProperty("isActive")
    protected Boolean isActive;

    @JsonProperty("isPremium")
    protected Boolean isPremium;

    @JsonProperty("isSearchable")
    protected Boolean isSearchable;

    @JsonProperty("languageTag")
    protected String languageTag;

    @JsonProperty("lastModifiedDateTime")
    protected OffsetDateTime lastModifiedDateTime;

    @JsonProperty("numberOfPages")
    protected Integer numberOfPages;

    @JsonProperty("skillTags")
    protected List skillTags;

    @JsonProperty("skillTags@nextLink")
    protected String skillTagsNextLink;

    @JsonProperty("sourceName")
    protected String sourceName;

    @JsonProperty("thumbnailWebUrl")
    protected String thumbnailWebUrl;

    @JsonProperty("title")
    protected String title;

    protected LearningContent() {
        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 builderLearningContent() {
        return new Builder();
    }

    public static final class Builder {
        private String id;
        private List additionalTags;
        private String additionalTagsNextLink;
        private String contentWebUrl;
        private List contributors;
        private String contributorsNextLink;
        private OffsetDateTime createdDateTime;
        private String description;
        private Duration duration;
        private String externalId;
        private String format;
        private Boolean isActive;
        private Boolean isPremium;
        private Boolean isSearchable;
        private String languageTag;
        private OffsetDateTime lastModifiedDateTime;
        private Integer numberOfPages;
        private List skillTags;
        private String skillTagsNextLink;
        private String sourceName;
        private String thumbnailWebUrl;
        private String title;
        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 additionalTags(List additionalTags) {
            this.additionalTags = additionalTags;
            this.changedFields = changedFields.add("additionalTags");
            return this;
        }

        public Builder additionalTags(String... additionalTags) {
            return additionalTags(Arrays.asList(additionalTags));
        }

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

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

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

        public Builder contributors(String... contributors) {
            return contributors(Arrays.asList(contributors));
        }

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

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

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

        public Builder duration(Duration duration) {
            this.duration = duration;
            this.changedFields = changedFields.add("duration");
            return this;
        }

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

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

        public Builder isActive(Boolean isActive) {
            this.isActive = isActive;
            this.changedFields = changedFields.add("isActive");
            return this;
        }

        public Builder isPremium(Boolean isPremium) {
            this.isPremium = isPremium;
            this.changedFields = changedFields.add("isPremium");
            return this;
        }

        public Builder isSearchable(Boolean isSearchable) {
            this.isSearchable = isSearchable;
            this.changedFields = changedFields.add("isSearchable");
            return this;
        }

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

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

        public Builder numberOfPages(Integer numberOfPages) {
            this.numberOfPages = numberOfPages;
            this.changedFields = changedFields.add("numberOfPages");
            return this;
        }

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

        public Builder skillTags(String... skillTags) {
            return skillTags(Arrays.asList(skillTags));
        }

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

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

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

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

        public LearningContent build() {
            LearningContent _x = new LearningContent();
            _x.contextPath = null;
            _x.changedFields = changedFields;
            _x.unmappedFields = new UnmappedFieldsImpl();
            _x.odataType = "microsoft.graph.learningContent";
            _x.id = id;
            _x.additionalTags = additionalTags;
            _x.additionalTagsNextLink = additionalTagsNextLink;
            _x.contentWebUrl = contentWebUrl;
            _x.contributors = contributors;
            _x.contributorsNextLink = contributorsNextLink;
            _x.createdDateTime = createdDateTime;
            _x.description = description;
            _x.duration = duration;
            _x.externalId = externalId;
            _x.format = format;
            _x.isActive = isActive;
            _x.isPremium = isPremium;
            _x.isSearchable = isSearchable;
            _x.languageTag = languageTag;
            _x.lastModifiedDateTime = lastModifiedDateTime;
            _x.numberOfPages = numberOfPages;
            _x.skillTags = skillTags;
            _x.skillTagsNextLink = skillTagsNextLink;
            _x.sourceName = sourceName;
            _x.thumbnailWebUrl = thumbnailWebUrl;
            _x.title = title;
            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="additionalTags")
    @JsonIgnore
    public CollectionPage getAdditionalTags() {
        return new CollectionPage(contextPath, String.class, this.additionalTags, Optional.ofNullable(additionalTagsNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
    }

    public LearningContent withAdditionalTags(List additionalTags) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("additionalTags");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.additionalTags = additionalTags;
        return _x;
    }

    @Property(name="additionalTags")
    @JsonIgnore
    public CollectionPage getAdditionalTags(HttpRequestOptions options) {
        return new CollectionPage(contextPath, String.class, this.additionalTags, Optional.ofNullable(additionalTagsNextLink), Collections.emptyList(), options);
    }

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

    public LearningContent withContentWebUrl(String contentWebUrl) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("contentWebUrl");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.contentWebUrl = contentWebUrl;
        return _x;
    }

    @Property(name="contributors")
    @JsonIgnore
    public CollectionPage getContributors() {
        return new CollectionPage(contextPath, String.class, this.contributors, Optional.ofNullable(contributorsNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
    }

    public LearningContent withContributors(List contributors) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("contributors");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.contributors = contributors;
        return _x;
    }

    @Property(name="contributors")
    @JsonIgnore
    public CollectionPage getContributors(HttpRequestOptions options) {
        return new CollectionPage(contextPath, String.class, this.contributors, Optional.ofNullable(contributorsNextLink), Collections.emptyList(), options);
    }

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

    public LearningContent withCreatedDateTime(OffsetDateTime createdDateTime) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("createdDateTime");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.createdDateTime = createdDateTime;
        return _x;
    }

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

    public LearningContent withDescription(String description) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("description");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.description = description;
        return _x;
    }

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

    public LearningContent withDuration(Duration duration) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("duration");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.duration = duration;
        return _x;
    }

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

    public LearningContent withExternalId(String externalId) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("externalId");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.externalId = externalId;
        return _x;
    }

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

    public LearningContent withFormat(String format) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("format");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.format = format;
        return _x;
    }

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

    public LearningContent withIsActive(Boolean isActive) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("isActive");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.isActive = isActive;
        return _x;
    }

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

    public LearningContent withIsPremium(Boolean isPremium) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("isPremium");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.isPremium = isPremium;
        return _x;
    }

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

    public LearningContent withIsSearchable(Boolean isSearchable) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("isSearchable");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.isSearchable = isSearchable;
        return _x;
    }

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

    public LearningContent withLanguageTag(String languageTag) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("languageTag");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.languageTag = languageTag;
        return _x;
    }

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

    public LearningContent withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("lastModifiedDateTime");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.lastModifiedDateTime = lastModifiedDateTime;
        return _x;
    }

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

    public LearningContent withNumberOfPages(Integer numberOfPages) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("numberOfPages");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.numberOfPages = numberOfPages;
        return _x;
    }

    @Property(name="skillTags")
    @JsonIgnore
    public CollectionPage getSkillTags() {
        return new CollectionPage(contextPath, String.class, this.skillTags, Optional.ofNullable(skillTagsNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
    }

    public LearningContent withSkillTags(List skillTags) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("skillTags");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.skillTags = skillTags;
        return _x;
    }

    @Property(name="skillTags")
    @JsonIgnore
    public CollectionPage getSkillTags(HttpRequestOptions options) {
        return new CollectionPage(contextPath, String.class, this.skillTags, Optional.ofNullable(skillTagsNextLink), Collections.emptyList(), options);
    }

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

    public LearningContent withSourceName(String sourceName) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("sourceName");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.sourceName = sourceName;
        return _x;
    }

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

    public LearningContent withThumbnailWebUrl(String thumbnailWebUrl) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("thumbnailWebUrl");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.thumbnailWebUrl = thumbnailWebUrl;
        return _x;
    }

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

    public LearningContent withTitle(String title) {
        LearningContent _x = _copy();
        _x.changedFields = changedFields.add("title");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.learningContent");
        _x.title = title;
        return _x;
    }

    public LearningContent withUnmappedField(String name, Object value) {
        LearningContent _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 LearningContent patch() {
        RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
        LearningContent _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 LearningContent put() {
        RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
        LearningContent _x = _copy();
        _x.changedFields = null;
        return _x;
    }

    private LearningContent _copy() {
        LearningContent _x = new LearningContent();
        _x.contextPath = contextPath;
        _x.changedFields = changedFields;
        _x.unmappedFields = unmappedFields.copy();
        _x.odataType = odataType;
        _x.id = id;
        _x.additionalTags = additionalTags;
        _x.contentWebUrl = contentWebUrl;
        _x.contributors = contributors;
        _x.createdDateTime = createdDateTime;
        _x.description = description;
        _x.duration = duration;
        _x.externalId = externalId;
        _x.format = format;
        _x.isActive = isActive;
        _x.isPremium = isPremium;
        _x.isSearchable = isSearchable;
        _x.languageTag = languageTag;
        _x.lastModifiedDateTime = lastModifiedDateTime;
        _x.numberOfPages = numberOfPages;
        _x.skillTags = skillTags;
        _x.sourceName = sourceName;
        _x.thumbnailWebUrl = thumbnailWebUrl;
        _x.title = title;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("LearningContent[");
        b.append("id=");
        b.append(this.id);
        b.append(", ");
        b.append("additionalTags=");
        b.append(this.additionalTags);
        b.append(", ");
        b.append("contentWebUrl=");
        b.append(this.contentWebUrl);
        b.append(", ");
        b.append("contributors=");
        b.append(this.contributors);
        b.append(", ");
        b.append("createdDateTime=");
        b.append(this.createdDateTime);
        b.append(", ");
        b.append("description=");
        b.append(this.description);
        b.append(", ");
        b.append("duration=");
        b.append(this.duration);
        b.append(", ");
        b.append("externalId=");
        b.append(this.externalId);
        b.append(", ");
        b.append("format=");
        b.append(this.format);
        b.append(", ");
        b.append("isActive=");
        b.append(this.isActive);
        b.append(", ");
        b.append("isPremium=");
        b.append(this.isPremium);
        b.append(", ");
        b.append("isSearchable=");
        b.append(this.isSearchable);
        b.append(", ");
        b.append("languageTag=");
        b.append(this.languageTag);
        b.append(", ");
        b.append("lastModifiedDateTime=");
        b.append(this.lastModifiedDateTime);
        b.append(", ");
        b.append("numberOfPages=");
        b.append(this.numberOfPages);
        b.append(", ");
        b.append("skillTags=");
        b.append(this.skillTags);
        b.append(", ");
        b.append("sourceName=");
        b.append(this.sourceName);
        b.append(", ");
        b.append("thumbnailWebUrl=");
        b.append(this.thumbnailWebUrl);
        b.append(", ");
        b.append("title=");
        b.append(this.title);
        b.append("]");
        b.append(",unmappedFields=");
        b.append(unmappedFields);
        b.append(",odataType=");
        b.append(odataType);
        return b.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy