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

import { authenticationGetTokenDetails } from "../funcs/authenticationGetTokenDetails.js";
import { authenticationPostUsersSignInData } from "../funcs/authenticationPostUsersSignInData.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";

export class Authentication extends ClientSDK {
  /**
   * Get Token Details
   *
   * @remarks
   * Get the User data from the provided X-Plex-Token
   */
  async getTokenDetails(
    request: operations.GetTokenDetailsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetTokenDetailsResponse> {
    return unwrapAsync(authenticationGetTokenDetails(
      this,
      request,
      options,
    ));
  }

  /**
   * Get User Sign In Data
   *
   * @remarks
   * Sign in user with username and password and return user data with Plex authentication token
   */
  async postUsersSignInData(
    request: operations.PostUsersSignInDataRequest,
    options?: RequestOptions,
  ): Promise<operations.PostUsersSignInDataResponse> {
    return unwrapAsync(authenticationPostUsersSignInData(
      this,
      request,
      options,
    ));
  }
}
