464 lines
18 KiB
Swift
464 lines
18 KiB
Swift
//
|
|
// PluginsAPI.swift
|
|
//
|
|
// Generated by swagger-codegen
|
|
// https://github.com/swagger-api/swagger-codegen
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
|
|
|
|
open class PluginsAPI {
|
|
/**
|
|
Disable a plugin.
|
|
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter version: (path) Plugin version.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func disablePlugin(pluginId: UUID, version: Version1, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
disablePluginWithRequestBuilder(pluginId: pluginId, version: version).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Disable a plugin.
|
|
- POST /Plugins/{pluginId}/{version}/Disable
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter version: (path) Plugin version.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func disablePluginWithRequestBuilder(pluginId: UUID, version: Version1) -> RequestBuilder<Void> {
|
|
var path = "/Plugins/{pluginId}/{version}/Disable"
|
|
let pluginIdPreEscape = "\(pluginId)"
|
|
let pluginIdPostEscape = pluginIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{pluginId}", with: pluginIdPostEscape, options: .literal, range: nil)
|
|
let versionPreEscape = "\(version)"
|
|
let versionPostEscape = versionPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{version}", with: versionPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
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: false)
|
|
}
|
|
/**
|
|
Enables a disabled plugin.
|
|
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter version: (path) Plugin version.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func enablePlugin(pluginId: UUID, version: Version2, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
enablePluginWithRequestBuilder(pluginId: pluginId, version: version).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Enables a disabled plugin.
|
|
- POST /Plugins/{pluginId}/{version}/Enable
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter version: (path) Plugin version.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func enablePluginWithRequestBuilder(pluginId: UUID, version: Version2) -> RequestBuilder<Void> {
|
|
var path = "/Plugins/{pluginId}/{version}/Enable"
|
|
let pluginIdPreEscape = "\(pluginId)"
|
|
let pluginIdPostEscape = pluginIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{pluginId}", with: pluginIdPostEscape, options: .literal, range: nil)
|
|
let versionPreEscape = "\(version)"
|
|
let versionPostEscape = versionPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{version}", with: versionPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
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: false)
|
|
}
|
|
/**
|
|
Gets plugin configuration.
|
|
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getPluginConfiguration(pluginId: UUID, completion: @escaping ((_ data: BasePluginConfiguration?,_ error: Error?) -> Void)) {
|
|
getPluginConfigurationWithRequestBuilder(pluginId: pluginId).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets plugin configuration.
|
|
- GET /Plugins/{pluginId}/Configuration
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example={ }}]
|
|
- parameter pluginId: (path) Plugin id.
|
|
|
|
- returns: RequestBuilder<BasePluginConfiguration>
|
|
*/
|
|
open class func getPluginConfigurationWithRequestBuilder(pluginId: UUID) -> RequestBuilder<BasePluginConfiguration> {
|
|
var path = "/Plugins/{pluginId}/Configuration"
|
|
let pluginIdPreEscape = "\(pluginId)"
|
|
let pluginIdPostEscape = pluginIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{pluginId}", with: pluginIdPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<BasePluginConfiguration>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Gets a plugin's image.
|
|
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter version: (path) Plugin version.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getPluginImage(pluginId: UUID, version: Version3, completion: @escaping ((_ data: Data?,_ error: Error?) -> Void)) {
|
|
getPluginImageWithRequestBuilder(pluginId: pluginId, version: version).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets a plugin's image.
|
|
- GET /Plugins/{pluginId}/{version}/Image
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=""}]
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter version: (path) Plugin version.
|
|
|
|
- returns: RequestBuilder<Data>
|
|
*/
|
|
open class func getPluginImageWithRequestBuilder(pluginId: UUID, version: Version3) -> RequestBuilder<Data> {
|
|
var path = "/Plugins/{pluginId}/{version}/Image"
|
|
let pluginIdPreEscape = "\(pluginId)"
|
|
let pluginIdPostEscape = pluginIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{pluginId}", with: pluginIdPostEscape, options: .literal, range: nil)
|
|
let versionPreEscape = "\(version)"
|
|
let versionPostEscape = versionPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{version}", with: versionPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Data>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Gets a plugin's manifest.
|
|
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getPluginManifest(pluginId: UUID, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
getPluginManifestWithRequestBuilder(pluginId: pluginId).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets a plugin's manifest.
|
|
- POST /Plugins/{pluginId}/Manifest
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter pluginId: (path) Plugin id.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getPluginManifestWithRequestBuilder(pluginId: UUID) -> RequestBuilder<Void> {
|
|
var path = "/Plugins/{pluginId}/Manifest"
|
|
let pluginIdPreEscape = "\(pluginId)"
|
|
let pluginIdPostEscape = pluginIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{pluginId}", with: pluginIdPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
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: false)
|
|
}
|
|
/**
|
|
Gets a list of currently installed plugins.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getPlugins(completion: @escaping ((_ data: [PluginInfo]?,_ error: Error?) -> Void)) {
|
|
getPluginsWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets a list of currently installed plugins.
|
|
- GET /Plugins
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=[ {
|
|
"Status" : "",
|
|
"Description" : "Description",
|
|
"Version" : "",
|
|
"HasImage" : true,
|
|
"Id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
|
|
"ConfigurationFileName" : "ConfigurationFileName",
|
|
"CanUninstall" : true,
|
|
"Name" : "Name"
|
|
}, {
|
|
"Status" : "",
|
|
"Description" : "Description",
|
|
"Version" : "",
|
|
"HasImage" : true,
|
|
"Id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
|
|
"ConfigurationFileName" : "ConfigurationFileName",
|
|
"CanUninstall" : true,
|
|
"Name" : "Name"
|
|
} ]}]
|
|
|
|
- returns: RequestBuilder<[PluginInfo]>
|
|
*/
|
|
open class func getPluginsWithRequestBuilder() -> RequestBuilder<[PluginInfo]> {
|
|
let path = "/Plugins"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<[PluginInfo]>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Uninstalls a plugin.
|
|
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func uninstallPlugin(pluginId: UUID, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
uninstallPluginWithRequestBuilder(pluginId: pluginId).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Uninstalls a plugin.
|
|
- DELETE /Plugins/{pluginId}
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter pluginId: (path) Plugin id.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func uninstallPluginWithRequestBuilder(pluginId: UUID) -> RequestBuilder<Void> {
|
|
var path = "/Plugins/{pluginId}"
|
|
let pluginIdPreEscape = "\(pluginId)"
|
|
let pluginIdPostEscape = pluginIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{pluginId}", with: pluginIdPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Uninstalls a plugin by version.
|
|
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter version: (path) Plugin version.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func uninstallPluginByVersion(pluginId: UUID, version: Version, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
uninstallPluginByVersionWithRequestBuilder(pluginId: pluginId, version: version).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Uninstalls a plugin by version.
|
|
- DELETE /Plugins/{pluginId}/{version}
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter version: (path) Plugin version.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func uninstallPluginByVersionWithRequestBuilder(pluginId: UUID, version: Version) -> RequestBuilder<Void> {
|
|
var path = "/Plugins/{pluginId}/{version}"
|
|
let pluginIdPreEscape = "\(pluginId)"
|
|
let pluginIdPostEscape = pluginIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{pluginId}", with: pluginIdPostEscape, options: .literal, range: nil)
|
|
let versionPreEscape = "\(version)"
|
|
let versionPostEscape = versionPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{version}", with: versionPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Updates plugin configuration.
|
|
|
|
- parameter pluginId: (path) Plugin id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func updatePluginConfiguration(pluginId: UUID, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
updatePluginConfigurationWithRequestBuilder(pluginId: pluginId).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Updates plugin configuration.
|
|
- POST /Plugins/{pluginId}/Configuration
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter pluginId: (path) Plugin id.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func updatePluginConfigurationWithRequestBuilder(pluginId: UUID) -> RequestBuilder<Void> {
|
|
var path = "/Plugins/{pluginId}/Configuration"
|
|
let pluginIdPreEscape = "\(pluginId)"
|
|
let pluginIdPostEscape = pluginIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{pluginId}", with: pluginIdPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
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: false)
|
|
}
|
|
/**
|
|
Updates plugin security info.
|
|
|
|
- parameter body: (body) Plugin security info.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func updatePluginSecurityInfo(body: PluginsSecurityInfoBody, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
updatePluginSecurityInfoWithRequestBuilder(body: body).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Updates plugin security info.
|
|
- POST /Plugins/SecurityInfo
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) Plugin security info.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func updatePluginSecurityInfoWithRequestBuilder(body: PluginsSecurityInfoBody) -> RequestBuilder<Void> {
|
|
let path = "/Plugins/SecurityInfo"
|
|
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)
|
|
}
|
|
}
|