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

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

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

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

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

    @JsonCreator
    public GetStatisticsMediaContainer(
            @JsonProperty("size") Optional<Integer> size,
            @JsonProperty("Device") Optional<? extends List<GetStatisticsDevice>> device,
            @JsonProperty("Account") Optional<? extends List<Account>> account,
            @JsonProperty("StatisticsMedia") Optional<? extends List<StatisticsMedia>> statisticsMedia) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(device, "device");
        Utils.checkNotNull(account, "account");
        Utils.checkNotNull(statisticsMedia, "statisticsMedia");
        this.size = size;
        this.device = device;
        this.account = account;
        this.statisticsMedia = statisticsMedia;
    }
    
    public GetStatisticsMediaContainer() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

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

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

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

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

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

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

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

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

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

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

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

    public GetStatisticsMediaContainer withStatisticsMedia(List<StatisticsMedia> statisticsMedia) {
        Utils.checkNotNull(statisticsMedia, "statisticsMedia");
        this.statisticsMedia = Optional.ofNullable(statisticsMedia);
        return this;
    }

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

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

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

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

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

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

