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


public class GetServerListServer {

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

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

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

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

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

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

    @JsonCreator
    public GetServerListServer(
            @JsonProperty("name") Optional<String> name,
            @JsonProperty("host") Optional<String> host,
            @JsonProperty("address") Optional<String> address,
            @JsonProperty("port") Optional<Double> port,
            @JsonProperty("machineIdentifier") Optional<String> machineIdentifier,
            @JsonProperty("version") Optional<String> version) {
        Utils.checkNotNull(name, "name");
        Utils.checkNotNull(host, "host");
        Utils.checkNotNull(address, "address");
        Utils.checkNotNull(port, "port");
        Utils.checkNotNull(machineIdentifier, "machineIdentifier");
        Utils.checkNotNull(version, "version");
        this.name = name;
        this.host = host;
        this.address = address;
        this.port = port;
        this.machineIdentifier = machineIdentifier;
        this.version = version;
    }
    
    public GetServerListServer() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

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

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

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

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

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

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

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

    public GetServerListServer withName(String name) {
        Utils.checkNotNull(name, "name");
        this.name = Optional.ofNullable(name);
        return this;
    }

    public GetServerListServer withName(Optional<String> name) {
        Utils.checkNotNull(name, "name");
        this.name = name;
        return this;
    }

    public GetServerListServer withHost(String host) {
        Utils.checkNotNull(host, "host");
        this.host = Optional.ofNullable(host);
        return this;
    }

    public GetServerListServer withHost(Optional<String> host) {
        Utils.checkNotNull(host, "host");
        this.host = host;
        return this;
    }

    public GetServerListServer withAddress(String address) {
        Utils.checkNotNull(address, "address");
        this.address = Optional.ofNullable(address);
        return this;
    }

    public GetServerListServer withAddress(Optional<String> address) {
        Utils.checkNotNull(address, "address");
        this.address = address;
        return this;
    }

    public GetServerListServer withPort(double port) {
        Utils.checkNotNull(port, "port");
        this.port = Optional.ofNullable(port);
        return this;
    }

    public GetServerListServer withPort(Optional<Double> port) {
        Utils.checkNotNull(port, "port");
        this.port = port;
        return this;
    }

    public GetServerListServer withMachineIdentifier(String machineIdentifier) {
        Utils.checkNotNull(machineIdentifier, "machineIdentifier");
        this.machineIdentifier = Optional.ofNullable(machineIdentifier);
        return this;
    }

    public GetServerListServer withMachineIdentifier(Optional<String> machineIdentifier) {
        Utils.checkNotNull(machineIdentifier, "machineIdentifier");
        this.machineIdentifier = machineIdentifier;
        return this;
    }

    public GetServerListServer withVersion(String version) {
        Utils.checkNotNull(version, "version");
        this.version = Optional.ofNullable(version);
        return this;
    }

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

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

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

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

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

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

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

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

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

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

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

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

        public Builder version(Optional<String> version) {
            Utils.checkNotNull(version, "version");
            this.version = version;
            return this;
        }
        
        public GetServerListServer build() {
            return new GetServerListServer(
                name,
                host,
                address,
                port,
                machineIdentifier,
                version);
        }
    }
}

