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


public class GetDevicesMediaContainer {

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Device")
    private Optional<? extends List<Device>> device;

    @JsonCreator
    public GetDevicesMediaContainer(
            @JsonProperty("size") Optional<Double> size,
            @JsonProperty("identifier") Optional<String> identifier,
            @JsonProperty("Device") Optional<? extends List<Device>> device) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(identifier, "identifier");
        Utils.checkNotNull(device, "device");
        this.size = size;
        this.identifier = identifier;
        this.device = device;
    }
    
    public GetDevicesMediaContainer() {
        this(Optional.empty(), Optional.empty(), Optional.empty());
    }

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

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

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<List<Device>> device() {
        return (Optional<List<Device>>) device;
    }

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

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

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

    public GetDevicesMediaContainer withIdentifier(String identifier) {
        Utils.checkNotNull(identifier, "identifier");
        this.identifier = Optional.ofNullable(identifier);
        return this;
    }

    public GetDevicesMediaContainer withIdentifier(Optional<String> identifier) {
        Utils.checkNotNull(identifier, "identifier");
        this.identifier = identifier;
        return this;
    }

    public GetDevicesMediaContainer withDevice(List<Device> device) {
        Utils.checkNotNull(device, "device");
        this.device = Optional.ofNullable(device);
        return this;
    }

    public GetDevicesMediaContainer withDevice(Optional<? extends List<Device>> device) {
        Utils.checkNotNull(device, "device");
        this.device = device;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetDevicesMediaContainer other = (GetDevicesMediaContainer) o;
        return 
            Objects.deepEquals(this.size, other.size) &&
            Objects.deepEquals(this.identifier, other.identifier) &&
            Objects.deepEquals(this.device, other.device);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            size,
            identifier,
            device);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetDevicesMediaContainer.class,
                "size", size,
                "identifier", identifier,
                "device", device);
    }
    
    public final static class Builder {
 
        private Optional<Double> size = Optional.empty();
 
        private Optional<String> identifier = Optional.empty();
 
        private Optional<? extends List<Device>> device = 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 identifier(String identifier) {
            Utils.checkNotNull(identifier, "identifier");
            this.identifier = Optional.ofNullable(identifier);
            return this;
        }

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

        public Builder device(List<Device> device) {
            Utils.checkNotNull(device, "device");
            this.device = Optional.ofNullable(device);
            return this;
        }

        public Builder device(Optional<? extends List<Device>> device) {
            Utils.checkNotNull(device, "device");
            this.device = device;
            return this;
        }
        
        public GetDevicesMediaContainer build() {
            return new GetDevicesMediaContainer(
                size,
                identifier,
                device);
        }
    }
}

