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


public class StartTaskRequest {

    /**
     * the name of the task to be started.
     */
    @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=taskName")
    private TaskName taskName;

    @JsonCreator
    public StartTaskRequest(
            TaskName taskName) {
        Utils.checkNotNull(taskName, "taskName");
        this.taskName = taskName;
    }

    /**
     * the name of the task to be started.
     */
    @JsonIgnore
    public TaskName taskName() {
        return taskName;
    }

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

    /**
     * the name of the task to be started.
     */
    public StartTaskRequest withTaskName(TaskName taskName) {
        Utils.checkNotNull(taskName, "taskName");
        this.taskName = taskName;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        StartTaskRequest other = (StartTaskRequest) o;
        return 
            Objects.deepEquals(this.taskName, other.taskName);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            taskName);
    }
    
    @Override
    public String toString() {
        return Utils.toString(StartTaskRequest.class,
                "taskName", taskName);
    }
    
    public final static class Builder {
 
        private TaskName taskName;  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * the name of the task to be started.
         */
        public Builder taskName(TaskName taskName) {
            Utils.checkNotNull(taskName, "taskName");
            this.taskName = taskName;
            return this;
        }
        
        public StartTaskRequest build() {
            return new StartTaskRequest(
                taskName);
        }
    }
}

