/* 
 * 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 com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.Objects;
import java.util.Optional;


public class ButlerTasks {

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("ButlerTask")
    private Optional<? extends List<ButlerTask>> butlerTask;

    @JsonCreator
    public ButlerTasks(
            @JsonProperty("ButlerTask") Optional<? extends List<ButlerTask>> butlerTask) {
        Utils.checkNotNull(butlerTask, "butlerTask");
        this.butlerTask = butlerTask;
    }
    
    public ButlerTasks() {
        this(Optional.empty());
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<ButlerTask>> butlerTask() {
        return (Optional<List<ButlerTask>>) butlerTask;
    }

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

    public ButlerTasks withButlerTask(List<ButlerTask> butlerTask) {
        Utils.checkNotNull(butlerTask, "butlerTask");
        this.butlerTask = Optional.ofNullable(butlerTask);
        return this;
    }

    public ButlerTasks withButlerTask(Optional<? extends List<ButlerTask>> butlerTask) {
        Utils.checkNotNull(butlerTask, "butlerTask");
        this.butlerTask = butlerTask;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ButlerTasks other = (ButlerTasks) o;
        return 
            Objects.deepEquals(this.butlerTask, other.butlerTask);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            butlerTask);
    }
    
    @Override
    public String toString() {
        return Utils.toString(ButlerTasks.class,
                "butlerTask", butlerTask);
    }
    
    public final static class Builder {
 
        private Optional<? extends List<ButlerTask>> butlerTask = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        public Builder butlerTask(List<ButlerTask> butlerTask) {
            Utils.checkNotNull(butlerTask, "butlerTask");
            this.butlerTask = Optional.ofNullable(butlerTask);
            return this;
        }

        public Builder butlerTask(Optional<? extends List<ButlerTask>> butlerTask) {
            Utils.checkNotNull(butlerTask, "butlerTask");
            this.butlerTask = butlerTask;
            return this;
        }
        
        public ButlerTasks build() {
            return new ButlerTasks(
                butlerTask);
        }
    }
}

