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


public class GetTopWatchedContentRequest {

    /**
     * Adds the Guids object to the response
     * 
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids")
    private Optional<Long> includeGuids;

    /**
     * The type of media to retrieve.
     * 1 = movie
     * 2 = show
     * 3 = season
     * 4 = episode
     * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
     * 
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")
    private GetTopWatchedContentQueryParamType type;

    @JsonCreator
    public GetTopWatchedContentRequest(
            Optional<Long> includeGuids,
            GetTopWatchedContentQueryParamType type) {
        Utils.checkNotNull(includeGuids, "includeGuids");
        Utils.checkNotNull(type, "type");
        this.includeGuids = includeGuids;
        this.type = type;
    }
    
    public GetTopWatchedContentRequest(
            GetTopWatchedContentQueryParamType type) {
        this(Optional.empty(), type);
    }

    /**
     * Adds the Guids object to the response
     * 
     */
    @JsonIgnore
    public Optional<Long> includeGuids() {
        return includeGuids;
    }

    /**
     * The type of media to retrieve.
     * 1 = movie
     * 2 = show
     * 3 = season
     * 4 = episode
     * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
     * 
     */
    @JsonIgnore
    public GetTopWatchedContentQueryParamType type() {
        return type;
    }

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

    /**
     * Adds the Guids object to the response
     * 
     */
    public GetTopWatchedContentRequest withIncludeGuids(long includeGuids) {
        Utils.checkNotNull(includeGuids, "includeGuids");
        this.includeGuids = Optional.ofNullable(includeGuids);
        return this;
    }

    /**
     * Adds the Guids object to the response
     * 
     */
    public GetTopWatchedContentRequest withIncludeGuids(Optional<Long> includeGuids) {
        Utils.checkNotNull(includeGuids, "includeGuids");
        this.includeGuids = includeGuids;
        return this;
    }

    /**
     * The type of media to retrieve.
     * 1 = movie
     * 2 = show
     * 3 = season
     * 4 = episode
     * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
     * 
     */
    public GetTopWatchedContentRequest withType(GetTopWatchedContentQueryParamType type) {
        Utils.checkNotNull(type, "type");
        this.type = type;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetTopWatchedContentRequest other = (GetTopWatchedContentRequest) o;
        return 
            Objects.deepEquals(this.includeGuids, other.includeGuids) &&
            Objects.deepEquals(this.type, other.type);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            includeGuids,
            type);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetTopWatchedContentRequest.class,
                "includeGuids", includeGuids,
                "type", type);
    }
    
    public final static class Builder {
 
        private Optional<Long> includeGuids = Optional.empty();
 
        private GetTopWatchedContentQueryParamType type;  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * Adds the Guids object to the response
         * 
         */
        public Builder includeGuids(long includeGuids) {
            Utils.checkNotNull(includeGuids, "includeGuids");
            this.includeGuids = Optional.ofNullable(includeGuids);
            return this;
        }

        /**
         * Adds the Guids object to the response
         * 
         */
        public Builder includeGuids(Optional<Long> includeGuids) {
            Utils.checkNotNull(includeGuids, "includeGuids");
            this.includeGuids = includeGuids;
            return this;
        }

        /**
         * The type of media to retrieve.
         * 1 = movie
         * 2 = show
         * 3 = season
         * 4 = episode
         * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
         * 
         */
        public Builder type(GetTopWatchedContentQueryParamType type) {
            Utils.checkNotNull(type, "type");
            this.type = type;
            return this;
        }
        
        public GetTopWatchedContentRequest build() {
            return new GetTopWatchedContentRequest(
                includeGuids,
                type);
        }
    }
}

