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

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

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

    @JsonCreator
    public GetServerActivitiesMediaContainer(
            @JsonProperty("size") Optional<Double> size,
            @JsonProperty("Activity") Optional<? extends List<Activity>> activity) {
        Utils.checkNotNull(size, "size");
        Utils.checkNotNull(activity, "activity");
        this.size = size;
        this.activity = activity;
    }
    
    public GetServerActivitiesMediaContainer() {
        this(Optional.empty(), Optional.empty());
    }

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

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

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

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

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

    public GetServerActivitiesMediaContainer withActivity(List<Activity> activity) {
        Utils.checkNotNull(activity, "activity");
        this.activity = Optional.ofNullable(activity);
        return this;
    }

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

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

