/* 
 * 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.Integer;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

/**
 * GetWatchListResponseBody - Watchlist Data
 */

public class GetWatchListResponseBody {

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("offset")
    private Optional<Integer> offset;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("totalSize")
    private Optional<Integer> totalSize;

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

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

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

    @JsonCreator
    public GetWatchListResponseBody(
            @JsonProperty("librarySectionID") Optional<String> librarySectionID,
            @JsonProperty("librarySectionTitle") Optional<String> librarySectionTitle,
            @JsonProperty("offset") Optional<Integer> offset,
            @JsonProperty("totalSize") Optional<Integer> totalSize,
            @JsonProperty("identifier") Optional<String> identifier,
            @JsonProperty("size") Optional<Integer> size,
            @JsonProperty("Metadata") Optional<? extends List<Metadata>> metadata) {
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        Utils.checkNotNull(offset, "offset");
        Utils.checkNotNull(totalSize, "totalSize");
        Utils.checkNotNull(identifier, "identifier");
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(metadata, "metadata");
        this.librarySectionID = librarySectionID;
        this.librarySectionTitle = librarySectionTitle;
        this.offset = offset;
        this.totalSize = totalSize;
        this.identifier = identifier;
        this.size = size;
        this.metadata = metadata;
    }
    
    public GetWatchListResponseBody() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

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

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

    @JsonIgnore
    public Optional<Integer> offset() {
        return offset;
    }

    @JsonIgnore
    public Optional<Integer> totalSize() {
        return totalSize;
    }

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

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

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

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

    public GetWatchListResponseBody withLibrarySectionID(String librarySectionID) {
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        this.librarySectionID = Optional.ofNullable(librarySectionID);
        return this;
    }

    public GetWatchListResponseBody withLibrarySectionID(Optional<String> librarySectionID) {
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        this.librarySectionID = librarySectionID;
        return this;
    }

    public GetWatchListResponseBody withLibrarySectionTitle(String librarySectionTitle) {
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        this.librarySectionTitle = Optional.ofNullable(librarySectionTitle);
        return this;
    }

    public GetWatchListResponseBody withLibrarySectionTitle(Optional<String> librarySectionTitle) {
        Utils.checkNotNull(librarySectionTitle, "librarySectionTitle");
        this.librarySectionTitle = librarySectionTitle;
        return this;
    }

    public GetWatchListResponseBody withOffset(int offset) {
        Utils.checkNotNull(offset, "offset");
        this.offset = Optional.ofNullable(offset);
        return this;
    }

    public GetWatchListResponseBody withOffset(Optional<Integer> offset) {
        Utils.checkNotNull(offset, "offset");
        this.offset = offset;
        return this;
    }

    public GetWatchListResponseBody withTotalSize(int totalSize) {
        Utils.checkNotNull(totalSize, "totalSize");
        this.totalSize = Optional.ofNullable(totalSize);
        return this;
    }

    public GetWatchListResponseBody withTotalSize(Optional<Integer> totalSize) {
        Utils.checkNotNull(totalSize, "totalSize");
        this.totalSize = totalSize;
        return this;
    }

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

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

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

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

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

    public GetWatchListResponseBody withMetadata(Optional<? extends List<Metadata>> 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;
        }
        GetWatchListResponseBody other = (GetWatchListResponseBody) o;
        return 
            Objects.deepEquals(this.librarySectionID, other.librarySectionID) &&
            Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) &&
            Objects.deepEquals(this.offset, other.offset) &&
            Objects.deepEquals(this.totalSize, other.totalSize) &&
            Objects.deepEquals(this.identifier, other.identifier) &&
            Objects.deepEquals(this.size, other.size) &&
            Objects.deepEquals(this.metadata, other.metadata);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            librarySectionID,
            librarySectionTitle,
            offset,
            totalSize,
            identifier,
            size,
            metadata);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetWatchListResponseBody.class,
                "librarySectionID", librarySectionID,
                "librarySectionTitle", librarySectionTitle,
                "offset", offset,
                "totalSize", totalSize,
                "identifier", identifier,
                "size", size,
                "metadata", metadata);
    }
    
    public final static class Builder {
 
        private Optional<String> librarySectionID = Optional.empty();
 
        private Optional<String> librarySectionTitle = Optional.empty();
 
        private Optional<Integer> offset = Optional.empty();
 
        private Optional<Integer> totalSize = Optional.empty();
 
        private Optional<String> identifier = Optional.empty();
 
        private Optional<Integer> size = Optional.empty();
 
        private Optional<? extends List<Metadata>> metadata = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

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

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

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

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

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

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

        public Builder totalSize(Optional<Integer> totalSize) {
            Utils.checkNotNull(totalSize, "totalSize");
            this.totalSize = totalSize;
            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 size(int size) {
            Utils.checkNotNull(size, "size");
            this.size = Optional.ofNullable(size);
            return this;
        }

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

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

        public Builder metadata(Optional<? extends List<Metadata>> metadata) {
            Utils.checkNotNull(metadata, "metadata");
            this.metadata = metadata;
            return this;
        }
        
        public GetWatchListResponseBody build() {
            return new GetWatchListResponseBody(
                librarySectionID,
                librarySectionTitle,
                offset,
                totalSize,
                identifier,
                size,
                metadata);
        }
    }
}

