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

    @JsonProperty("id")
    private String id;

    @JsonProperty("key")
    private String key;

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

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

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

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

    public Action withId(String id) {
        Utils.checkNotNull(id, "id");
        this.id = id;
        return this;
    }

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

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

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

