/* 
 * 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.Integer;
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 GetBandwidthStatisticsMediaContainer {

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

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

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("Account")
    private Optional<? extends List<GetBandwidthStatisticsAccount>> account;

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

    @JsonCreator
    public GetBandwidthStatisticsMediaContainer(
            @JsonProperty("size") Optional<Integer> size,
            @JsonProperty("Device") Optional<? extends List<GetBandwidthStatisticsDevice>> device,
            @JsonProperty("Account") Optional<? extends List<GetBandwidthStatisticsAccount>> account,
            @JsonProperty("StatisticsBandwidth") Optional<? extends List<StatisticsBandwidth>> statisticsBandwidth) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(device, "device");
        Utils.checkNotNull(account, "account");
        Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth");
        this.size = size;
        this.device = device;
        this.account = account;
        this.statisticsBandwidth = statisticsBandwidth;
    }
    
    public GetBandwidthStatisticsMediaContainer() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

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

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

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

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

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

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

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

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

    public GetBandwidthStatisticsMediaContainer withDevice(Optional<? extends List<GetBandwidthStatisticsDevice>> device) {
        Utils.checkNotNull(device, "device");
        this.device = device;
        return this;
    }

    public GetBandwidthStatisticsMediaContainer withAccount(List<GetBandwidthStatisticsAccount> account) {
        Utils.checkNotNull(account, "account");
        this.account = Optional.ofNullable(account);
        return this;
    }

    public GetBandwidthStatisticsMediaContainer withAccount(Optional<? extends List<GetBandwidthStatisticsAccount>> account) {
        Utils.checkNotNull(account, "account");
        this.account = account;
        return this;
    }

    public GetBandwidthStatisticsMediaContainer withStatisticsBandwidth(List<StatisticsBandwidth> statisticsBandwidth) {
        Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth");
        this.statisticsBandwidth = Optional.ofNullable(statisticsBandwidth);
        return this;
    }

    public GetBandwidthStatisticsMediaContainer withStatisticsBandwidth(Optional<? extends List<StatisticsBandwidth>> statisticsBandwidth) {
        Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth");
        this.statisticsBandwidth = statisticsBandwidth;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetBandwidthStatisticsMediaContainer other = (GetBandwidthStatisticsMediaContainer) o;
        return 
            Objects.deepEquals(this.size, other.size) &&
            Objects.deepEquals(this.device, other.device) &&
            Objects.deepEquals(this.account, other.account) &&
            Objects.deepEquals(this.statisticsBandwidth, other.statisticsBandwidth);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            size,
            device,
            account,
            statisticsBandwidth);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetBandwidthStatisticsMediaContainer.class,
                "size", size,
                "device", device,
                "account", account,
                "statisticsBandwidth", statisticsBandwidth);
    }
    
    public final static class Builder {
 
        private Optional<Integer> size = Optional.empty();
 
        private Optional<? extends List<GetBandwidthStatisticsDevice>> device = Optional.empty();
 
        private Optional<? extends List<GetBandwidthStatisticsAccount>> account = Optional.empty();
 
        private Optional<? extends List<StatisticsBandwidth>> statisticsBandwidth = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

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

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

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

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

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

        public Builder account(Optional<? extends List<GetBandwidthStatisticsAccount>> account) {
            Utils.checkNotNull(account, "account");
            this.account = account;
            return this;
        }

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

        public Builder statisticsBandwidth(Optional<? extends List<StatisticsBandwidth>> statisticsBandwidth) {
            Utils.checkNotNull(statisticsBandwidth, "statisticsBandwidth");
            this.statisticsBandwidth = statisticsBandwidth;
            return this;
        }
        
        public GetBandwidthStatisticsMediaContainer build() {
            return new GetBandwidthStatisticsMediaContainer(
                size,
                device,
                account,
                statisticsBandwidth);
        }
    }
}

