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


public class MyPlex {

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

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

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

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

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("publicPort")
    private Optional<Double> publicPort;

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("privatePort")
    private Optional<Double> privatePort;

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

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

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

    @JsonCreator
    public MyPlex(
            @JsonProperty("authToken") Optional<String> authToken,
            @JsonProperty("username") Optional<String> username,
            @JsonProperty("mappingState") Optional<String> mappingState,
            @JsonProperty("mappingError") Optional<String> mappingError,
            @JsonProperty("signInState") Optional<String> signInState,
            @JsonProperty("publicAddress") Optional<String> publicAddress,
            @JsonProperty("publicPort") Optional<Double> publicPort,
            @JsonProperty("privateAddress") Optional<String> privateAddress,
            @JsonProperty("privatePort") Optional<Double> privatePort,
            @JsonProperty("subscriptionFeatures") Optional<String> subscriptionFeatures,
            @JsonProperty("subscriptionActive") Optional<Boolean> subscriptionActive,
            @JsonProperty("subscriptionState") Optional<String> subscriptionState) {
        Utils.checkNotNull(authToken, "authToken");
        Utils.checkNotNull(username, "username");
        Utils.checkNotNull(mappingState, "mappingState");
        Utils.checkNotNull(mappingError, "mappingError");
        Utils.checkNotNull(signInState, "signInState");
        Utils.checkNotNull(publicAddress, "publicAddress");
        Utils.checkNotNull(publicPort, "publicPort");
        Utils.checkNotNull(privateAddress, "privateAddress");
        Utils.checkNotNull(privatePort, "privatePort");
        Utils.checkNotNull(subscriptionFeatures, "subscriptionFeatures");
        Utils.checkNotNull(subscriptionActive, "subscriptionActive");
        Utils.checkNotNull(subscriptionState, "subscriptionState");
        this.authToken = authToken;
        this.username = username;
        this.mappingState = mappingState;
        this.mappingError = mappingError;
        this.signInState = signInState;
        this.publicAddress = publicAddress;
        this.publicPort = publicPort;
        this.privateAddress = privateAddress;
        this.privatePort = privatePort;
        this.subscriptionFeatures = subscriptionFeatures;
        this.subscriptionActive = subscriptionActive;
        this.subscriptionState = subscriptionState;
    }
    
    public MyPlex() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

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

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

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

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

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

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

    @JsonIgnore
    public Optional<Double> publicPort() {
        return publicPort;
    }

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

    @JsonIgnore
    public Optional<Double> privatePort() {
        return privatePort;
    }

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

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

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

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

    public MyPlex withAuthToken(String authToken) {
        Utils.checkNotNull(authToken, "authToken");
        this.authToken = Optional.ofNullable(authToken);
        return this;
    }

    public MyPlex withAuthToken(Optional<String> authToken) {
        Utils.checkNotNull(authToken, "authToken");
        this.authToken = authToken;
        return this;
    }

    public MyPlex withUsername(String username) {
        Utils.checkNotNull(username, "username");
        this.username = Optional.ofNullable(username);
        return this;
    }

    public MyPlex withUsername(Optional<String> username) {
        Utils.checkNotNull(username, "username");
        this.username = username;
        return this;
    }

    public MyPlex withMappingState(String mappingState) {
        Utils.checkNotNull(mappingState, "mappingState");
        this.mappingState = Optional.ofNullable(mappingState);
        return this;
    }

    public MyPlex withMappingState(Optional<String> mappingState) {
        Utils.checkNotNull(mappingState, "mappingState");
        this.mappingState = mappingState;
        return this;
    }

    public MyPlex withMappingError(String mappingError) {
        Utils.checkNotNull(mappingError, "mappingError");
        this.mappingError = Optional.ofNullable(mappingError);
        return this;
    }

    public MyPlex withMappingError(Optional<String> mappingError) {
        Utils.checkNotNull(mappingError, "mappingError");
        this.mappingError = mappingError;
        return this;
    }

    public MyPlex withSignInState(String signInState) {
        Utils.checkNotNull(signInState, "signInState");
        this.signInState = Optional.ofNullable(signInState);
        return this;
    }

    public MyPlex withSignInState(Optional<String> signInState) {
        Utils.checkNotNull(signInState, "signInState");
        this.signInState = signInState;
        return this;
    }

    public MyPlex withPublicAddress(String publicAddress) {
        Utils.checkNotNull(publicAddress, "publicAddress");
        this.publicAddress = Optional.ofNullable(publicAddress);
        return this;
    }

    public MyPlex withPublicAddress(Optional<String> publicAddress) {
        Utils.checkNotNull(publicAddress, "publicAddress");
        this.publicAddress = publicAddress;
        return this;
    }

    public MyPlex withPublicPort(double publicPort) {
        Utils.checkNotNull(publicPort, "publicPort");
        this.publicPort = Optional.ofNullable(publicPort);
        return this;
    }

    public MyPlex withPublicPort(Optional<Double> publicPort) {
        Utils.checkNotNull(publicPort, "publicPort");
        this.publicPort = publicPort;
        return this;
    }

