132 lines
5.4 KiB
Swift
132 lines
5.4 KiB
Swift
//
|
|
// DisplayPreferencesAPI.swift
|
|
//
|
|
// Generated by swagger-codegen
|
|
// https://github.com/swagger-api/swagger-codegen
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
|
|
|
|
open class DisplayPreferencesAPI {
|
|
/**
|
|
Get Display Preferences.
|
|
|
|
- parameter displayPreferencesId: (path) Display preferences id.
|
|
- parameter userId: (query) User id.
|
|
- parameter client: (query) Client.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func getDisplayPreferences(displayPreferencesId: String, userId: UUID, client: String, completion: @escaping ((_ data: DisplayPreferencesDto?,_ error: Error?) -> Void)) {
|
|
getDisplayPreferencesWithRequestBuilder(displayPreferencesId: displayPreferencesId, userId: userId, client: client).execute { (response, error) -> Void in
|
|
completion(response?.body, error)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Get Display Preferences.
|
|
- GET /DisplayPreferences/{displayPreferencesId}
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- examples: [{contentType=application/json, example={
|
|
"RememberSorting" : true,
|
|
"RememberIndexing" : true,
|
|
"PrimaryImageWidth" : 6,
|
|
"ScrollDirection" : "",
|
|
"IndexBy" : "IndexBy",
|
|
"SortBy" : "SortBy",
|
|
"ShowBackdrop" : true,
|
|
"SortOrder" : "",
|
|
"ShowSidebar" : true,
|
|
"PrimaryImageHeight" : 0,
|
|
"Id" : "Id",
|
|
"Client" : "Client",
|
|
"CustomPrefs" : {
|
|
"key" : "CustomPrefs"
|
|
},
|
|
"ViewType" : "ViewType"
|
|
}}]
|
|
- parameter displayPreferencesId: (path) Display preferences id.
|
|
- parameter userId: (query) User id.
|
|
- parameter client: (query) Client.
|
|
|
|
- returns: RequestBuilder<DisplayPreferencesDto>
|
|
*/
|
|
open class func getDisplayPreferencesWithRequestBuilder(displayPreferencesId: String, userId: UUID, client: String) -> RequestBuilder<DisplayPreferencesDto> {
|
|
var path = "/DisplayPreferences/{displayPreferencesId}"
|
|
let displayPreferencesIdPreEscape = "\(displayPreferencesId)"
|
|
let displayPreferencesIdPostEscape = displayPreferencesIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{displayPreferencesId}", with: displayPreferencesIdPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters: [String:Any]? = nil
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"userId": userId,
|
|
"client": client
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<DisplayPreferencesDto>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
|
|
|
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
|
}
|
|
/**
|
|
Update Display Preferences.
|
|
|
|
- parameter body: (body) New Display Preferences object.
|
|
- parameter userId: (query) User Id.
|
|
- parameter client: (query) Client.
|
|
- parameter displayPreferencesId: (path) Display preferences id.
|
|
- parameter completion: completion handler to receive the data and the error objects
|
|
*/
|
|
open class func updateDisplayPreferences(body: DisplayPreferencesDisplayPreferencesIdBody, userId: UUID, client: String, displayPreferencesId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
|
|
updateDisplayPreferencesWithRequestBuilder(body: body, userId: userId, client: client, displayPreferencesId: displayPreferencesId).execute { (response, error) -> Void in
|
|
if error == nil {
|
|
completion((), error)
|
|
} else {
|
|
completion(nil, error)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Update Display Preferences.
|
|
- POST /DisplayPreferences/{displayPreferencesId}
|
|
-
|
|
|
|
- API Key:
|
|
- type: apiKey X-Emby-Authorization
|
|
- name: CustomAuthentication
|
|
- parameter body: (body) New Display Preferences object.
|
|
- parameter userId: (query) User Id.
|
|
- parameter client: (query) Client.
|
|
- parameter displayPreferencesId: (path) Display preferences id.
|
|
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func updateDisplayPreferencesWithRequestBuilder(body: DisplayPreferencesDisplayPreferencesIdBody, userId: UUID, client: String, displayPreferencesId: String) -> RequestBuilder<Void> {
|
|
var path = "/DisplayPreferences/{displayPreferencesId}"
|
|
let displayPreferencesIdPreEscape = "\(displayPreferencesId)"
|
|
let displayPreferencesIdPostEscape = displayPreferencesIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
path = path.replacingOccurrences(of: "{displayPreferencesId}", with: displayPreferencesIdPostEscape, options: .literal, range: nil)
|
|
let URLString = SwaggerClientAPI.basePath + path
|
|
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
|
var url = URLComponents(string: URLString)
|
|
url?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"userId": userId,
|
|
"client": client
|
|
])
|
|
|
|
|
|
let requestBuilder: RequestBuilder<Void>.Type = SwaggerClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
|
}
|
|
}
|