/* 
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

package dev.plexapi.sdk.models.operations;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

/**
 * GetRecentlyAddedLibraryMediaContainer - The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
 * 
 */

public class GetRecentlyAddedLibraryMediaContainer {

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Type")
    private Optional<? extends List<GetRecentlyAddedLibraryType>> type;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("FieldType")
    private Optional<? extends List<FieldType>> fieldType;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("size")
    private Optional<Double> size;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("allowSync")
    private Optional<Boolean> allowSync;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("identifier")
    private Optional<String> identifier;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("mediaTagPrefix")
    private Optional<String> mediaTagPrefix;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("mediaTagVersion")
    private Optional<Double> mediaTagVersion;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("mixedParents")
    private Optional<Boolean> mixedParents;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Metadata")
    private Optional<? extends List<GetRecentlyAddedLibraryMetadata>> metadata;

    @JsonCreator
    public GetRecentlyAddedLibraryMediaContainer(
            @JsonProperty("Type") Optional<? extends List<GetRecentlyAddedLibraryType>> type,
            @JsonProperty("FieldType") Optional<? extends List<FieldType>> fieldType,
            @JsonProperty("size") Optional<Double> size,
            @JsonProperty("allowSync") Optional<Boolean> allowSync,
            @JsonProperty("identifier") Optional<String> identifier,
            @JsonProperty("mediaTagPrefix") Optional<String> mediaTagPrefix,
            @JsonProperty("mediaTagVersion") Optional<Double> mediaTagVersion,
            @JsonProperty("mixedParents") Optional<Boolean> mixedParents,
            @JsonProperty("Metadata") Optional<? extends List<GetRecentlyAddedLibraryMetadata>> metadata) {
        Utils.checkNotNull(type, "type");
        Utils.checkNotNull(fieldType, "fieldType");
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(allowSync, "allowSync");
        Utils.checkNotNull(identifier, "identifier");
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        Utils.checkNotNull(mixedParents, "mixedParents");
        Utils.checkNotNull(metadata, "metadata");
        this.type = type;
        this.fieldType = fieldType;
        this.size = size;
        this.allowSync = allowSync;
        this.identifier = identifier;
        this.mediaTagPrefix = mediaTagPrefix;
        this.mediaTagVersion = mediaTagVersion;
        this.mixedParents = mixedParents;
        this.metadata = metadata;
    }
    
