/* * Sailfin: a Jellyfin client written using Qt * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET * OVERWRITTEN AT SOME POINT! * * If there is a bug in this file, please fix the code generator used to generate this file found in * core/openapigenerator.d. * * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that * file with a newer file if needed instead of manually updating the files. */ #include namespace Jellyfin { namespace Loader { namespace HTTP { using namespace Jellyfin::DTO; GetPasswordResetProvidersLoader::GetPasswordResetProvidersLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetPasswordResetProvidersParams>(apiClient) {} QString GetPasswordResetProvidersLoader::path(const GetPasswordResetProvidersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Auth/PasswordResetProviders"); } QUrlQuery GetPasswordResetProvidersLoader::query(const GetPasswordResetProvidersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters return result; } QByteArray GetPasswordResetProvidersLoader::body(const GetPasswordResetProvidersParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation GetPasswordResetProvidersLoader::operation() const { // HTTP method Get return QNetworkAccessManager::GetOperation; } GetAuthProvidersLoader::GetAuthProvidersLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetAuthProvidersParams>(apiClient) {} QString GetAuthProvidersLoader::path(const GetAuthProvidersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Auth/Providers"); } QUrlQuery GetAuthProvidersLoader::query(const GetAuthProvidersParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters return result; } QByteArray GetAuthProvidersLoader::body(const GetAuthProvidersParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation GetAuthProvidersLoader::operation() const { // HTTP method Get return QNetworkAccessManager::GetOperation; } GetSessionsLoader::GetSessionsLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader, GetSessionsParams>(apiClient) {} QString GetSessionsLoader::path(const GetSessionsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions"); } QUrlQuery GetSessionsLoader::query(const GetSessionsParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters if (!params.controllableByUserIdNull()) { result.addQueryItem("controllableByUserId", Support::toString(params.controllableByUserId())); } if (!params.deviceIdNull()) { result.addQueryItem("deviceId", Support::toString(params.deviceId())); } if (!params.activeWithinSecondsNull()) { result.addQueryItem("activeWithinSeconds", Support::toString>(params.activeWithinSeconds())); } return result; } QByteArray GetSessionsLoader::body(const GetSessionsParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation GetSessionsLoader::operation() const { // HTTP method Get return QNetworkAccessManager::GetOperation; } SendFullGeneralCommandLoader::SendFullGeneralCommandLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString SendFullGeneralCommandLoader::path(const SendFullGeneralCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Command"); } QUrlQuery SendFullGeneralCommandLoader::query(const SendFullGeneralCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters return result; } QByteArray SendFullGeneralCommandLoader::body(const SendFullGeneralCommandParams ¶ms) const { return Support::toString>(params.body()).toUtf8(); } QNetworkAccessManager::Operation SendFullGeneralCommandLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } SendGeneralCommandLoader::SendGeneralCommandLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString SendGeneralCommandLoader::path(const SendGeneralCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Command/") + Support::toString< GeneralCommandType>(params.command()) ; } QUrlQuery SendGeneralCommandLoader::query(const SendGeneralCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters return result; } QByteArray SendGeneralCommandLoader::body(const SendGeneralCommandParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation SendGeneralCommandLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } SendMessageCommandLoader::SendMessageCommandLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString SendMessageCommandLoader::path(const SendMessageCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Message"); } QUrlQuery SendMessageCommandLoader::query(const SendMessageCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; result.addQueryItem("text", Support::toString(params.text())); // Optional parameters if (!params.headerNull()) { result.addQueryItem("header", Support::toString(params.header())); } if (!params.timeoutMsNull()) { result.addQueryItem("timeoutMs", Support::toString>(params.timeoutMs())); } return result; } QByteArray SendMessageCommandLoader::body(const SendMessageCommandParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation SendMessageCommandLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } PlayLoader::PlayLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString PlayLoader::path(const PlayParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Playing"); } QUrlQuery PlayLoader::query(const PlayParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; result.addQueryItem("playCommand", Support::toString(params.playCommand())); result.addQueryItem("itemIds", Support::toString(params.itemIds())); // Optional parameters if (!params.startPositionTicksNull()) { result.addQueryItem("startPositionTicks", Support::toString>(params.startPositionTicks())); } if (!params.mediaSourceIdNull()) { result.addQueryItem("mediaSourceId", Support::toString(params.mediaSourceId())); } if (!params.audioStreamIndexNull()) { result.addQueryItem("audioStreamIndex", Support::toString>(params.audioStreamIndex())); } if (!params.subtitleStreamIndexNull()) { result.addQueryItem("subtitleStreamIndex", Support::toString>(params.subtitleStreamIndex())); } if (!params.startIndexNull()) { result.addQueryItem("startIndex", Support::toString>(params.startIndex())); } return result; } QByteArray PlayLoader::body(const PlayParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation PlayLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } SendPlaystateCommandLoader::SendPlaystateCommandLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString SendPlaystateCommandLoader::path(const SendPlaystateCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Playing/") + Support::toString< PlaystateCommand>(params.command()) ; } QUrlQuery SendPlaystateCommandLoader::query(const SendPlaystateCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters if (!params.seekPositionTicksNull()) { result.addQueryItem("seekPositionTicks", Support::toString>(params.seekPositionTicks())); } if (!params.controllingUserIdNull()) { result.addQueryItem("controllingUserId", Support::toString(params.controllingUserId())); } return result; } QByteArray SendPlaystateCommandLoader::body(const SendPlaystateCommandParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation SendPlaystateCommandLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } SendSystemCommandLoader::SendSystemCommandLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString SendSystemCommandLoader::path(const SendSystemCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/System/") + Support::toString< GeneralCommandType>(params.command()) ; } QUrlQuery SendSystemCommandLoader::query(const SendSystemCommandParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters return result; } QByteArray SendSystemCommandLoader::body(const SendSystemCommandParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation SendSystemCommandLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } AddUserToSessionLoader::AddUserToSessionLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString AddUserToSessionLoader::path(const AddUserToSessionParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/User/") + Support::toString< QString>(params.userId()) ; } QUrlQuery AddUserToSessionLoader::query(const AddUserToSessionParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters return result; } QByteArray AddUserToSessionLoader::body(const AddUserToSessionParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation AddUserToSessionLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } RemoveUserFromSessionLoader::RemoveUserFromSessionLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString RemoveUserFromSessionLoader::path(const RemoveUserFromSessionParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/User/") + Support::toString< QString>(params.userId()) ; } QUrlQuery RemoveUserFromSessionLoader::query(const RemoveUserFromSessionParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters return result; } QByteArray RemoveUserFromSessionLoader::body(const RemoveUserFromSessionParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation RemoveUserFromSessionLoader::operation() const { // HTTP method Delete return QNetworkAccessManager::DeleteOperation; } DisplayContentLoader::DisplayContentLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString DisplayContentLoader::path(const DisplayContentParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/") + Support::toString< QString>(params.sessionId()) + QStringLiteral("/Viewing"); } QUrlQuery DisplayContentLoader::query(const DisplayContentParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; result.addQueryItem("itemType", Support::toString(params.itemType())); result.addQueryItem("itemId", Support::toString(params.itemId())); result.addQueryItem("itemName", Support::toString(params.itemName())); // Optional parameters return result; } QByteArray DisplayContentLoader::body(const DisplayContentParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation DisplayContentLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } PostCapabilitiesLoader::PostCapabilitiesLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString PostCapabilitiesLoader::path(const PostCapabilitiesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/Capabilities"); } QUrlQuery PostCapabilitiesLoader::query(const PostCapabilitiesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters if (!params.jellyfinIdNull()) { result.addQueryItem("id", Support::toString(params.jellyfinId())); } if (!params.playableMediaTypesNull()) { result.addQueryItem("playableMediaTypes", Support::toString(params.playableMediaTypes())); } if (!params.supportedCommandsNull()) { result.addQueryItem("supportedCommands", Support::toString>(params.supportedCommands())); } if (!params.supportsMediaControlNull()) { result.addQueryItem("supportsMediaControl", Support::toString>(params.supportsMediaControl())); } if (!params.supportsSyncNull()) { result.addQueryItem("supportsSync", Support::toString>(params.supportsSync())); } if (!params.supportsPersistentIdentifierNull()) { result.addQueryItem("supportsPersistentIdentifier", Support::toString>(params.supportsPersistentIdentifier())); } return result; } QByteArray PostCapabilitiesLoader::body(const PostCapabilitiesParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation PostCapabilitiesLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } PostFullCapabilitiesLoader::PostFullCapabilitiesLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString PostFullCapabilitiesLoader::path(const PostFullCapabilitiesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/Capabilities/Full"); } QUrlQuery PostFullCapabilitiesLoader::query(const PostFullCapabilitiesParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters if (!params.jellyfinIdNull()) { result.addQueryItem("id", Support::toString(params.jellyfinId())); } return result; } QByteArray PostFullCapabilitiesLoader::body(const PostFullCapabilitiesParams ¶ms) const { return Support::toString>(params.body()).toUtf8(); } QNetworkAccessManager::Operation PostFullCapabilitiesLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } ReportSessionEndedLoader::ReportSessionEndedLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString ReportSessionEndedLoader::path(const ReportSessionEndedParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/Logout"); } QUrlQuery ReportSessionEndedLoader::query(const ReportSessionEndedParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; // Optional parameters return result; } QByteArray ReportSessionEndedLoader::body(const ReportSessionEndedParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation ReportSessionEndedLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } ReportViewingLoader::ReportViewingLoader(ApiClient *apiClient) : Jellyfin::Support::HttpLoader(apiClient) {} QString ReportViewingLoader::path(const ReportViewingParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings return QStringLiteral("/Sessions/Viewing"); } QUrlQuery ReportViewingLoader::query(const ReportViewingParams ¶ms) const { Q_UNUSED(params) // Might be overzealous, but I don't like theses kind of warnings QUrlQuery result; result.addQueryItem("itemId", Support::toString(params.itemId())); // Optional parameters if (!params.sessionIdNull()) { result.addQueryItem("sessionId", Support::toString(params.sessionId())); } return result; } QByteArray ReportViewingLoader::body(const ReportViewingParams ¶ms) const { return QByteArray(); } QNetworkAccessManager::Operation ReportViewingLoader::operation() const { // HTTP method Post return QNetworkAccessManager::PostOperation; } } // NS HTTP } // NS Loader } // NS Jellyfin