390 lines
16 KiB
Swift
390 lines
16 KiB
Swift
//
|
|
// LibraryStructureAPI.swift
|
|
//
|
|
// Generated by swagger-codegen
|
|
// https://github.com/swagger-api/swagger-codegen
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
|
|
|
|
open class LibraryStructureAPI {
|
|
/**
|
|
Add a media path to a library.
|
|
|
|
- parameter body: (body) The media path dto.
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func addMediaPath(body: VirtualFoldersPathsBody, refreshLibrary: Bool? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
addMediaPathWithRequestBuilder(body: body, refreshLibrary: refreshLibrary).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Add a media path to a library.
|
|
- POST /Library/VirtualFolders/Paths
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) The media path dto.
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func addMediaPathWithRequestBuilder(body: VirtualFoldersPathsBody, refreshLibrary: Bool? = nil) -> RequestBuilder<Void> {
|
|
let path = "/Library/VirtualFolders/Paths"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"refreshLibrary": refreshLibrary
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
|
}
|
|
/**
|
|
Adds a virtual folder.
|
|
|
|
- parameter body: (body) The library options. (optional)
|
|
- parameter name: (query) The name of the virtual folder. (optional)
|
|
- parameter collectionType: (query) The type of the collection. (optional)
|
|
- parameter paths: (query) The paths of the virtual folder. (optional)
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func addVirtualFolder(body: LibraryVirtualFoldersBody? = nil, name: String? = nil, collectionType: CollectionType? = nil, paths: [String]? = nil, refreshLibrary: Bool? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
addVirtualFolderWithRequestBuilder(body: body, name: name, collectionType: collectionType, paths: paths, refreshLibrary: refreshLibrary).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Adds a virtual folder.
|
|
- POST /Library/VirtualFolders
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) The library options. (optional)
|
|
- parameter name: (query) The name of the virtual folder. (optional)
|
|
- parameter collectionType: (query) The type of the collection. (optional)
|
|
- parameter paths: (query) The paths of the virtual folder. (optional)
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func addVirtualFolderWithRequestBuilder(body: LibraryVirtualFoldersBody? = nil, name: String? = nil, collectionType: CollectionType? = nil, paths: [String]? = nil, refreshLibrary: Bool? = nil) -> RequestBuilder<Void> {
|
|
let path = "/Library/VirtualFolders"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"name": name,
|
|
"collectionType": collectionType,
|
|
"paths": paths,
|
|
"refreshLibrary": refreshLibrary
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
|
}
|
|
/**
|
|
Gets all virtual folders.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getVirtualFolders(completion: @escaping ((_ data: [VirtualFolderInfo]?,_ error: Error?) -> Void)) {
|
|
getVirtualFoldersWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets all virtual folders.
|
|
- GET /Library/VirtualFolders
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=[ {
|
|
"RefreshProgress" : 0.8008281904610115,
|
|
"PrimaryImageItemId" : "PrimaryImageItemId",
|
|
"CollectionType" : "",
|
|
"Locations" : [ "Locations", "Locations" ],
|
|
"LibraryOptions" : "",
|
|
"ItemId" : "ItemId",
|
|
"RefreshStatus" : "RefreshStatus",
|
|
"Name" : "Name"
|
|
}, {
|
|
"RefreshProgress" : 0.8008281904610115,
|
|
"PrimaryImageItemId" : "PrimaryImageItemId",
|
|
"CollectionType" : "",
|
|
"Locations" : [ "Locations", "Locations" ],
|
|
"LibraryOptions" : "",
|
|
"ItemId" : "ItemId",
|
|
"RefreshStatus" : "RefreshStatus",
|
|
"Name" : "Name"
|
|
} ]}]
|
|
|
|
- returns: RequestBuilder<[VirtualFolderInfo]>
|
|
*/
|
|
open class func getVirtualFoldersWithRequestBuilder() -> RequestBuilder<[VirtualFolderInfo]> {
|
|
let path = "/Library/VirtualFolders"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<[VirtualFolderInfo]>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Remove a media path.
|
|
|
|
- parameter name: (query) The name of the library. (optional)
|
|
- parameter path: (query) The path to remove. (optional)
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func removeMediaPath(name: String? = nil, path: String? = nil, refreshLibrary: Bool? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
removeMediaPathWithRequestBuilder(name: name, path: path, refreshLibrary: refreshLibrary).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Remove a media path.
|
|
- DELETE /Library/VirtualFolders/Paths
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter name: (query) The name of the library. (optional)
|
|
- parameter path: (query) The path to remove. (optional)
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func removeMediaPathWithRequestBuilder(name: String? = nil, path: String? = nil, refreshLibrary: Bool? = nil) -> RequestBuilder<Void> {
|
|
let path = "/Library/VirtualFolders/Paths"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"name": name,
|
|
"path": path,
|
|
"refreshLibrary": refreshLibrary
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Removes a virtual folder.
|
|
|
|
- parameter name: (query) The name of the folder. (optional)
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func removeVirtualFolder(name: String? = nil, refreshLibrary: Bool? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
removeVirtualFolderWithRequestBuilder(name: name, refreshLibrary: refreshLibrary).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Removes a virtual folder.
|
|
- DELETE /Library/VirtualFolders
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter name: (query) The name of the folder. (optional)
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func removeVirtualFolderWithRequestBuilder(name: String? = nil, refreshLibrary: Bool? = nil) -> RequestBuilder<Void> {
|
|
let path = "/Library/VirtualFolders"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"name": name,
|
|
"refreshLibrary": refreshLibrary
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Renames a virtual folder.
|
|
|
|
- parameter name: (query) The name of the virtual folder. (optional)
|
|
- parameter newName: (query) The new name. (optional)
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func renameVirtualFolder(name: String? = nil, newName: String? = nil, refreshLibrary: Bool? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
renameVirtualFolderWithRequestBuilder(name: name, newName: newName, refreshLibrary: refreshLibrary).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Renames a virtual folder.
|
|
- POST /Library/VirtualFolders/Name
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter name: (query) The name of the virtual folder. (optional)
|
|
- parameter newName: (query) The new name. (optional)
|
|
- parameter refreshLibrary: (query) Whether to refresh the library. (optional, default to false)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func renameVirtualFolderWithRequestBuilder(name: String? = nil, newName: String? = nil, refreshLibrary: Bool? = nil) -> RequestBuilder<Void> {
|
|
let path = "/Library/VirtualFolders/Name"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"name": name,
|
|
"newName": newName,
|
|
"refreshLibrary": refreshLibrary
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Update library options.
|
|
|
|
- parameter body: (body) The library name and options. (optional)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func updateLibraryOptions(body: VirtualFoldersLibraryOptionsBody? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
updateLibraryOptionsWithRequestBuilder(body: body).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Update library options.
|
|
- POST /Library/VirtualFolders/LibraryOptions
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) The library name and options. (optional)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func updateLibraryOptionsWithRequestBuilder(body: VirtualFoldersLibraryOptionsBody? = nil) -> RequestBuilder<Void> {
|
|
let path = "/Library/VirtualFolders/LibraryOptions"
|
|
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)
|
|
}
|
|
/**
|
|
Updates a media path.
|
|
|
|
- parameter body: (body) The name of the library and path infos.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func updateMediaPath(body: PathsUpdateBody, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
updateMediaPathWithRequestBuilder(body: body).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Updates a media path.
|
|
- POST /Library/VirtualFolders/Paths/Update
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) The name of the library and path infos.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func updateMediaPathWithRequestBuilder(body: PathsUpdateBody) -> RequestBuilder<Void> {
|
|
let path = "/Library/VirtualFolders/Paths/Update"
|
|
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)
|
|
}
|
|
}
|