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


public class Context {

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

    @JsonCreator
    public Context(
            @JsonProperty("librarySectionID") Optional<String> librarySectionID) {
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        this.librarySectionID = librarySectionID;
    }
    
    public Context() {
        this(Optional.empty());
    }

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

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

    public Context withLibrarySectionID(String librarySectionID) {
        Utils.checkNotNull(librarySectionID, "librarySectionID");
        this.librarySectionID = Optional.ofNullable(librarySectionID);
        return this;
    }

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

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

        public Builder librarySectionID(Optional<String> librarySectionID) {
            Utils.checkNotNull(librarySectionID, "librarySectionID");
            this.librarySectionID = librarySectionID;
            return this;
        }
        
        public Context build() {
            return new Context(
                librarySectionID);
        }
    }
}

