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

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

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

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

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

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

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

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

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

    public GetTranscodeSessionsMediaContainer withTranscodeSession(List<TranscodeSession> transcodeSession) {
        Utils.checkNotNull(transcodeSession, "transcodeSession");
        this.transcodeSession = Optional.ofNullable(transcodeSession);
        return this;
    }

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

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

