/* 
 * 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.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;


public class GetRecentlyAddedOperator {

    @JsonProperty("key")
    private String key;

    @JsonProperty("title")
    private String title;

    @JsonCreator
    public GetRecentlyAddedOperator(
            @JsonProperty("key") String key,
            @JsonProperty("title") String title) {
        Utils.checkNotNull(key, "key");
        Utils.checkNotNull(title, "title");
        this.key = key;
        this.title = title;
    }

    @JsonIgnore
    public String key() {
        return key;
    }

    @JsonIgnore
    public String title() {
        return title;
    }

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

    public GetRecentlyAddedOperator withKey(String key) {
        Utils.checkNotNull(key, "key");
        this.key = key;
        return this;
    }

    public GetRecentlyAddedOperator withTitle(String title) {
        Utils.checkNotNull(title, "title");
        this.title = title;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetRecentlyAddedOperator other = (GetRecentlyAddedOperator) o;
        return 
            Objects.deepEquals(this.key, other.key) &&
            Objects.deepEquals(this.title, other.title);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            key,
            title);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetRecentlyAddedOperator.class,
                "key", key,
                "title", title);
    }
    
    public final static class Builder {
 
        private String key;
 
        private String title;  
        
        private Builder() {
          // force use of static builder() method
        }

        public Builder key(String key) {
            Utils.checkNotNull(key, "key");
            this.key = key;
            return this;
        }

        public Builder title(String title) {
            Utils.checkNotNull(title, "title");
            this.title = title;
            return this;
        }
        
        public GetRecentlyAddedOperator build() {
            return new GetRecentlyAddedOperator(
                key,
                title);
        }
    }
}

