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

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

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

    @JsonCreator
    public GetResourcesStatisticsMediaContainer(
            @JsonProperty("size") Optional<Integer> size,
            @JsonProperty("StatisticsResources") Optional<? extends List<StatisticsResources>> statisticsResources) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(statisticsResources, "statisticsResources");
        this.size = size;
        this.statisticsResources = statisticsResources;
    }
    
    public GetResourcesStatisticsMediaContainer() {
        this(Optional.empty(), Optional.empty());
    }

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

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

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

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

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

    public GetResourcesStatisticsMediaContainer withStatisticsResources(List<StatisticsResources> statisticsResources) {
        Utils.checkNotNull(statisticsResources, "statisticsResources");
        this.statisticsResources = Optional.ofNullable(statisticsResources);
        return this;
    }

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

        public Builder statisticsResources(Optional<? extends List<StatisticsResources>> statisticsResources) {
            Utils.checkNotNull(statisticsResources, "statisticsResources");
            this.statisticsResources = statisticsResources;
            return this;
        }
        
        public GetResourcesStatisticsMediaContainer build() {
            return new GetResourcesStatisticsMediaContainer(
                size,
                statisticsResources);
        }
    }
}

