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


public class UpdatePlayProgressRequest {

    /**
     * the media key
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=key")
    private String key;

    /**
     * The time, in milliseconds, used to set the media playback progress.
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=time")
    private double time;

    /**
     * The playback state of the media item.
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=state")
    private String state;

    @JsonCreator
    public UpdatePlayProgressRequest(
            String key,
            double time,
            String state) {
        Utils.checkNotNull(key, "key");
        Utils.checkNotNull(time, "time");
        Utils.checkNotNull(state, "state");
        this.key = key;
        this.time = time;
        this.state = state;
    }

    /**
     * the media key
     */
    @JsonIgnore
    public String key() {
        return key;
    }

    /**
     * The time, in milliseconds, used to set the media playback progress.
     */
    @JsonIgnore
    public double time() {
        return time;
    }

    /**
     * The playback state of the media item.
     */
    @JsonIgnore
    public String state() {
        return state;
    }

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

    /**
     * the media key
     */
    public UpdatePlayProgressRequest withKey(String key) {
        Utils.checkNotNull(key, "key");
        this.key = key;
        return this;
    }

    /**
     * The time, in milliseconds, used to set the media playback progress.
     */
    public UpdatePlayProgressRequest withTime(double time) {
        Utils.checkNotNull(time, "time");
        this.time = time;
        return this;
    }

    /**
     * The playback state of the media item.
     */
    public UpdatePlayProgressRequest withState(String state) {
        Utils.checkNotNull(state, "state");
        this.state = state;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdatePlayProgressRequest other = (UpdatePlayProgressRequest) o;
        return 
            Objects.deepEquals(this.key, other.key) &&
            Objects.deepEquals(this.time, other.time) &&
            Objects.deepEquals(this.state, other.state);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            key,
            time,
            state);
    }
    
    @Override
    public String toString() {
        return Utils.toString(UpdatePlayProgressRequest.class,
                "key", key,
                "time", time,
                "state", state);
    }
    
    public final static class Builder {
 
        private String key;
 
        private Double time;
 
        private String state;  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * the media key
         */
        public Builder key(String key) {
            Utils.checkNotNull(key, "key");
            this.key = key;
            return this;
        }

        /**
         * The time, in milliseconds, used to set the media playback progress.
         */
        public Builder time(double time) {
            Utils.checkNotNull(time, "time");
            this.time = time;
            return this;
        }

        /**
         * The playback state of the media item.
         */
        public Builder state(String state) {
            Utils.checkNotNull(state, "state");
            this.state = state;
            return this;
        }
        
        public UpdatePlayProgressRequest build() {
            return new UpdatePlayProgressRequest(
                key,
                time,
                state);
        }
    }
}

