271 lines
9.7 KiB
Swift
271 lines
9.7 KiB
Swift
//
|
|
// EnvironmentAPI.swift
|
|
//
|
|
// Generated by swagger-codegen
|
|
// https://github.com/swagger-api/swagger-codegen
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
|
|
|
|
open class EnvironmentAPI {
|
|
/**
|
|
Get Default directory browser.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getDefaultDirectoryBrowser(completion: @escaping ((_ data: DefaultDirectoryBrowserInfoDto?,_ error: Error?) -> Void)) {
|
|
getDefaultDirectoryBrowserWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Get Default directory browser.
|
|
- GET /Environment/DefaultDirectoryBrowser
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example={
|
|
"Path" : "Path"
|
|
}}]
|
|
|
|
- returns: RequestBuilder<DefaultDirectoryBrowserInfoDto>
|
|
*/
|
|
open class func getDefaultDirectoryBrowserWithRequestBuilder() -> RequestBuilder<DefaultDirectoryBrowserInfoDto> {
|
|
let path = "/Environment/DefaultDirectoryBrowser"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<DefaultDirectoryBrowserInfoDto>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Gets the contents of a given directory in the file system.
|
|
|
|
- parameter path: (query) The path.
|
|
- parameter includeFiles: (query) An optional filter to include or exclude files from the results. true/false. (optional, default to false)
|
|
- parameter includeDirectories: (query) An optional filter to include or exclude folders from the results. true/false. (optional, default to false)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getDirectoryContents(path: String, includeFiles: Bool? = nil, includeDirectories: Bool? = nil, completion: @escaping ((_ data: [FileSystemEntryInfo]?,_ error: Error?) -> Void)) {
|
|
getDirectoryContentsWithRequestBuilder(path: path, includeFiles: includeFiles, includeDirectories: includeDirectories).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets the contents of a given directory in the file system.
|
|
- GET /Environment/DirectoryContents
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=[ {
|
|
"Path" : "Path",
|
|
"Type" : "",
|
|
"Name" : "Name"
|
|
}, {
|
|
"Path" : "Path",
|
|
"Type" : "",
|
|
"Name" : "Name"
|
|
} ]}]
|
|
- parameter path: (query) The path.
|
|
- parameter includeFiles: (query) An optional filter to include or exclude files from the results. true/false. (optional, default to false)
|
|
- parameter includeDirectories: (query) An optional filter to include or exclude folders from the results. true/false. (optional, default to false)
|
|
|
|
- returns: RequestBuilder<[FileSystemEntryInfo]>
|
|
*/
|
|
open class func getDirectoryContentsWithRequestBuilder(path: String, includeFiles: Bool? = nil, includeDirectories: Bool? = nil) -> RequestBuilder<[FileSystemEntryInfo]> {
|
|
let path = "/Environment/DirectoryContents"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"path": path,
|
|
"includeFiles": includeFiles,
|
|
"includeDirectories": includeDirectories
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<[FileSystemEntryInfo]>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Gets available drives from the server's file system.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getDrives(completion: @escaping ((_ data: [FileSystemEntryInfo]?,_ error: Error?) -> Void)) {
|
|
getDrivesWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets available drives from the server's file system.
|
|
- GET /Environment/Drives
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=[ {
|
|
"Path" : "Path",
|
|
"Type" : "",
|
|
"Name" : "Name"
|
|
}, {
|
|
"Path" : "Path",
|
|
"Type" : "",
|
|
"Name" : "Name"
|
|
} ]}]
|
|
|
|
- returns: RequestBuilder<[FileSystemEntryInfo]>
|
|
*/
|
|
open class func getDrivesWithRequestBuilder() -> RequestBuilder<[FileSystemEntryInfo]> {
|
|
let path = "/Environment/Drives"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<[FileSystemEntryInfo]>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Gets network paths.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getNetworkShares(completion: @escaping ((_ data: [FileSystemEntryInfo]?,_ error: Error?) -> Void)) {
|
|
getNetworkSharesWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets network paths.
|
|
- GET /Environment/NetworkShares
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=[ {
|
|
"Path" : "Path",
|
|
"Type" : "",
|
|
"Name" : "Name"
|
|
}, {
|
|
"Path" : "Path",
|
|
"Type" : "",
|
|
"Name" : "Name"
|
|
} ]}]
|
|
|
|
- returns: RequestBuilder<[FileSystemEntryInfo]>
|
|
*/
|
|
open class func getNetworkSharesWithRequestBuilder() -> RequestBuilder<[FileSystemEntryInfo]> {
|
|
let path = "/Environment/NetworkShares"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<[FileSystemEntryInfo]>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Gets the parent path of a given path.
|
|
|
|
- parameter path: (query) The path.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getParentPath(path: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) {
|
|
getParentPathWithRequestBuilder(path: path).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets the parent path of a given path.
|
|
- GET /Environment/ParentPath
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=""}]
|
|
- parameter path: (query) The path.
|
|
|
|
- returns: RequestBuilder<String>
|
|
*/
|
|
open class func getParentPathWithRequestBuilder(path: String) -> RequestBuilder<String> {
|
|
let path = "/Environment/ParentPath"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"path": path
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<String>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Validates path.
|
|
|
|
- parameter body: (body) Validate request object.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func validatePath(body: EnvironmentValidatePathBody, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
validatePathWithRequestBuilder(body: body).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Validates path.
|
|
- POST /Environment/ValidatePath
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) Validate request object.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func validatePathWithRequestBuilder(body: EnvironmentValidatePathBody) -> RequestBuilder<Void> {
|
|
let path = "/Environment/ValidatePath"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
|
}
|
|
}
|