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

/**
 * GetButlerTasksResponseBody - All butler tasks
 */

public class GetButlerTasksResponseBody {

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("ButlerTasks")
    private Optional<? extends ButlerTasks> butlerTasks;

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

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<ButlerTasks> butlerTasks() {
        return (Optional<ButlerTasks>) butlerTasks;
    }

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

    public GetButlerTasksResponseBody withButlerTasks(ButlerTasks butlerTasks) {
        Utils.checkNotNull(butlerTasks, "butlerTasks");
        this.butlerTasks = Optional.ofNullable(butlerTasks);
        return this;
    }

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

        public Builder butlerTasks(ButlerTasks butlerTasks) {
            Utils.checkNotNull(butlerTasks, "butlerTasks");
            this.butlerTasks = Optional.ofNullable(butlerTasks);
            return this;
        }

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

