/* 
 * 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 dev.plexapi.sdk.utils.SpeakeasyMetadata;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Double;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;


public class UpdatePlaylistRequest {

    /**
     * the ID of the playlist
     */
    @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=playlistID")
    private double playlistID;

    /**
     * name of the playlist
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=title")
    private Optional<String> title;

    /**
     * summary description of the playlist
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=summary")
    private Optional<String> summary;

    @JsonCreator
    public UpdatePlaylistRequest(
            double playlistID,
            Optional<String> title,
            Optional<String> summary) {
        Utils.checkNotNull(playlistID, "playlistID");
        Utils.checkNotNull(title, "title");
        Utils.checkNotNull(summary, "summary");
        this.playlistID = playlistID;
        this.title = title;
        this.summary = summary;
    }
    
    public UpdatePlaylistRequest(
            double playlistID) {
        this(playlistID, Optional.empty(), Optional.empty());
    }

    /**
     * the ID of the playlist
     */
    @JsonIgnore
    public double playlistID() {
        return playlistID;
    }

    /**
     * name of the playlist
     */
    @JsonIgnore
    public Optional<String> title() {
        return title;
    }

    /**
     * summary description of the playlist
     */
    @JsonIgnore
    public Optional<String> summary() {
        return summary;
    }

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

    /**
     * the ID of the playlist
     */
    public UpdatePlaylistRequest withPlaylistID(double playlistID) {
        Utils.checkNotNull(playlistID, "playlistID");
        this.playlistID = playlistID;
        return this;
    }

    /**
     * name of the playlist
     */
    public UpdatePlaylistRequest withTitle(String title) {
        Utils.checkNotNull(title, "title");
        this.title = Optional.ofNullable(title);
        return this;
    }

    /**
     * name of the playlist
     */
    public UpdatePlaylistRequest withTitle(Optional<String> title) {
        Utils.checkNotNull(title, "title");
        this.title = title;
        return this;
    }

    /**
     * summary description of the playlist
     */
    public UpdatePlaylistRequest withSummary(String summary) {
        Utils.checkNotNull(summary, "summary");
        this.summary = Optional.ofNullable(summary);
        return this;
    }

    /**
     * summary description of the playlist
     */
    public UpdatePlaylistRequest withSummary(Optional<String> summary) {
        Utils.checkNotNull(summary, "summary");
        this.summary = summary;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdatePlaylistRequest other = (UpdatePlaylistRequest) o;
        return 
            Objects.deepEquals(this.playlistID, other.playlistID) &&
            Objects.deepEquals(this.title, other.title) &&
            Objects.deepEquals(this.summary, other.summary);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            playlistID,
            title,
            summary);
    }
    
    @Override
    public String toString() {
        return Utils.toString(UpdatePlaylistRequest.class,
                "playlistID", playlistID,
                "title", title,
                "summary", summary);
    }
    
    public final static class Builder {
 
        private Double playlistID;
 
        private Optional<String> title = Optional.empty();
 
        private Optional<String> summary = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * the ID of the playlist
         */
        public Builder playlistID(double playlistID) {
            Utils.checkNotNull(playlistID, "playlistID");
            this.playlistID = playlistID;
            return this;
        }

        /**
         * name of the playlist
         */
        public Builder title(String title) {
            Utils.checkNotNull(title, "title");
            this.title = Optional.ofNullable(title);
            return this;
        }

        /**
         * name of the playlist
         */
        public Builder title(Optional<String> title) {
            Utils.checkNotNull(title, "title");
            this.title = title;
            return this;
        }

        /**
         * summary description of the playlist
         */
        public Builder summary(String summary) {
            Utils.checkNotNull(summary, "summary");
            this.summary = Optional.ofNullable(summary);
            return this;
        }

        /**
         * summary description of the playlist
         */
        public Builder summary(Optional<String> summary) {
            Utils.checkNotNull(summary, "summary");
            this.summary = summary;
            return this;
        }
        
        public UpdatePlaylistRequest build() {
            return new UpdatePlaylistRequest(
                playlistID,
                title,
                summary);
        }
    }
}

