261 lines
8.8 KiB
Swift
261 lines
8.8 KiB
Swift
//
|
|
// DevicesAPI.swift
|
|
//
|
|
// Generated by swagger-codegen
|
|
// https://github.com/swagger-api/swagger-codegen
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
|
|
|
|
open class DevicesAPI {
|
|
/**
|
|
Deletes a device.
|
|
|
|
- parameter _id: (query) Device Id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func deleteDevice(_id: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
deleteDeviceWithRequestBuilder(_id: _id).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Deletes a device.
|
|
- DELETE /Devices
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter _id: (query) Device Id.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteDeviceWithRequestBuilder(_id: String) -> RequestBuilder<Void> {
|
|
let path = "/Devices"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"id": _id
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Get info for a device.
|
|
|
|
- parameter _id: (query) Device Id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getDeviceInfo(_id: String, completion: @escaping ((_ data: DeviceInfo?,_ error: Error?) -> Void)) {
|
|
getDeviceInfoWithRequestBuilder(_id: _id).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Get info for a device.
|
|
- GET /Devices/Info
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example={
|
|
"AppVersion" : "AppVersion",
|
|
"IconUrl" : "IconUrl",
|
|
"LastUserName" : "LastUserName",
|
|
"Capabilities" : "",
|
|
"LastUserId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
|
|
"Id" : "Id",
|
|
"DateLastActivity" : "2000-01-23T04:56:07.000+00:00",
|
|
"Name" : "Name",
|
|
"AppName" : "AppName"
|
|
}}]
|
|
- parameter _id: (query) Device Id.
|
|
|
|
- returns: RequestBuilder<DeviceInfo>
|
|
*/
|
|
open class func getDeviceInfoWithRequestBuilder(_id: String) -> RequestBuilder<DeviceInfo> {
|
|
let path = "/Devices/Info"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"id": _id
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<DeviceInfo>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Get options for a device.
|
|
|
|
- parameter _id: (query) Device Id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getDeviceOptions(_id: String, completion: @escaping ((_ data: DeviceOptions?,_ error: Error?) -> Void)) {
|
|
getDeviceOptionsWithRequestBuilder(_id: _id).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Get options for a device.
|
|
- GET /Devices/Options
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example={
|
|
"CustomName" : "CustomName"
|
|
}}]
|
|
- parameter _id: (query) Device Id.
|
|
|
|
- returns: RequestBuilder<DeviceOptions>
|
|
*/
|
|
open class func getDeviceOptionsWithRequestBuilder(_id: String) -> RequestBuilder<DeviceOptions> {
|
|
let path = "/Devices/Options"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"id": _id
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<DeviceOptions>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Get Devices.
|
|
|
|
- parameter supportsSync: (query) Gets or sets a value indicating whether [supports synchronize]. (optional)
|
|
- parameter userId: (query) Gets or sets the user identifier. (optional)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getDevices(supportsSync: Bool? = nil, userId: UUID? = nil, completion: @escaping ((_ data: DeviceInfoQueryResult?,_ error: Error?) -> Void)) {
|
|
getDevicesWithRequestBuilder(supportsSync: supportsSync, userId: userId).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Get Devices.
|
|
- GET /Devices
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example={
|
|
"TotalRecordCount" : 0,
|
|
"StartIndex" : 6,
|
|
"Items" : [ {
|
|
"AppVersion" : "AppVersion",
|
|
"IconUrl" : "IconUrl",
|
|
"LastUserName" : "LastUserName",
|
|
"Capabilities" : "",
|
|
"LastUserId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
|
|
"Id" : "Id",
|
|
"DateLastActivity" : "2000-01-23T04:56:07.000+00:00",
|
|
"Name" : "Name",
|
|
"AppName" : "AppName"
|
|
}, {
|
|
"AppVersion" : "AppVersion",
|
|
"IconUrl" : "IconUrl",
|
|
"LastUserName" : "LastUserName",
|
|
"Capabilities" : "",
|
|
"LastUserId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
|
|
"Id" : "Id",
|
|
"DateLastActivity" : "2000-01-23T04:56:07.000+00:00",
|
|
"Name" : "Name",
|
|
"AppName" : "AppName"
|
|
} ]
|
|
}}]
|
|
- parameter supportsSync: (query) Gets or sets a value indicating whether [supports synchronize]. (optional)
|
|
- parameter userId: (query) Gets or sets the user identifier. (optional)
|
|
|
|
- returns: RequestBuilder<DeviceInfoQueryResult>
|
|
*/
|
|
open class func getDevicesWithRequestBuilder(supportsSync: Bool? = nil, userId: UUID? = nil) -> RequestBuilder<DeviceInfoQueryResult> {
|
|
let path = "/Devices"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"supportsSync": supportsSync,
|
|
"userId": userId
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<DeviceInfoQueryResult>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Update device options.
|
|
|
|
- parameter body: (body) Device Options.
|
|
- parameter _id: (query) Device Id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func updateDeviceOptions(body: DevicesOptionsBody, _id: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
updateDeviceOptionsWithRequestBuilder(body: body, _id: _id).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Update device options.
|
|
- POST /Devices/Options
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) Device Options.
|
|
- parameter _id: (query) Device Id.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func updateDeviceOptionsWithRequestBuilder(body: DevicesOptionsBody, _id: String) -> RequestBuilder<Void> {
|
|
let path = "/Devices/Options"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"id": _id
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
|
}
|
|
}
|