/* tslint:disable */
/* eslint-disable */
/**
 * Jellyfin API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 10.8.9
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


import * as runtime from '../runtime';
import type {
  BaseItemKind,
  GeneralCommandType,
  NameIdPair,
  PlayCommand,
  PlaystateCommand,
  PostFullCapabilitiesRequest,
  SendFullGeneralCommandRequest,
  SendMessageCommandRequest,
  SessionInfo,
} from '../models';
import {
    BaseItemKindFromJSON,
    BaseItemKindToJSON,
    GeneralCommandTypeFromJSON,
    GeneralCommandTypeToJSON,
    NameIdPairFromJSON,
    NameIdPairToJSON,
    PlayCommandFromJSON,
    PlayCommandToJSON,
    PlaystateCommandFromJSON,
    PlaystateCommandToJSON,
    PostFullCapabilitiesRequestFromJSON,
    PostFullCapabilitiesRequestToJSON,
    SendFullGeneralCommandRequestFromJSON,
    SendFullGeneralCommandRequestToJSON,
    SendMessageCommandRequestFromJSON,
    SendMessageCommandRequestToJSON,
    SessionInfoFromJSON,
    SessionInfoToJSON,
} from '../models';

export interface AddUserToSessionRequest {
    sessionId: string;
    userId: string;
}

export interface DisplayContentRequest {
    sessionId: string;
    itemType: BaseItemKind;
    itemId: string;
    itemName: string;
}

export interface GetSessionsRequest {
    controllableByUserId?: string;
    deviceId?: string;
    activeWithinSeconds?: number;
}

export interface PlayRequest {
    sessionId: string;
    playCommand: PlayCommand;
    itemIds: Array<string>;
    startPositionTicks?: number;
    mediaSourceId?: string;
    audioStreamIndex?: number;
    subtitleStreamIndex?: number;
    startIndex?: number;
}

export interface PostCapabilitiesRequest {
    id?: string;
    playableMediaTypes?: Array<string>;
    supportedCommands?: Array<GeneralCommandType>;
    supportsMediaControl?: boolean;
    supportsSync?: boolean;
    supportsPersistentIdentifier?: boolean;
}

export interface PostFullCapabilitiesOperationRequest {
    postFullCapabilitiesRequest: PostFullCapabilitiesRequest;
    id?: string;
}

export interface RemoveUserFromSessionRequest {
    sessionId: string;
    userId: string;
}

export interface ReportViewingRequest {
    itemId: string;
    sessionId?: string;
}

export interface SendFullGeneralCommandOperationRequest {
    sessionId: string;
    sendFullGeneralCommandRequest: SendFullGeneralCommandRequest;
}

export interface SendGeneralCommandRequest {
    sessionId: string;
    command: GeneralCommandType;
}

export interface SendMessageCommandOperationRequest {
    sessionId: string;
    sendMessageCommandRequest: SendMessageCommandRequest;
}

export interface SendPlaystateCommandRequest {
    sessionId: string;
    command: PlaystateCommand;
    seekPositionTicks?: number;
    controllingUserId?: string;
}

export interface SendSystemCommandRequest {
    sessionId: string;
    command: GeneralCommandType;
}

/**
 * 
 */
export class SessionApi extends runtime.BaseAPI {

    /**
     * Adds an additional user to a session.
     */
    async addUserToSessionRaw(requestParameters: AddUserToSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling addUserToSession.');
        }

