572 lines
17 KiB
Swift
572 lines
17 KiB
Swift
//
|
|
// DlnaAPI.swift
|
|
//
|
|
// Generated by swagger-codegen
|
|
// https://github.com/swagger-api/swagger-codegen
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
|
|
|
|
open class DlnaAPI {
|
|
/**
|
|
Creates a profile.
|
|
|
|
- parameter body: (body) Device profile. (optional)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func createProfile(body: DlnaProfilesBody? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
createProfileWithRequestBuilder(body: body).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Creates a profile.
|
|
- POST /Dlna/Profiles
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) Device profile. (optional)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func createProfileWithRequestBuilder(body: DlnaProfilesBody? = nil) -> RequestBuilder<Void> {
|
|
let path = "/Dlna/Profiles"
|
|
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)
|
|
}
|
|
/**
|
|
Deletes a profile.
|
|
|
|
- parameter profileId: (path) Profile id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func deleteProfile(profileId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
deleteProfileWithRequestBuilder(profileId: profileId).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Deletes a profile.
|
|
- DELETE /Dlna/Profiles/{profileId}
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter profileId: (path) Profile id.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteProfileWithRequestBuilder(profileId: String) -> RequestBuilder<Void> {
|
|
var path = "/Dlna/Profiles/{profileId}"
|
|
let profileIdPreEscape = "\(profileId)"
|
|
let profileIdPostEscape = profileIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{profileId}", with: profileIdPostEscape, 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)
|
|
}
|
|
/**
|
|
Gets the default profile.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getDefaultProfile(completion: @escaping ((_ data: DeviceProfile?,_ error: Error?) -> Void)) {
|
|
getDefaultProfileWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets the default profile.
|
|
- GET /Dlna/Profiles/Default
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example={
|
|
"ManufacturerUrl" : "ManufacturerUrl",
|
|
"EnableSingleAlbumArtLimit" : true,
|
|
"MusicStreamingTranscodingBitrate" : 7,
|
|
"AlbumArtPn" : "AlbumArtPn",
|
|
"TranscodingProfiles" : [ {
|
|
"Context" : "",
|
|
"BreakOnNonKeyFrames" : true,
|
|
"EnableSubtitlesInManifest" : true,
|
|
"CopyTimestamps" : true,
|
|
"MinSegments" : 2,
|
|
"EnableMpegtsM2TsMode" : true,
|
|
"MaxAudioChannels" : "MaxAudioChannels",
|
|
"VideoCodec" : "VideoCodec",
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"EstimateContentLength" : true,
|
|
"SegmentLength" : 4,
|
|
"TranscodeSeekInfo" : "",
|
|
"Protocol" : "Protocol",
|
|
"AudioCodec" : "AudioCodec"
|
|
}, {
|
|
"Context" : "",
|
|
"BreakOnNonKeyFrames" : true,
|
|
"EnableSubtitlesInManifest" : true,
|
|
"CopyTimestamps" : true,
|
|
"MinSegments" : 2,
|
|
"EnableMpegtsM2TsMode" : true,
|
|
"MaxAudioChannels" : "MaxAudioChannels",
|
|
"VideoCodec" : "VideoCodec",
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"EstimateContentLength" : true,
|
|
"SegmentLength" : 4,
|
|
"TranscodeSeekInfo" : "",
|
|
"Protocol" : "Protocol",
|
|
"AudioCodec" : "AudioCodec"
|
|
} ],
|
|
"Identification" : "",
|
|
"MaxStreamingBitrate" : 5,
|
|
"IgnoreTranscodeByteRangeRequests" : true,
|
|
"Name" : "Name",
|
|
"ResponseProfiles" : [ {
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"OrgPn" : "OrgPn",
|
|
"VideoCodec" : "VideoCodec",
|
|
"AudioCodec" : "AudioCodec",
|
|
"MimeType" : "MimeType",
|
|
"Conditions" : [ null, null ]
|
|
}, {
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"OrgPn" : "OrgPn",
|
|
"VideoCodec" : "VideoCodec",
|
|
"AudioCodec" : "AudioCodec",
|
|
"MimeType" : "MimeType",
|
|
"Conditions" : [ null, null ]
|
|
} ],
|
|
"ModelUrl" : "ModelUrl",
|
|
"MaxStaticBitrate" : 2,
|
|
"Manufacturer" : "Manufacturer",
|
|
"ProtocolInfo" : "ProtocolInfo",
|
|
"RequiresPlainVideoItems" : true,
|
|
"ModelDescription" : "ModelDescription",
|
|
"MaxAlbumArtWidth" : 0,
|
|
"ModelNumber" : "ModelNumber",
|
|
"XmlRootAttributes" : [ {
|
|
"Value" : "Value",
|
|
"Name" : "Name"
|
|
}, {
|
|
"Value" : "Value",
|
|
"Name" : "Name"
|
|
} ],
|
|
"ModelName" : "ModelName",
|
|
"FriendlyName" : "FriendlyName",
|
|
"MaxIconHeight" : 5,
|
|
"RequiresPlainFolders" : true,
|
|
"EnableSingleSubtitleLimit" : true,
|
|
"SubtitleProfiles" : [ {
|
|
"Container" : "Container",
|
|
"Format" : "Format",
|
|
"Language" : "Language",
|
|
"DidlMode" : "DidlMode",
|
|
"Method" : ""
|
|
}, {
|
|
"Container" : "Container",
|
|
"Format" : "Format",
|
|
"Language" : "Language",
|
|
"DidlMode" : "DidlMode",
|
|
"Method" : ""
|
|
} ],
|
|
"MaxAlbumArtHeight" : 6,
|
|
"EnableAlbumArtInDidl" : true,
|
|
"EnableMSMediaReceiverRegistrar" : true,
|
|
"SerialNumber" : "SerialNumber",
|
|
"SupportedMediaTypes" : "SupportedMediaTypes",
|
|
"CodecProfiles" : [ {
|
|
"Type" : "",
|
|
"Codec" : "Codec",
|
|
"Container" : "Container",
|
|
"ApplyConditions" : [ null, null ],
|
|
"Conditions" : [ null, null ]
|
|
}, {
|
|
"Type" : "",
|
|
"Codec" : "Codec",
|
|
"Container" : "Container",
|
|
"ApplyConditions" : [ null, null ],
|
|
"Conditions" : [ null, null ]
|
|
} ],
|
|
"SonyAggregationFlags" : "SonyAggregationFlags",
|
|
"UserId" : "UserId",
|
|
"MaxIconWidth" : 1,
|
|
"TimelineOffsetSeconds" : 3,
|
|
"MaxStaticMusicBitrate" : 9,
|
|
"DirectPlayProfiles" : [ {
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"VideoCodec" : "VideoCodec",
|
|
"AudioCodec" : "AudioCodec"
|
|
}, {
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"VideoCodec" : "VideoCodec",
|
|
"AudioCodec" : "AudioCodec"
|
|
} ],
|
|
"ContainerProfiles" : [ {
|
|
"Type" : "",
|
|
"Container" : "Container",
|
|
"Conditions" : [ {
|
|
"Condition" : "",
|
|
"IsRequired" : true,
|
|
"Value" : "Value",
|
|
"Property" : ""
|
|
}, {
|
|
"Condition" : "",
|
|
"IsRequired" : true,
|
|
"Value" : "Value",
|
|
"Property" : ""
|
|
} ]
|
|
}, {
|
|
"Type" : "",
|
|
"Container" : "Container",
|
|
"Conditions" : [ {
|
|
"Condition" : "",
|
|
"IsRequired" : true,
|
|
"Value" : "Value",
|
|
"Property" : ""
|
|
}, {
|
|
"Condition" : "",
|
|
"IsRequired" : true,
|
|
"Value" : "Value",
|
|
"Property" : ""
|
|
} ]
|
|
} ],
|
|
"Id" : "Id"
|
|
}}]
|
|
|
|
- returns: RequestBuilder<DeviceProfile>
|
|
*/
|
|
open class func getDefaultProfileWithRequestBuilder() -> RequestBuilder<DeviceProfile> {
|
|
let path = "/Dlna/Profiles/Default"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<DeviceProfile>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Gets a single profile.
|
|
|
|
- parameter profileId: (path) Profile Id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getProfile(profileId: String, completion: @escaping ((_ data: DeviceProfile?,_ error: Error?) -> Void)) {
|
|
getProfileWithRequestBuilder(profileId: profileId).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Gets a single profile.
|
|
- GET /Dlna/Profiles/{profileId}
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example={
|
|
"ManufacturerUrl" : "ManufacturerUrl",
|
|
"EnableSingleAlbumArtLimit" : true,
|
|
"MusicStreamingTranscodingBitrate" : 7,
|
|
"AlbumArtPn" : "AlbumArtPn",
|
|
"TranscodingProfiles" : [ {
|
|
"Context" : "",
|
|
"BreakOnNonKeyFrames" : true,
|
|
"EnableSubtitlesInManifest" : true,
|
|
"CopyTimestamps" : true,
|
|
"MinSegments" : 2,
|
|
"EnableMpegtsM2TsMode" : true,
|
|
"MaxAudioChannels" : "MaxAudioChannels",
|
|
"VideoCodec" : "VideoCodec",
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"EstimateContentLength" : true,
|
|
"SegmentLength" : 4,
|
|
"TranscodeSeekInfo" : "",
|
|
"Protocol" : "Protocol",
|
|
"AudioCodec" : "AudioCodec"
|
|
}, {
|
|
"Context" : "",
|
|
"BreakOnNonKeyFrames" : true,
|
|
"EnableSubtitlesInManifest" : true,
|
|
"CopyTimestamps" : true,
|
|
"MinSegments" : 2,
|
|
"EnableMpegtsM2TsMode" : true,
|
|
"MaxAudioChannels" : "MaxAudioChannels",
|
|
"VideoCodec" : "VideoCodec",
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"EstimateContentLength" : true,
|
|
"SegmentLength" : 4,
|
|
"TranscodeSeekInfo" : "",
|
|
"Protocol" : "Protocol",
|
|
"AudioCodec" : "AudioCodec"
|
|
} ],
|
|
"Identification" : "",
|
|
"MaxStreamingBitrate" : 5,
|
|
"IgnoreTranscodeByteRangeRequests" : true,
|
|
"Name" : "Name",
|
|
"ResponseProfiles" : [ {
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"OrgPn" : "OrgPn",
|
|
"VideoCodec" : "VideoCodec",
|
|
"AudioCodec" : "AudioCodec",
|
|
"MimeType" : "MimeType",
|
|
"Conditions" : [ null, null ]
|
|
}, {
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"OrgPn" : "OrgPn",
|
|
"VideoCodec" : "VideoCodec",
|
|
"AudioCodec" : "AudioCodec",
|
|
"MimeType" : "MimeType",
|
|
"Conditions" : [ null, null ]
|
|
} ],
|
|
"ModelUrl" : "ModelUrl",
|
|
"MaxStaticBitrate" : 2,
|
|
"Manufacturer" : "Manufacturer",
|
|
"ProtocolInfo" : "ProtocolInfo",
|
|
"RequiresPlainVideoItems" : true,
|
|
"ModelDescription" : "ModelDescription",
|
|
"MaxAlbumArtWidth" : 0,
|
|
"ModelNumber" : "ModelNumber",
|
|
"XmlRootAttributes" : [ {
|
|
"Value" : "Value",
|
|
"Name" : "Name"
|
|
}, {
|
|
"Value" : "Value",
|
|
"Name" : "Name"
|
|
} ],
|
|
"ModelName" : "ModelName",
|
|
"FriendlyName" : "FriendlyName",
|
|
"MaxIconHeight" : 5,
|
|
"RequiresPlainFolders" : true,
|
|
"EnableSingleSubtitleLimit" : true,
|
|
"SubtitleProfiles" : [ {
|
|
"Container" : "Container",
|
|
"Format" : "Format",
|
|
"Language" : "Language",
|
|
"DidlMode" : "DidlMode",
|
|
"Method" : ""
|
|
}, {
|
|
"Container" : "Container",
|
|
"Format" : "Format",
|
|
"Language" : "Language",
|
|
"DidlMode" : "DidlMode",
|
|
"Method" : ""
|
|
} ],
|
|
"MaxAlbumArtHeight" : 6,
|
|
"EnableAlbumArtInDidl" : true,
|
|
"EnableMSMediaReceiverRegistrar" : true,
|
|
"SerialNumber" : "SerialNumber",
|
|
"SupportedMediaTypes" : "SupportedMediaTypes",
|
|
"CodecProfiles" : [ {
|
|
"Type" : "",
|
|
"Codec" : "Codec",
|
|
"Container" : "Container",
|
|
"ApplyConditions" : [ null, null ],
|
|
"Conditions" : [ null, null ]
|
|
}, {
|
|
"Type" : "",
|
|
"Codec" : "Codec",
|
|
"Container" : "Container",
|
|
"ApplyConditions" : [ null, null ],
|
|
"Conditions" : [ null, null ]
|
|
} ],
|
|
"SonyAggregationFlags" : "SonyAggregationFlags",
|
|
"UserId" : "UserId",
|
|
"MaxIconWidth" : 1,
|
|
"TimelineOffsetSeconds" : 3,
|
|
"MaxStaticMusicBitrate" : 9,
|
|
"DirectPlayProfiles" : [ {
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"VideoCodec" : "VideoCodec",
|
|
"AudioCodec" : "AudioCodec"
|
|
}, {
|
|
"Container" : "Container",
|
|
"Type" : "",
|
|
"VideoCodec" : "VideoCodec",
|
|
"AudioCodec" : "AudioCodec"
|
|
} ],
|
|
"ContainerProfiles" : [ {
|
|
"Type" : "",
|
|
"Container" : "Container",
|
|
"Conditions" : [ {
|
|
"Condition" : "",
|
|
"IsRequired" : true,
|
|
"Value" : "Value",
|
|
"Property" : ""
|
|
}, {
|
|
"Condition" : "",
|
|
"IsRequired" : true,
|
|
"Value" : "Value",
|
|
"Property" : ""
|
|
} ]
|
|
}, {
|
|
"Type" : "",
|
|
"Container" : "Container",
|
|
"Conditions" : [ {
|
|
"Condition" : "",
|
|
"IsRequired" : true,
|
|
"Value" : "Value",
|
|
"Property" : ""
|
|
}, {
|
|
"Condition" : "",
|
|
"IsRequired" : true,
|
|
"Value" : "Value",
|
|
"Property" : ""
|
|
} ]
|
|
} ],
|
|
"Id" : "Id"
|
|
}}]
|
|
- parameter profileId: (path) Profile Id.
|
|
|
|
- returns: RequestBuilder<DeviceProfile>
|
|
*/
|
|
open class func getProfileWithRequestBuilder(profileId: String) -> RequestBuilder<DeviceProfile> {
|
|
var path = "/Dlna/Profiles/{profileId}"
|
|
let profileIdPreEscape = "\(profileId)"
|
|
let profileIdPostEscape = profileIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{profileId}", with: profileIdPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<DeviceProfile>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Get profile infos.
|
|
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getProfileInfos(completion: @escaping ((_ data: [DeviceProfileInfo]?,_ error: Error?) -> Void)) {
|
|
getProfileInfosWithRequestBuilder().execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Get profile infos.
|
|
- GET /Dlna/ProfileInfos
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example=[ {
|
|
"Type" : "",
|
|
"Id" : "Id",
|
|
"Name" : "Name"
|
|
}, {
|
|
"Type" : "",
|
|
"Id" : "Id",
|
|
"Name" : "Name"
|
|
} ]}]
|
|
|
|
- returns: RequestBuilder<[DeviceProfileInfo]>
|
|
*/
|
|
open class func getProfileInfosWithRequestBuilder() -> RequestBuilder<[DeviceProfileInfo]> {
|
|
let path = "/Dlna/ProfileInfos"
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
let url = URLComponents(string: URLString)
|
|
|
|
|
|
let requestBuilder: RequestBuilder<[DeviceProfileInfo]>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Updates a profile.
|
|
|
|
- parameter profileId: (path) Profile id.
|
|
- parameter body: (body) Device profile. (optional)
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func updateProfile(profileId: String, body: ProfilesProfileIdBody? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
updateProfileWithRequestBuilder(profileId: profileId, body: body).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Updates a profile.
|
|
- POST /Dlna/Profiles/{profileId}
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter profileId: (path) Profile id.
|
|
- parameter body: (body) Device profile. (optional)
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func updateProfileWithRequestBuilder(profileId: String, body: ProfilesProfileIdBody? = nil) -> RequestBuilder<Void> {
|
|
var path = "/Dlna/Profiles/{profileId}"
|
|
let profileIdPreEscape = "\(profileId)"
|
|
let profileIdPostEscape = profileIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{profileId}", with: profileIdPostEscape, options: .literal, range: nil)
|
|
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)
|
|
}
|
|
}
|