jellyfin-discord-bot/server/jellyfin/apis/EnvironmentApi.ts

268 lines
9.7 KiB
TypeScript
Raw Permalink Normal View History

2023-05-04 23:34:53 +02:00
/* 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 {
DefaultDirectoryBrowserInfoDto,
FileSystemEntryInfo,
ProblemDetails,
ValidatePathRequest,
} from '../models';
import {
DefaultDirectoryBrowserInfoDtoFromJSON,
DefaultDirectoryBrowserInfoDtoToJSON,
FileSystemEntryInfoFromJSON,
FileSystemEntryInfoToJSON,
ProblemDetailsFromJSON,
ProblemDetailsToJSON,
ValidatePathRequestFromJSON,
ValidatePathRequestToJSON,
} from '../models';
export interface GetDirectoryContentsRequest {
path: string;
includeFiles?: boolean;
includeDirectories?: boolean;
}
export interface GetParentPathRequest {
path: string;
}
export interface ValidatePathOperationRequest {
validatePathRequest: ValidatePathRequest;
}
/**
*
*/
export class EnvironmentApi extends runtime.BaseAPI {
/**
* Get Default directory browser.
*/
async getDefaultDirectoryBrowserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DefaultDirectoryBrowserInfoDto>> {
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: `/Environment/DefaultDirectoryBrowser`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DefaultDirectoryBrowserInfoDtoFromJSON(jsonValue));
}
/**
* Get Default directory browser.
*/
async getDefaultDirectoryBrowser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DefaultDirectoryBrowserInfoDto> {
const response = await this.getDefaultDirectoryBrowserRaw(initOverrides);
return await response.value();
}
/**
* Gets the contents of a given directory in the file system.
*/
async getDirectoryContentsRaw(requestParameters: GetDirectoryContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<FileSystemEntryInfo>>> {
if (requestParameters.path === null || requestParameters.path === undefined) {
throw new runtime.RequiredError('path','Required parameter requestParameters.path was null or undefined when calling getDirectoryContents.');
}
const queryParameters: any = {};
if (requestParameters.path !== undefined) {
queryParameters['path'] = requestParameters.path;
}
if (requestParameters.includeFiles !== undefined) {
queryParameters['includeFiles'] = requestParameters.includeFiles;
}
if (requestParameters.includeDirectories !== undefined) {
queryParameters['includeDirectories'] = requestParameters.includeDirectories;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
}
const response = await this.request({
path: `/Environment/DirectoryContents`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FileSystemEntryInfoFromJSON));
}
/**
* Gets the contents of a given directory in the file system.
*/
async getDirectoryContents(requestParameters: GetDirectoryContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FileSystemEntryInfo>> {
const response = await this.getDirectoryContentsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Gets available drives from the server\'s file system.
*/
async getDrivesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<FileSystemEntryInfo>>> {
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: `/Environment/Drives`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FileSystemEntryInfoFromJSON));
}
/**
* Gets available drives from the server\'s file system.
*/
async getDrives(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FileSystemEntryInfo>> {
const response = await this.getDrivesRaw(initOverrides);
return await response.value();
}
/**
* Gets network paths.
*/
async getNetworkSharesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<FileSystemEntryInfo>>> {
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: `/Environment/NetworkShares`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FileSystemEntryInfoFromJSON));
}
/**
* Gets network paths.
*/
async getNetworkShares(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FileSystemEntryInfo>> {
const response = await this.getNetworkSharesRaw(initOverrides);
return await response.value();
}
/**
* Gets the parent path of a given path.
*/
async getParentPathRaw(requestParameters: GetParentPathRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters.path === null || requestParameters.path === undefined) {
throw new runtime.RequiredError('path','Required parameter requestParameters.path was null or undefined when calling getParentPath.');
}
const queryParameters: any = {};
if (requestParameters.path !== undefined) {
queryParameters['path'] = requestParameters.path;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
}
const response = await this.request({
path: `/Environment/ParentPath`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Gets the parent path of a given path.
*/
async getParentPath(requestParameters: GetParentPathRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.getParentPathRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Validates path.
*/
async validatePathRaw(requestParameters: ValidatePathOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.validatePathRequest === null || requestParameters.validatePathRequest === undefined) {
throw new runtime.RequiredError('validatePathRequest','Required parameter requestParameters.validatePathRequest was null or undefined when calling validatePath.');
}
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: `/Environment/ValidatePath`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ValidatePathRequestToJSON(requestParameters.validatePathRequest),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Validates path.
*/
async validatePath(requestParameters: ValidatePathOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.validatePathRaw(requestParameters, initOverrides);
}
}