/* 
 * 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 GetServerIdentityMediaContainer {

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

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

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

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

    @JsonCreator
    public GetServerIdentityMediaContainer(
            @JsonProperty("size") Optional<Double> size,
            @JsonProperty("claimed") Optional<Boolean> claimed,
            @JsonProperty("machineIdentifier") Optional<String> machineIdentifier,
            @JsonProperty("version") Optional<String> version) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(claimed, "claimed");
        Utils.checkNotNull(machineIdentifier, "machineIdentifier");
        Utils.checkNotNull(version, "version");
        this.size = size;
        this.claimed = claimed;
        this.machineIdentifier = machineIdentifier;
        this.version = version;
    }
    
    public GetServerIdentityMediaContainer() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

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

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

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

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

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

    public GetServerIdentityMediaContainer withSize(double size) {
        Utils.checkNotNull(size, "size");
        this.size = Optional.ofNullable(size);
        return this;
    }

    public GetServerIdentityMediaContainer withSize(Optional<Double> size) {
        Utils.checkNotNull(size, "size");
        this.size = size;
        return this;
    }

    public GetServerIdentityMediaContainer withClaimed(boolean claimed) {
        Utils.checkNotNull(claimed, "claimed");
        this.claimed = Optional.ofNullable(claimed);
        return this;
    }

    public GetServerIdentityMediaContainer withClaimed(Optional<Boolean> claimed) {
        Utils.checkNotNull(claimed, "claimed");
        this.claimed = claimed;
        return this;
    }

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

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

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

    public GetServerIdentityMediaContainer 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;
        }
        GetServerIdentityMediaContainer other = (GetServerIdentityMediaContainer) o;
        return 
            Objects.deepEquals(this.size, other.size) &&
            Objects.deepEquals(this.claimed, other.claimed) &&
            Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) &&
            Objects.deepEquals(this.version, other.version);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            size,
            claimed,
            machineIdentifier,
            version);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetServerIdentityMediaContainer.class,
                "size", size,
                "claimed", claimed,
                "machineIdentifier", machineIdentifier,
                "version", version);
    }
    
    public final static class Builder {
 
        private Optional<Double> size = Optional.empty();
 
        private Optional<Boolean> claimed = Optional.empty();
 
        private Optional<String> machineIdentifier = Optional.empty();
 
        private Optional<String> version = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

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

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

        public Builder claimed(Optional<Boolean> claimed) {
            Utils.checkNotNull(claimed, "claimed");
            this.claimed = claimed;
            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 GetServerIdentityMediaContainer build() {
            return new GetServerIdentityMediaContainer(
                size,
                claimed,
                machineIdentifier,
                version);
        }
    }
}