    public GetRecentlyAddedLibraryMediaContainer() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetRecentlyAddedLibraryType>> type() {
        return (Optional<List<GetRecentlyAddedLibraryType>>) type;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<FieldType>> fieldType() {
        return (Optional<List<FieldType>>) fieldType;
    }

    @JsonIgnore
    public Optional<Double> size() {
        return size;
    }

    @JsonIgnore
    public Optional<Boolean> allowSync() {
        return allowSync;
    }

    @JsonIgnore
    public Optional<String> identifier() {
        return identifier;
    }

    @JsonIgnore
    public Optional<String> mediaTagPrefix() {
        return mediaTagPrefix;
    }

    @JsonIgnore
    public Optional<Double> mediaTagVersion() {
        return mediaTagVersion;
    }

    @JsonIgnore
    public Optional<Boolean> mixedParents() {
        return mixedParents;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<GetRecentlyAddedLibraryMetadata>> metadata() {
        return (Optional<List<GetRecentlyAddedLibraryMetadata>>) metadata;
    }

    public final static Builder builder() {
        return new Builder();
    }

    public GetRecentlyAddedLibraryMediaContainer withType(List<GetRecentlyAddedLibraryType> type) {
        Utils.checkNotNull(type, "type");
        this.type = Optional.ofNullable(type);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withType(Optional<? extends List<GetRecentlyAddedLibraryType>> type) {
        Utils.checkNotNull(type, "type");
        this.type = type;
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withFieldType(List<FieldType> fieldType) {
        Utils.checkNotNull(fieldType, "fieldType");
        this.fieldType = Optional.ofNullable(fieldType);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withFieldType(Optional<? extends List<FieldType>> fieldType) {
        Utils.checkNotNull(fieldType, "fieldType");
        this.fieldType = fieldType;
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withSize(double size) {
        Utils.checkNotNull(size, "size");
        this.size = Optional.ofNullable(size);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withSize(Optional<Double> size) {
        Utils.checkNotNull(size, "size");
        this.size = size;
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withAllowSync(boolean allowSync) {
        Utils.checkNotNull(allowSync, "allowSync");
        this.allowSync = Optional.ofNullable(allowSync);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withAllowSync(Optional<Boolean> allowSync) {
        Utils.checkNotNull(allowSync, "allowSync");
        this.allowSync = allowSync;
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withIdentifier(String identifier) {
        Utils.checkNotNull(identifier, "identifier");
        this.identifier = Optional.ofNullable(identifier);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withIdentifier(Optional<String> identifier) {
        Utils.checkNotNull(identifier, "identifier");
        this.identifier = identifier;
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withMediaTagPrefix(String mediaTagPrefix) {
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withMediaTagPrefix(Optional<String> mediaTagPrefix) {
        Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
        this.mediaTagPrefix = mediaTagPrefix;
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withMediaTagVersion(double mediaTagVersion) {
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        this.mediaTagVersion = Optional.ofNullable(mediaTagVersion);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withMediaTagVersion(Optional<Double> mediaTagVersion) {
        Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
        this.mediaTagVersion = mediaTagVersion;
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withMixedParents(boolean mixedParents) {
        Utils.checkNotNull(mixedParents, "mixedParents");
        this.mixedParents = Optional.ofNullable(mixedParents);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withMixedParents(Optional<Boolean> mixedParents) {
        Utils.checkNotNull(mixedParents, "mixedParents");
        this.mixedParents = mixedParents;
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withMetadata(List<GetRecentlyAddedLibraryMetadata> metadata) {
        Utils.checkNotNull(metadata, "metadata");
        this.metadata = Optional.ofNullable(metadata);
        return this;
    }

    public GetRecentlyAddedLibraryMediaContainer withMetadata(Optional<? extends List<GetRecentlyAddedLibraryMetadata>> metadata) {
        Utils.checkNotNull(metadata, "metadata");
        this.metadata = metadata;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetRecentlyAddedLibraryMediaContainer other = (GetRecentlyAddedLibraryMediaContainer) o;
        return 
            Objects.deepEquals(this.type, other.type) &&
            Objects.deepEquals(this.fieldType, other.fieldType) &&
            Objects.deepEquals(this.size, other.size) &&
            Objects.deepEquals(this.allowSync, other.allowSync) &&
            Objects.deepEquals(this.identifier, other.identifier) &&
            Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) &&
            Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) &&
            Objects.deepEquals(this.mixedParents, other.mixedParents) &&
            Objects.deepEquals(this.metadata, other.metadata);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            type,
            fieldType,
            size,
            allowSync,
            identifier,
            mediaTagPrefix,
            mediaTagVersion,
            mixedParents,
            metadata);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetRecentlyAddedLibraryMediaContainer.class,
                "type", type,
                "fieldType", fieldType,
                "size", size,
                "allowSync", allowSync,
                "identifier", identifier,
                "mediaTagPrefix", mediaTagPrefix,
                "mediaTagVersion", mediaTagVersion,
                "mixedParents", mixedParents,
                "metadata", metadata);
    }
    
    public final static class Builder {
 
        private Optional<? extends List<GetRecentlyAddedLibraryType>> type = Optional.empty();
 
        private Optional<? extends List<FieldType>> fieldType = Optional.empty();
 
        private Optional<Double> size = Optional.empty();
 
        private Optional<Boolean> allowSync = Optional.empty();
 
        private Optional<String> identifier = Optional.empty();
 
        private Optional<String> mediaTagPrefix = Optional.empty();
 
        private Optional<Double> mediaTagVersion = Optional.empty();
 
        private Optional<Boolean> mixedParents = Optional.empty();
 
        private Optional<? extends List<GetRecentlyAddedLibraryMetadata>> metadata = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        public Builder type(List<GetRecentlyAddedLibraryType> type) {
            Utils.checkNotNull(type, "type");
            this.type = Optional.ofNullable(type);
            return this;
        }

        public Builder type(Optional<? extends List<GetRecentlyAddedLibraryType>> type) {
            Utils.checkNotNull(type, "type");
            this.type = type;
            return this;
        }

        public Builder fieldType(List<FieldType> fieldType) {
            Utils.checkNotNull(fieldType, "fieldType");
            this.fieldType = Optional.ofNullable(fieldType);
            return this;
        }

        public Builder fieldType(Optional<? extends List<FieldType>> fieldType) {
            Utils.checkNotNull(fieldType, "fieldType");
            this.fieldType = fieldType;
            return this;
        }

        public Builder size(double size) {
            Utils.checkNotNull(size, "size");
            this.size = Optional.ofNullable(size);
            return this;
        }

        public Builder size(Optional<Double> size) {
            Utils.checkNotNull(size, "size");
            this.size = size;
            return this;
        }

        public Builder allowSync(boolean allowSync) {
            Utils.checkNotNull(allowSync, "allowSync");
            this.allowSync = Optional.ofNullable(allowSync);
            return this;
        }

        public Builder allowSync(Optional<Boolean> allowSync) {
            Utils.checkNotNull(allowSync, "allowSync");
            this.allowSync = allowSync;
            return this;
        }

        public Builder identifier(String identifier) {
            Utils.checkNotNull(identifier, "identifier");
            this.identifier = Optional.ofNullable(identifier);
            return this;
        }

        public Builder identifier(Optional<String> identifier) {
            Utils.checkNotNull(identifier, "identifier");
            this.identifier = identifier;
            return this;
        }

        public Builder mediaTagPrefix(String mediaTagPrefix) {
            Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
            this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix);
            return this;
        }

        public Builder mediaTagPrefix(Optional<String> mediaTagPrefix) {
            Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix");
            this.mediaTagPrefix = mediaTagPrefix;
            return this;
        }

        public Builder mediaTagVersion(double mediaTagVersion) {
            Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
            this.mediaTagVersion = Optional.ofNullable(mediaTagVersion);
            return this;
        }

        public Builder mediaTagVersion(Optional<Double> mediaTagVersion) {
            Utils.checkNotNull(mediaTagVersion, "mediaTagVersion");
            this.mediaTagVersion = mediaTagVersion;
            return this;
        }

        public Builder mixedParents(boolean mixedParents) {
            Utils.checkNotNull(mixedParents, "mixedParents");
            this.mixedParents = Optional.ofNullable(mixedParents);
            return this;
        }

        public Builder mixedParents(Optional<Boolean> mixedParents) {
            Utils.checkNotNull(mixedParents, "mixedParents");
            this.mixedParents = mixedParents;
            return this;
        }

        public Builder metadata(List<GetRecentlyAddedLibraryMetadata> metadata) {
            Utils.checkNotNull(metadata, "metadata");
            this.metadata = Optional.ofNullable(metadata);
            return this;
        }

        public Builder metadata(Optional<? extends List<GetRecentlyAddedLibraryMetadata>> metadata) {
            Utils.checkNotNull(metadata, "metadata");
            this.metadata = metadata;
            return this;
        }
        
        public GetRecentlyAddedLibraryMediaContainer build() {
            return new GetRecentlyAddedLibraryMediaContainer(
                type,
                fieldType,
                size,
                allowSync,
                identifier,
                mediaTagPrefix,
                mediaTagVersion,
                mixedParents,
                metadata);
        }
    }
}

