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


public class GetLibraryDetailsDirectory {

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("key")
    private Optional<String> key;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("title")
    private Optional<String> title;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("secondary")
    private Optional<Boolean> secondary;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("prompt")
    private Optional<String> prompt;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("search")
    private Optional<Boolean> search;

    @JsonCreator
    public GetLibraryDetailsDirectory(
            @JsonProperty("key") Optional<String> key,
            @JsonProperty("title") Optional<String> title,
            @JsonProperty("secondary") Optional<Boolean> secondary,
            @JsonProperty("prompt") Optional<String> prompt,
            @JsonProperty("search") Optional<Boolean> search) {
        Utils.checkNotNull(key, "key");
        Utils.checkNotNull(title, "title");
        Utils.checkNotNull(secondary, "secondary");
        Utils.checkNotNull(prompt, "prompt");
        Utils.checkNotNull(search, "search");
        this.key = key;
        this.title = title;
        this.secondary = secondary;
        this.prompt = prompt;
        this.search = search;
    }
    
    public GetLibraryDetailsDirectory() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

    @JsonIgnore
    public Optional<String> key() {
        return key;
    }

    @JsonIgnore
    public Optional<String> title() {
        return title;
    }

    @JsonIgnore
    public Optional<Boolean> secondary() {
        return secondary;
    }

    @JsonIgnore
    public Optional<String> prompt() {
        return prompt;
    }

    @JsonIgnore
    public Optional<Boolean> search() {
        return search;
    }

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

    public GetLibraryDetailsDirectory withKey(String key) {
        Utils.checkNotNull(key, "key");
        this.key = Optional.ofNullable(key);
        return this;
    }

    public GetLibraryDetailsDirectory withKey(Optional<String> key) {
        Utils.checkNotNull(key, "key");
        this.key = key;
        return this;
    }

    public GetLibraryDetailsDirectory withTitle(String title) {
        Utils.checkNotNull(title, "title");
        this.title = Optional.ofNullable(title);
        return this;
    }

    public GetLibraryDetailsDirectory withTitle(Optional<String> title) {
        Utils.checkNotNull(title, "title");
        this.title = title;
        return this;
    }

    public GetLibraryDetailsDirectory withSecondary(boolean secondary) {
        Utils.checkNotNull(secondary, "secondary");
        this.secondary = Optional.ofNullable(secondary);
        return this;
    }

    public GetLibraryDetailsDirectory withSecondary(Optional<Boolean> secondary) {
        Utils.checkNotNull(secondary, "secondary");
        this.secondary = secondary;
        return this;
    }

    public GetLibraryDetailsDirectory withPrompt(String prompt) {
        Utils.checkNotNull(prompt, "prompt");
        this.prompt = Optional.ofNullable(prompt);
        return this;
    }

    public GetLibraryDetailsDirectory withPrompt(Optional<String> prompt) {
        Utils.checkNotNull(prompt, "prompt");
        this.prompt = prompt;
        return this;
    }

    public GetLibraryDetailsDirectory withSearch(boolean search) {
        Utils.checkNotNull(search, "search");
        this.search = Optional.ofNullable(search);
        return this;
    }

    public GetLibraryDetailsDirectory withSearch(Optional<Boolean> search) {
        Utils.checkNotNull(search, "search");
        this.search = search;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetLibraryDetailsDirectory other = (GetLibraryDetailsDirectory) o;
        return 
            Objects.deepEquals(this.key, other.key) &&
            Objects.deepEquals(this.title, other.title) &&
            Objects.deepEquals(this.secondary, other.secondary) &&
            Objects.deepEquals(this.prompt, other.prompt) &&
            Objects.deepEquals(this.search, other.search);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            key,
            title,
            secondary,
            prompt,
            search);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetLibraryDetailsDirectory.class,
                "key", key,
                "title", title,
                "secondary", secondary,
                "prompt", prompt,
                "search", search);
    }
    
    public final static class Builder {
 
        private Optional<String> key = Optional.empty();
 
        private Optional<String> title = Optional.empty();
 
        private Optional<Boolean> secondary = Optional.empty();
 
        private Optional<String> prompt = Optional.empty();
 
        private Optional<Boolean> search = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

        public Builder key(Optional<String> key) {
            Utils.checkNotNull(key, "key");
            this.key = key;
            return this;
        }

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

        public Builder title(Optional<String> title) {
            Utils.checkNotNull(title, "title");
            this.title = title;
            return this;
        }

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

        public Builder secondary(Optional<Boolean> secondary) {
            Utils.checkNotNull(secondary, "secondary");
            this.secondary = secondary;
            return this;
        }

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

        public Builder prompt(Optional<String> prompt) {
            Utils.checkNotNull(prompt, "prompt");
            this.prompt = prompt;
            return this;
        }

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

        public Builder search(Optional<Boolean> search) {
            Utils.checkNotNull(search, "search");
            this.search = search;
            return this;
        }
        
        public GetLibraryDetailsDirectory build() {
            return new GetLibraryDetailsDirectory(
                key,
                title,
                secondary,
                prompt,
                search);
        }
    }
}