    public MyPlex withPrivateAddress(String privateAddress) {
        Utils.checkNotNull(privateAddress, "privateAddress");
        this.privateAddress = Optional.ofNullable(privateAddress);
        return this;
    }

    public MyPlex withPrivateAddress(Optional<String> privateAddress) {
        Utils.checkNotNull(privateAddress, "privateAddress");
        this.privateAddress = privateAddress;
        return this;
    }

    public MyPlex withPrivatePort(double privatePort) {
        Utils.checkNotNull(privatePort, "privatePort");
        this.privatePort = Optional.ofNullable(privatePort);
        return this;
    }

    public MyPlex withPrivatePort(Optional<Double> privatePort) {
        Utils.checkNotNull(privatePort, "privatePort");
        this.privatePort = privatePort;
        return this;
    }

    public MyPlex withSubscriptionFeatures(String subscriptionFeatures) {
        Utils.checkNotNull(subscriptionFeatures, "subscriptionFeatures");
        this.subscriptionFeatures = Optional.ofNullable(subscriptionFeatures);
        return this;
    }

    public MyPlex withSubscriptionFeatures(Optional<String> subscriptionFeatures) {
        Utils.checkNotNull(subscriptionFeatures, "subscriptionFeatures");
        this.subscriptionFeatures = subscriptionFeatures;
        return this;
    }

    public MyPlex withSubscriptionActive(boolean subscriptionActive) {
        Utils.checkNotNull(subscriptionActive, "subscriptionActive");
        this.subscriptionActive = Optional.ofNullable(subscriptionActive);
        return this;
    }

    public MyPlex withSubscriptionActive(Optional<Boolean> subscriptionActive) {
        Utils.checkNotNull(subscriptionActive, "subscriptionActive");
        this.subscriptionActive = subscriptionActive;
        return this;
    }

    public MyPlex withSubscriptionState(String subscriptionState) {
        Utils.checkNotNull(subscriptionState, "subscriptionState");
        this.subscriptionState = Optional.ofNullable(subscriptionState);
        return this;
    }

    public MyPlex withSubscriptionState(Optional<String> subscriptionState) {
        Utils.checkNotNull(subscriptionState, "subscriptionState");
        this.subscriptionState = subscriptionState;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        MyPlex other = (MyPlex) o;
        return 
            Objects.deepEquals(this.authToken, other.authToken) &&
            Objects.deepEquals(this.username, other.username) &&
            Objects.deepEquals(this.mappingState, other.mappingState) &&
            Objects.deepEquals(this.mappingError, other.mappingError) &&
            Objects.deepEquals(this.signInState, other.signInState) &&
            Objects.deepEquals(this.publicAddress, other.publicAddress) &&
            Objects.deepEquals(this.publicPort, other.publicPort) &&
            Objects.deepEquals(this.privateAddress, other.privateAddress) &&
            Objects.deepEquals(this.privatePort, other.privatePort) &&
            Objects.deepEquals(this.subscriptionFeatures, other.subscriptionFeatures) &&
            Objects.deepEquals(this.subscriptionActive, other.subscriptionActive) &&
            Objects.deepEquals(this.subscriptionState, other.subscriptionState);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            authToken,
            username,
            mappingState,
            mappingError,
            signInState,
            publicAddress,
            publicPort,
            privateAddress,
            privatePort,
            subscriptionFeatures,
            subscriptionActive,
            subscriptionState);
    }
    
    @Override
    public String toString() {
        return Utils.toString(MyPlex.class,
                "authToken", authToken,
                "username", username,
                "mappingState", mappingState,
                "mappingError", mappingError,
                "signInState", signInState,
                "publicAddress", publicAddress,
                "publicPort", publicPort,
                "privateAddress", privateAddress,
                "privatePort", privatePort,
                "subscriptionFeatures", subscriptionFeatures,
                "subscriptionActive", subscriptionActive,
                "subscriptionState", subscriptionState);
    }
    
    public final static class Builder {
 
        private Optional<String> authToken = Optional.empty();
 
        private Optional<String> username = Optional.empty();
 
        private Optional<String> mappingState = Optional.empty();
 
        private Optional<String> mappingError = Optional.empty();
 
        private Optional<String> signInState = Optional.empty();
 
        private Optional<String> publicAddress = Optional.empty();
 
        private Optional<Double> publicPort = Optional.empty();
 
        private Optional<String> privateAddress = Optional.empty();
 
        private Optional<Double> privatePort = Optional.empty();
 
        private Optional<String> subscriptionFeatures = Optional.empty();
 
        private Optional<Boolean> subscriptionActive = Optional.empty();
 
        private Optional<String> subscriptionState = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public Builder subscriptionState(Optional<String> subscriptionState) {
            Utils.checkNotNull(subscriptionState, "subscriptionState");
            this.subscriptionState = subscriptionState;
            return this;
        }
        
        public MyPlex build() {
            return new MyPlex(
                authToken,
                username,
                mappingState,
                mappingError,
                signInState,
                publicAddress,
                publicPort,
                privateAddress,
                privatePort,
                subscriptionFeatures,
                subscriptionActive,
                subscriptionState);
        }
    }
}

