/* 
 * 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 GetGlobalHubsRequest {

    /**
     * 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 OnlyTransient> onlyTransient;

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

    /**
     * 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<OnlyTransient> onlyTransient() {
        return (Optional<OnlyTransient>) onlyTransient;
    }

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

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

    /**
     * The number of items to return with each hub.
     */
    public GetGlobalHubsRequest 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 GetGlobalHubsRequest withOnlyTransient(OnlyTransient 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 GetGlobalHubsRequest withOnlyTransient(Optional<? extends OnlyTransient> 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;
        }
        GetGlobalHubsRequest other = (GetGlobalHubsRequest) o;
        return 
            Objects.deepEquals(this.count, other.count) &&
            Objects.deepEquals(this.onlyTransient, other.onlyTransient);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            count,
            onlyTransient);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetGlobalHubsRequest.class,
                "count", count,
                "onlyTransient", onlyTransient);
    }
    
    public final static class Builder {
 
        private Optional<Double> count = Optional.empty();
 
        private Optional<? extends OnlyTransient> onlyTransient = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * 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(OnlyTransient 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 OnlyTransient> onlyTransient) {
            Utils.checkNotNull(onlyTransient, "onlyTransient");
            this.onlyTransient = onlyTransient;
            return this;
        }
        
        public GetGlobalHubsRequest build() {
            return new GetGlobalHubsRequest(
                count,
                onlyTransient);
        }
    }
}

