285 lines
9.8 KiB
Swift
285 lines
9.8 KiB
Swift
//
|
|
// QuickConnectAPI.swift
|
|
//
|
|
// Generated by swagger-codegen
|
|
// https://github.com/swagger-api/swagger-codegen
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
|
|
|
|
open class QuickConnectAPI {
|
|
/**
|
|
Temporarily activates quick connect for five minutes.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func activate(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
activateWithRequestBuilder().execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Temporarily activates quick connect for five minutes.
|
|
- POST /QuickConnect/Activate
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func activateWithRequestBuilder() -> RequestBuilder<Void> {
|
|
let path = "/QuickConnect/Activate"
|
|
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)
|
|
}
|
|
/**
|
|
Authorizes a pending quick connect request.
|
|
|
|
- parameter code: (query) Quick connect code to authorize.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func authorize(code: String, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) {
|
|
authorizeWithRequestBuilder(code: code).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Authorizes a pending quick connect request.
|
|
- POST /QuickConnect/Authorize
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=true}]
|
|
- parameter code: (query) Quick connect code to authorize.
|
|
|
|
- returns: RequestBuilder<Bool>
|
|
*/
|
|
open class func authorizeWithRequestBuilder(code: String) -> RequestBuilder<Bool> {
|
|
let path = "/QuickConnect/Authorize"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"code": code
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Bool>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Enables or disables quick connect.
|
|
|
|
- parameter status: (query) New MediaBrowser.Model.QuickConnect.QuickConnectState. (optional)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func available(status: Status2? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
availableWithRequestBuilder(status: status).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Enables or disables quick connect.
|
|
- POST /QuickConnect/Available
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter status: (query) New MediaBrowser.Model.QuickConnect.QuickConnectState. (optional)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func availableWithRequestBuilder(status: Status2? = nil) -> RequestBuilder<Void> {
|
|
let path = "/QuickConnect/Available"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"status": status
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Attempts to retrieve authentication information.
|
|
|
|
- parameter secret: (query) Secret previously returned from the Initiate endpoint.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func connect(secret: String, completion: @escaping ((_ data: QuickConnectResult?,_ error: Error?) -> Void)) {
|
|
connectWithRequestBuilder(secret: secret).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Attempts to retrieve authentication information.
|
|
- GET /QuickConnect/Connect
|
|
-
|
|
|
|
- examples: [{contentType=application/json, example={
|
|
"Secret" : "Secret",
|
|
"Authenticated" : true,
|
|
"Authentication" : "Authentication",
|
|
"Error" : "Error",
|
|
"DateAdded" : "2000-01-23T04:56:07.000+00:00",
|
|
"Code" : "Code"
|
|
}}]
|
|
- parameter secret: (query) Secret previously returned from the Initiate endpoint.
|
|
|
|
- returns: RequestBuilder<QuickConnectResult>
|
|
*/
|
|
open class func connectWithRequestBuilder(secret: String) -> RequestBuilder<QuickConnectResult> {
|
|
let path = "/QuickConnect/Connect"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"secret": secret
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<QuickConnectResult>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Deauthorize all quick connect devices for the current user.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func deauthorize(completion: @escaping ((_ data: Int?,_ error: Error?) -> Void)) {
|
|
deauthorizeWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Deauthorize all quick connect devices for the current user.
|
|
- POST /QuickConnect/Deauthorize
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=0}]
|
|
|
|
- returns: RequestBuilder<Int>
|
|
*/
|
|
open class func deauthorizeWithRequestBuilder() -> RequestBuilder<Int> {
|
|
let path = "/QuickConnect/Deauthorize"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Int>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Gets the current quick connect state.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getStatus(completion: @escaping ((_ data: QuickConnectState?,_ error: Error?) -> Void)) {
|
|
getStatusWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets the current quick connect state.
|
|
- GET /QuickConnect/Status
|
|
-
|
|
|
|
- examples: [{contentType=application/json, example="Unavailable"}]
|
|
|
|
- returns: RequestBuilder<QuickConnectState>
|
|
*/
|
|
open class func getStatusWithRequestBuilder() -> RequestBuilder<QuickConnectState> {
|
|
let path = "/QuickConnect/Status"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<QuickConnectState>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Initiate a new quick connect request.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func initiate(completion: @escaping ((_ data: QuickConnectResult?,_ error: Error?) -> Void)) {
|
|
initiateWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Initiate a new quick connect request.
|
|
- GET /QuickConnect/Initiate
|
|
-
|
|
|
|
- examples: [{contentType=application/json, example={
|
|
"Secret" : "Secret",
|
|
"Authenticated" : true,
|
|
"Authentication" : "Authentication",
|
|
"Error" : "Error",
|
|
"DateAdded" : "2000-01-23T04:56:07.000+00:00",
|
|
"Code" : "Code"
|
|
}}]
|
|
|
|
- returns: RequestBuilder<QuickConnectResult>
|
|
*/
|
|
open class func initiateWithRequestBuilder() -> RequestBuilder<QuickConnectResult> {
|
|
let path = "/QuickConnect/Initiate"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<QuickConnectResult>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
}
|