        if (requestParameters.userId === null || requestParameters.userId === undefined) {
            throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling addUserToSession.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/User/{userId}`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Adds an additional user to a session.
     */
    async addUserToSession(requestParameters: AddUserToSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.addUserToSessionRaw(requestParameters, initOverrides);
    }

    /**
     * Instructs a session to browse to an item or view.
     */
    async displayContentRaw(requestParameters: DisplayContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling displayContent.');
        }

        if (requestParameters.itemType === null || requestParameters.itemType === undefined) {
            throw new runtime.RequiredError('itemType','Required parameter requestParameters.itemType was null or undefined when calling displayContent.');
        }

        if (requestParameters.itemId === null || requestParameters.itemId === undefined) {
            throw new runtime.RequiredError('itemId','Required parameter requestParameters.itemId was null or undefined when calling displayContent.');
        }

        if (requestParameters.itemName === null || requestParameters.itemName === undefined) {
            throw new runtime.RequiredError('itemName','Required parameter requestParameters.itemName was null or undefined when calling displayContent.');
        }

        const queryParameters: any = {};

        if (requestParameters.itemType !== undefined) {
            queryParameters['itemType'] = requestParameters.itemType;
        }

        if (requestParameters.itemId !== undefined) {
            queryParameters['itemId'] = requestParameters.itemId;
        }

        if (requestParameters.itemName !== undefined) {
            queryParameters['itemName'] = requestParameters.itemName;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/Viewing`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Instructs a session to browse to an item or view.
     */
    async displayContent(requestParameters: DisplayContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.displayContentRaw(requestParameters, initOverrides);
    }

    /**
     * Get all auth providers.
     */
    async getAuthProvidersRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<NameIdPair>>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Auth/Providers`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(NameIdPairFromJSON));
    }

    /**
     * Get all auth providers.
     */
    async getAuthProviders(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<NameIdPair>> {
        const response = await this.getAuthProvidersRaw(initOverrides);
        return await response.value();
    }

    /**
     * Get all password reset providers.
     */
    async getPasswordResetProvidersRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<NameIdPair>>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Auth/PasswordResetProviders`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(NameIdPairFromJSON));
    }

    /**
     * Get all password reset providers.
     */
    async getPasswordResetProviders(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<NameIdPair>> {
        const response = await this.getPasswordResetProvidersRaw(initOverrides);
        return await response.value();
    }

    /**
     * Gets a list of sessions.
     */
    async getSessionsRaw(requestParameters: GetSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SessionInfo>>> {
        const queryParameters: any = {};

        if (requestParameters.controllableByUserId !== undefined) {
            queryParameters['controllableByUserId'] = requestParameters.controllableByUserId;
        }

        if (requestParameters.deviceId !== undefined) {
            queryParameters['deviceId'] = requestParameters.deviceId;
        }

        if (requestParameters.activeWithinSeconds !== undefined) {
            queryParameters['activeWithinSeconds'] = requestParameters.activeWithinSeconds;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SessionInfoFromJSON));
    }

    /**
     * Gets a list of sessions.
     */
    async getSessions(requestParameters: GetSessionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SessionInfo>> {
        const response = await this.getSessionsRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Instructs a session to play an item.
     */
    async playRaw(requestParameters: PlayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling play.');
        }

        if (requestParameters.playCommand === null || requestParameters.playCommand === undefined) {
            throw new runtime.RequiredError('playCommand','Required parameter requestParameters.playCommand was null or undefined when calling play.');
        }

        if (requestParameters.itemIds === null || requestParameters.itemIds === undefined) {
            throw new runtime.RequiredError('itemIds','Required parameter requestParameters.itemIds was null or undefined when calling play.');
        }

        const queryParameters: any = {};

        if (requestParameters.playCommand !== undefined) {
            queryParameters['playCommand'] = requestParameters.playCommand;
        }

        if (requestParameters.itemIds) {
            queryParameters['itemIds'] = requestParameters.itemIds;
        }

        if (requestParameters.startPositionTicks !== undefined) {
            queryParameters['startPositionTicks'] = requestParameters.startPositionTicks;
        }

        if (requestParameters.mediaSourceId !== undefined) {
            queryParameters['mediaSourceId'] = requestParameters.mediaSourceId;
        }

        if (requestParameters.audioStreamIndex !== undefined) {
            queryParameters['audioStreamIndex'] = requestParameters.audioStreamIndex;
        }

        if (requestParameters.subtitleStreamIndex !== undefined) {
            queryParameters['subtitleStreamIndex'] = requestParameters.subtitleStreamIndex;
        }

        if (requestParameters.startIndex !== undefined) {
            queryParameters['startIndex'] = requestParameters.startIndex;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/Playing`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Instructs a session to play an item.
     */
    async play(requestParameters: PlayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.playRaw(requestParameters, initOverrides);
    }

    /**
     * Updates capabilities for a device.
     */
    async postCapabilitiesRaw(requestParameters: PostCapabilitiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        const queryParameters: any = {};

        if (requestParameters.id !== undefined) {
            queryParameters['id'] = requestParameters.id;
        }

        if (requestParameters.playableMediaTypes) {
            queryParameters['playableMediaTypes'] = requestParameters.playableMediaTypes;
        }

        if (requestParameters.supportedCommands) {
            queryParameters['supportedCommands'] = requestParameters.supportedCommands;
        }

        if (requestParameters.supportsMediaControl !== undefined) {
            queryParameters['supportsMediaControl'] = requestParameters.supportsMediaControl;
        }

        if (requestParameters.supportsSync !== undefined) {
            queryParameters['supportsSync'] = requestParameters.supportsSync;
        }

        if (requestParameters.supportsPersistentIdentifier !== undefined) {
            queryParameters['supportsPersistentIdentifier'] = requestParameters.supportsPersistentIdentifier;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/Capabilities`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Updates capabilities for a device.
     */
    async postCapabilities(requestParameters: PostCapabilitiesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.postCapabilitiesRaw(requestParameters, initOverrides);
    }

    /**
     * Updates capabilities for a device.
     */
    async postFullCapabilitiesRaw(requestParameters: PostFullCapabilitiesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.postFullCapabilitiesRequest === null || requestParameters.postFullCapabilitiesRequest === undefined) {
            throw new runtime.RequiredError('postFullCapabilitiesRequest','Required parameter requestParameters.postFullCapabilitiesRequest was null or undefined when calling postFullCapabilities.');
        }

        const queryParameters: any = {};

        if (requestParameters.id !== undefined) {
            queryParameters['id'] = requestParameters.id;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/Capabilities/Full`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: PostFullCapabilitiesRequestToJSON(requestParameters.postFullCapabilitiesRequest),
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Updates capabilities for a device.
     */
    async postFullCapabilities(requestParameters: PostFullCapabilitiesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.postFullCapabilitiesRaw(requestParameters, initOverrides);
    }

    /**
     * Removes an additional user from a session.
     */
    async removeUserFromSessionRaw(requestParameters: RemoveUserFromSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling removeUserFromSession.');
        }

        if (requestParameters.userId === null || requestParameters.userId === undefined) {
            throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling removeUserFromSession.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/User/{userId}`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Removes an additional user from a session.
     */
    async removeUserFromSession(requestParameters: RemoveUserFromSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.removeUserFromSessionRaw(requestParameters, initOverrides);
    }

    /**
     * Reports that a session has ended.
     */
    async reportSessionEndedRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/Logout`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Reports that a session has ended.
     */
    async reportSessionEnded(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.reportSessionEndedRaw(initOverrides);
    }

    /**
     * Reports that a session is viewing an item.
     */
    async reportViewingRaw(requestParameters: ReportViewingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.itemId === null || requestParameters.itemId === undefined) {
            throw new runtime.RequiredError('itemId','Required parameter requestParameters.itemId was null or undefined when calling reportViewing.');
        }

        const queryParameters: any = {};

        if (requestParameters.sessionId !== undefined) {
            queryParameters['sessionId'] = requestParameters.sessionId;
        }

        if (requestParameters.itemId !== undefined) {
            queryParameters['itemId'] = requestParameters.itemId;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/Viewing`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Reports that a session is viewing an item.
     */
    async reportViewing(requestParameters: ReportViewingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.reportViewingRaw(requestParameters, initOverrides);
    }

    /**
     * Issues a full general command to a client.
     */
    async sendFullGeneralCommandRaw(requestParameters: SendFullGeneralCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling sendFullGeneralCommand.');
        }

        if (requestParameters.sendFullGeneralCommandRequest === null || requestParameters.sendFullGeneralCommandRequest === undefined) {
            throw new runtime.RequiredError('sendFullGeneralCommandRequest','Required parameter requestParameters.sendFullGeneralCommandRequest was null or undefined when calling sendFullGeneralCommand.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/Command`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: SendFullGeneralCommandRequestToJSON(requestParameters.sendFullGeneralCommandRequest),
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Issues a full general command to a client.
     */
    async sendFullGeneralCommand(requestParameters: SendFullGeneralCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.sendFullGeneralCommandRaw(requestParameters, initOverrides);
    }

    /**
     * Issues a general command to a client.
     */
    async sendGeneralCommandRaw(requestParameters: SendGeneralCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling sendGeneralCommand.');
        }

        if (requestParameters.command === null || requestParameters.command === undefined) {
            throw new runtime.RequiredError('command','Required parameter requestParameters.command was null or undefined when calling sendGeneralCommand.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/Command/{command}`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))).replace(`{${"command"}}`, encodeURIComponent(String(requestParameters.command))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Issues a general command to a client.
     */
    async sendGeneralCommand(requestParameters: SendGeneralCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.sendGeneralCommandRaw(requestParameters, initOverrides);
    }

    /**
     * Issues a command to a client to display a message to the user.
     */
    async sendMessageCommandRaw(requestParameters: SendMessageCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling sendMessageCommand.');
        }

        if (requestParameters.sendMessageCommandRequest === null || requestParameters.sendMessageCommandRequest === undefined) {
            throw new runtime.RequiredError('sendMessageCommandRequest','Required parameter requestParameters.sendMessageCommandRequest was null or undefined when calling sendMessageCommand.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/Message`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: SendMessageCommandRequestToJSON(requestParameters.sendMessageCommandRequest),
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Issues a command to a client to display a message to the user.
     */
    async sendMessageCommand(requestParameters: SendMessageCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.sendMessageCommandRaw(requestParameters, initOverrides);
    }

    /**
     * Issues a playstate command to a client.
     */
    async sendPlaystateCommandRaw(requestParameters: SendPlaystateCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling sendPlaystateCommand.');
        }

        if (requestParameters.command === null || requestParameters.command === undefined) {
            throw new runtime.RequiredError('command','Required parameter requestParameters.command was null or undefined when calling sendPlaystateCommand.');
        }

        const queryParameters: any = {};

        if (requestParameters.seekPositionTicks !== undefined) {
            queryParameters['seekPositionTicks'] = requestParameters.seekPositionTicks;
        }

        if (requestParameters.controllingUserId !== undefined) {
            queryParameters['controllingUserId'] = requestParameters.controllingUserId;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/Playing/{command}`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))).replace(`{${"command"}}`, encodeURIComponent(String(requestParameters.command))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Issues a playstate command to a client.
     */
    async sendPlaystateCommand(requestParameters: SendPlaystateCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.sendPlaystateCommandRaw(requestParameters, initOverrides);
    }

    /**
     * Issues a system command to a client.
     */
    async sendSystemCommandRaw(requestParameters: SendSystemCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.sessionId === null || requestParameters.sessionId === undefined) {
            throw new runtime.RequiredError('sessionId','Required parameter requestParameters.sessionId was null or undefined when calling sendSystemCommand.');
        }

        if (requestParameters.command === null || requestParameters.command === undefined) {
            throw new runtime.RequiredError('command','Required parameter requestParameters.command was null or undefined when calling sendSystemCommand.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Sessions/{sessionId}/System/{command}`.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters.sessionId))).replace(`{${"command"}}`, encodeURIComponent(String(requestParameters.command))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Issues a system command to a client.
     */
    async sendSystemCommand(requestParameters: SendSystemCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.sendSystemCommandRaw(requestParameters, initOverrides);
    }

}
