/* 
 * 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.lang.SuppressWarnings;
import java.util.Objects;
import java.util.Optional;


public class PostUsersSignInDataRequest {

    /**
     * An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
     */
    @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")
    private Optional<String> clientID;

    /**
     * The name of the client application. (Plex Web, Plex Media Server, etc.)
     */
    @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")
    private Optional<String> clientName;

    /**
     * A relatively friendly name for the client device
     */
    @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")
    private Optional<String> deviceNickname;

    /**
     * The version of the client application.
     */
    @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")
    private Optional<String> clientVersion;

    /**
     * The platform of the client application.
     */
    @SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")
    private Optional<String> platform;

    /**
     * Login credentials
     */
    @SpeakeasyMetadata("request:mediaType=application/x-www-form-urlencoded")
    private Optional<? extends PostUsersSignInDataRequestBody> requestBody;

    @JsonCreator
    public PostUsersSignInDataRequest(
            Optional<String> clientID,
            Optional<String> clientName,
            Optional<String> deviceNickname,
            Optional<String> clientVersion,
            Optional<String> platform,
            Optional<? extends PostUsersSignInDataRequestBody> requestBody) {
        Utils.checkNotNull(clientID, "clientID");
        Utils.checkNotNull(clientName, "clientName");
        Utils.checkNotNull(deviceNickname, "deviceNickname");
        Utils.checkNotNull(clientVersion, "clientVersion");
        Utils.checkNotNull(platform, "platform");
        Utils.checkNotNull(requestBody, "requestBody");
        this.clientID = clientID;
        this.clientName = clientName;
        this.deviceNickname = deviceNickname;
        this.clientVersion = clientVersion;
        this.platform = platform;
        this.requestBody = requestBody;
    }
    
    public PostUsersSignInDataRequest() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

    /**
     * An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
     */
    @JsonIgnore
    public Optional<String> clientID() {
        return clientID;
    }

    /**
     * The name of the client application. (Plex Web, Plex Media Server, etc.)
     */
    @JsonIgnore
    public Optional<String> clientName() {
        return clientName;
    }

    /**
     * A relatively friendly name for the client device
     */
    @JsonIgnore
    public Optional<String> deviceNickname() {
        return deviceNickname;
    }

    /**
     * The version of the client application.
     */
    @JsonIgnore
    public Optional<String> clientVersion() {
        return clientVersion;
    }

    /**
     * The platform of the client application.
     */
    @JsonIgnore
    public Optional<String> platform() {
        return platform;
    }

    /**
     * Login credentials
     */
    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional<PostUsersSignInDataRequestBody> requestBody() {
        return (Optional<PostUsersSignInDataRequestBody>) requestBody;
    }

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

    /**
     * An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
     */
    public PostUsersSignInDataRequest withClientID(String clientID) {
        Utils.checkNotNull(clientID, "clientID");
        this.clientID = Optional.ofNullable(clientID);
        return this;
    }

    /**
     * An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
     */
    public PostUsersSignInDataRequest withClientID(Optional<String> clientID) {
        Utils.checkNotNull(clientID, "clientID");
        this.clientID = clientID;
        return this;
    }

    /**
     * The name of the client application. (Plex Web, Plex Media Server, etc.)
     */
    public PostUsersSignInDataRequest withClientName(String clientName) {
        Utils.checkNotNull(clientName, "clientName");
        this.clientName = Optional.ofNullable(clientName);
        return this;
    }

    /**
     * The name of the client application. (Plex Web, Plex Media Server, etc.)
     */
    public PostUsersSignInDataRequest withClientName(Optional<String> clientName) {
        Utils.checkNotNull(clientName, "clientName");
        this.clientName = clientName;
        return this;
    }

    /**
     * A relatively friendly name for the client device
     */
    public PostUsersSignInDataRequest withDeviceNickname(String deviceNickname) {
        Utils.checkNotNull(deviceNickname, "deviceNickname");
        this.deviceNickname = Optional.ofNullable(deviceNickname);
        return this;
    }

    /**
     * A relatively friendly name for the client device
     */
    public PostUsersSignInDataRequest withDeviceNickname(Optional<String> deviceNickname) {
        Utils.checkNotNull(deviceNickname, "deviceNickname");
        this.deviceNickname = deviceNickname;
        return this;
    }

    /**
     * The version of the client application.
     */
    public PostUsersSignInDataRequest withClientVersion(String clientVersion) {
        Utils.checkNotNull(clientVersion, "clientVersion");
        this.clientVersion = Optional.ofNullable(clientVersion);
        return this;
    }

    /**
     * The version of the client application.
     */
    public PostUsersSignInDataRequest withClientVersion(Optional<String> clientVersion) {
        Utils.checkNotNull(clientVersion, "clientVersion");
        this.clientVersion = clientVersion;
        return this;
    }

    /**
     * The platform of the client application.
     */
    public PostUsersSignInDataRequest withPlatform(String platform) {
        Utils.checkNotNull(platform, "platform");
        this.platform = Optional.ofNullable(platform);
        return this;
    }

    /**
     * The platform of the client application.
     */
    public PostUsersSignInDataRequest withPlatform(Optional<String> platform) {
        Utils.checkNotNull(platform, "platform");
        this.platform = platform;
        return this;
    }

    /**
     * Login credentials
     */
    public PostUsersSignInDataRequest withRequestBody(PostUsersSignInDataRequestBody requestBody) {
        Utils.checkNotNull(requestBody, "requestBody");
        this.requestBody = Optional.ofNullable(requestBody);
        return this;
    }

    /**
     * Login credentials
     */
    public PostUsersSignInDataRequest withRequestBody(Optional<? extends PostUsersSignInDataRequestBody> requestBody) {
        Utils.checkNotNull(requestBody, "requestBody");
        this.requestBody = requestBody;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PostUsersSignInDataRequest other = (PostUsersSignInDataRequest) o;
        return 
            Objects.deepEquals(this.clientID, other.clientID) &&
            Objects.deepEquals(this.clientName, other.clientName) &&
            Objects.deepEquals(this.deviceNickname, other.deviceNickname) &&
            Objects.deepEquals(this.clientVersion, other.clientVersion) &&
            Objects.deepEquals(this.platform, other.platform) &&
            Objects.deepEquals(this.requestBody, other.requestBody);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            clientID,
            clientName,
            deviceNickname,
            clientVersion,
            platform,
            requestBody);
    }
    
    @Override
    public String toString() {
        return Utils.toString(PostUsersSignInDataRequest.class,
                "clientID", clientID,
                "clientName", clientName,
                "deviceNickname", deviceNickname,
                "clientVersion", clientVersion,
                "platform", platform,
                "requestBody", requestBody);
    }
    
    public final static class Builder {
 
        private Optional<String> clientID = Optional.empty();
 
        private Optional<String> clientName = Optional.empty();
 
        private Optional<String> deviceNickname = Optional.empty();
 
        private Optional<String> clientVersion = Optional.empty();
 
        private Optional<String> platform = Optional.empty();
 
        private Optional<? extends PostUsersSignInDataRequestBody> requestBody = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        /**
         * An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
         */
        public Builder clientID(String clientID) {
            Utils.checkNotNull(clientID, "clientID");
            this.clientID = Optional.ofNullable(clientID);
            return this;
        }

        /**
         * An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
         */
        public Builder clientID(Optional<String> clientID) {
            Utils.checkNotNull(clientID, "clientID");
            this.clientID = clientID;
            return this;
        }

        /**
         * The name of the client application. (Plex Web, Plex Media Server, etc.)
         */
        public Builder clientName(String clientName) {
            Utils.checkNotNull(clientName, "clientName");
            this.clientName = Optional.ofNullable(clientName);
            return this;
        }

        /**
         * The name of the client application. (Plex Web, Plex Media Server, etc.)
         */
        public Builder clientName(Optional<String> clientName) {
            Utils.checkNotNull(clientName, "clientName");
            this.clientName = clientName;
            return this;
        }

        /**
         * A relatively friendly name for the client device
         */
        public Builder deviceNickname(String deviceNickname) {
            Utils.checkNotNull(deviceNickname, "deviceNickname");
            this.deviceNickname = Optional.ofNullable(deviceNickname);
            return this;
        }

        /**
         * A relatively friendly name for the client device
         */
        public Builder deviceNickname(Optional<String> deviceNickname) {
            Utils.checkNotNull(deviceNickname, "deviceNickname");
            this.deviceNickname = deviceNickname;
            return this;
        }

        /**
         * The version of the client application.
         */
        public Builder clientVersion(String clientVersion) {
            Utils.checkNotNull(clientVersion, "clientVersion");
            this.clientVersion = Optional.ofNullable(clientVersion);
            return this;
        }

        /**
         * The version of the client application.
         */
        public Builder clientVersion(Optional<String> clientVersion) {
            Utils.checkNotNull(clientVersion, "clientVersion");
            this.clientVersion = clientVersion;
            return this;
        }

        /**
         * The platform of the client application.
         */
        public Builder platform(String platform) {
            Utils.checkNotNull(platform, "platform");
            this.platform = Optional.ofNullable(platform);
            return this;
        }

        /**
         * The platform of the client application.
         */
        public Builder platform(Optional<String> platform) {
            Utils.checkNotNull(platform, "platform");
            this.platform = platform;
            return this;
        }

        /**
         * Login credentials
         */
        public Builder requestBody(PostUsersSignInDataRequestBody requestBody) {
            Utils.checkNotNull(requestBody, "requestBody");
            this.requestBody = Optional.ofNullable(requestBody);
            return this;
        }

        /**
         * Login credentials
         */
        public Builder requestBody(Optional<? extends PostUsersSignInDataRequestBody> requestBody) {
            Utils.checkNotNull(requestBody, "requestBody");
            this.requestBody = requestBody;
            return this;
        }
        
        public PostUsersSignInDataRequest build() {
            return new PostUsersSignInDataRequest(
                clientID,
                clientName,
                deviceNickname,
                clientVersion,
                platform,
                requestBody);
        }
    }
}

