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


public class GetLibraryHubsRequest {

    /**
     * the Id of the library to query
     */
    @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId")
    private double sectionId;

    /**
     * The number of items to return with each hub.
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=count")
    private Optional<Double> count;

    /**
     * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=onlyTransient")
    private Optional<? extends QueryParamOnlyTransient> onlyTransient;

    @JsonCreator
    public GetLibraryHubsRequest(
            double sectionId,
            Optional<Double> count,
            Optional<? extends QueryParamOnlyTransient> onlyTransient) {
        Utils.checkNotNull(sectionId, "sectionId");
        Utils.checkNotNull(count, "count");
        Utils.checkNotNull(onlyTransient, "onlyTransient");
        this.sectionId = sectionId;
        this.count = count;
        this.onlyTransient = onlyTransient;
    }
    
    public GetLibraryHubsRequest(
            double sectionId) {
        this(sectionId, Optional.empty(), Optional.empty());
    }

    /**
     * the Id of the library to query
     */
    @JsonIgnore
    public double sectionId() {
        return sectionId;
    }

    /**
     * The number of items to return with each hub.
     */
    @JsonIgnore
    public Optional<Double> count() {
        return count;
    }

    /**
     * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
     */
    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<QueryParamOnlyTransient> onlyTransient() {
        return (Optional<QueryParamOnlyTransient>) onlyTransient;
    }

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

    /**
     * the Id of the library to query
     */
    public GetLibraryHubsRequest withSectionId(double sectionId) {
        Utils.checkNotNull(sectionId, "sectionId");
        this.sectionId = sectionId;
        return this;
    }

    /**
     * The number of items to return with each hub.
     */
    public GetLibraryHubsRequest withCount(double count) {
        Utils.checkNotNull(count, "count");
        this.count = Optional.ofNullable(count);
        return this;
    }

    /**
     * The number of items to return with each hub.
     */
    public GetLibraryHubsRequest withCount(Optional<Double> count) {
        Utils.checkNotNull(count, "count");
        this.count = count;
        return this;
    }

    /**
     * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
     */
    public GetLibraryHubsRequest withOnlyTransient(QueryParamOnlyTransient onlyTransient) {
        Utils.checkNotNull(onlyTransient, "onlyTransient");
        this.onlyTransient = Optional.ofNullable(onlyTransient);
        return this;
    }

    /**
     * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
     */
    public GetLibraryHubsRequest withOnlyTransient(Optional<? extends QueryParamOnlyTransient> onlyTransient) {
        Utils.checkNotNull(onlyTransient, "onlyTransient");
        this.onlyTransient = onlyTransient;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetLibraryHubsRequest other = (GetLibraryHubsRequest) o;
        return 
            Objects.deepEquals(this.sectionId, other.sectionId) &&
            Objects.deepEquals(this.count, other.count) &&
            Objects.deepEquals(this.onlyTransient, other.onlyTransient);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            sectionId,
            count,
            onlyTransient);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetLibraryHubsRequest.class,
                "sectionId", sectionId,
                "count", count,
                "onlyTransient", onlyTransient);
    }
    
    public final static class Builder {
 
        private Double sectionId;
 
        private Optional<Double> count = Optional.empty();
 
        private Optional<? extends QueryParamOnlyTransient> onlyTransient = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * the Id of the library to query
         */
        public Builder sectionId(double sectionId) {
            Utils.checkNotNull(sectionId, "sectionId");
            this.sectionId = sectionId;
            return this;
        }

        /**
         * The number of items to return with each hub.
         */
        public Builder count(double count) {
            Utils.checkNotNull(count, "count");
            this.count = Optional.ofNullable(count);
            return this;
        }

        /**
         * The number of items to return with each hub.
         */
        public Builder count(Optional<Double> count) {
            Utils.checkNotNull(count, "count");
            this.count = count;
            return this;
        }

        /**
         * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
         */
        public Builder onlyTransient(QueryParamOnlyTransient onlyTransient) {
            Utils.checkNotNull(onlyTransient, "onlyTransient");
            this.onlyTransient = Optional.ofNullable(onlyTransient);
            return this;
        }

        /**
         * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
         */
        public Builder onlyTransient(Optional<? extends QueryParamOnlyTransient> onlyTransient) {
            Utils.checkNotNull(onlyTransient, "onlyTransient");
            this.onlyTransient = onlyTransient;
            return this;
        }
        
        public GetLibraryHubsRequest build() {
            return new GetLibraryHubsRequest(
                sectionId,
                count,
                onlyTransient);
        }
    }
}

