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


public class GetSearchResultsRequest {

    /**
     * The search query string to use
     */
    @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")
    private String query;

    @JsonCreator
    public GetSearchResultsRequest(
            String query) {
        Utils.checkNotNull(query, "query");
        this.query = query;
    }

    /**
     * The search query string to use
     */
    @JsonIgnore
    public String query() {
        return query;
    }

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

    /**
     * The search query string to use
     */
    public GetSearchResultsRequest withQuery(String query) {
        Utils.checkNotNull(query, "query");
        this.query = query;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetSearchResultsRequest other = (GetSearchResultsRequest) o;
        return 
            Objects.deepEquals(this.query, other.query);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            query);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetSearchResultsRequest.class,
                "query", query);
    }
    
    public final static class Builder {
 
        private String query;  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * The search query string to use
         */
        public Builder query(String query) {
            Utils.checkNotNull(query, "query");
            this.query = query;
            return this;
        }
        
        public GetSearchResultsRequest build() {
            return new GetSearchResultsRequest(
                query);
        }
    }
}

