/* 
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

package dev.plexapi.sdk.models.operations;

import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.String;
import java.util.Optional;

public class GetTokenByPinIdRequestBuilder {

    private Optional<String> xPlexClientIdentifier = Optional.empty();
    private Long pinID;
    private Optional<String> serverURL = Optional.empty();
    private final SDKMethodInterfaces.MethodCallGetTokenByPinId sdk;

    public GetTokenByPinIdRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenByPinId sdk) {
        this.sdk = sdk;
    }
                
    public GetTokenByPinIdRequestBuilder xPlexClientIdentifier(java.lang.String xPlexClientIdentifier) {
        Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier");
        this.xPlexClientIdentifier = Optional.of(xPlexClientIdentifier);
        return this;
    }

    public GetTokenByPinIdRequestBuilder xPlexClientIdentifier(java.util.Optional<java.lang.String> xPlexClientIdentifier) {
        Utils.checkNotNull(xPlexClientIdentifier, "xPlexClientIdentifier");
        this.xPlexClientIdentifier = xPlexClientIdentifier;
        return this;
    }

    public GetTokenByPinIdRequestBuilder pinID(long pinID) {
        Utils.checkNotNull(pinID, "pinID");
        this.pinID = pinID;
        return this;
    }
                
    public GetTokenByPinIdRequestBuilder serverURL(java.lang.String serverURL) {
        Utils.checkNotNull(serverURL, "serverURL");
        this.serverURL = Optional.of(serverURL);
        return this;
    }

    public GetTokenByPinIdRequestBuilder serverURL(java.util.Optional<java.lang.String> serverURL) {
        Utils.checkNotNull(serverURL, "serverURL");
        this.serverURL = serverURL;
        return this;
    }

    public GetTokenByPinIdResponse call() throws Exception {

        return sdk.getTokenByPinId(
            xPlexClientIdentifier,
            pinID,
            serverURL);
    }
}
