jellyflood/JellyfinPlayer/Swaggers/APIs/SearchAPI.swift

168 lines
9.6 KiB
Swift

//
// SearchAPI.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
import Alamofire
open class SearchAPI {
/**
Gets the search hint result.
- parameter searchTerm: (query) The search term to filter on.
- parameter startIndex: (query) Optional. The record index to start at. All items with a lower index will be dropped from the results. (optional)
- parameter limit: (query) Optional. The maximum number of records to return. (optional)
- parameter userId: (query) Optional. Supply a user id to search within a user's library or omit to search all. (optional)
- parameter includeItemTypes: (query) If specified, only results with the specified item types are returned. This allows multiple, comma delimeted. (optional)
- parameter excludeItemTypes: (query) If specified, results with these item types are filtered out. This allows multiple, comma delimeted. (optional)
- parameter mediaTypes: (query) If specified, only results with the specified media types are returned. This allows multiple, comma delimeted. (optional)
- parameter parentId: (query) If specified, only children of the parent are returned. (optional)
- parameter isMovie: (query) Optional filter for movies. (optional)
- parameter isSeries: (query) Optional filter for series. (optional)
- parameter isNews: (query) Optional filter for news. (optional)
- parameter isKids: (query) Optional filter for kids. (optional)
- parameter isSports: (query) Optional filter for sports. (optional)
- parameter includePeople: (query) Optional filter whether to include people. (optional, default to true)
- parameter includeMedia: (query) Optional filter whether to include media. (optional, default to true)
- parameter includeGenres: (query) Optional filter whether to include genres. (optional, default to true)
- parameter includeStudios: (query) Optional filter whether to include studios. (optional, default to true)
- parameter includeArtists: (query) Optional filter whether to include artists. (optional, default to true)
- parameter completion: completion handler to receive the data and the error objects
*/
open class func callGet(searchTerm: String, startIndex: Int? = nil, limit: Int? = nil, userId: UUID? = nil, includeItemTypes: [String]? = nil, excludeItemTypes: [String]? = nil, mediaTypes: [String]? = nil, parentId: UUID? = nil, isMovie: Bool? = nil, isSeries: Bool? = nil, isNews: Bool? = nil, isKids: Bool? = nil, isSports: Bool? = nil, includePeople: Bool? = nil, includeMedia: Bool? = nil, includeGenres: Bool? = nil, includeStudios: Bool? = nil, includeArtists: Bool? = nil, completion: @escaping ((_ data: SearchHintResult?,_ error: Error?) -> Void)) {
callGetWithRequestBuilder(searchTerm: searchTerm, startIndex: startIndex, limit: limit, userId: userId, includeItemTypes: includeItemTypes, excludeItemTypes: excludeItemTypes, mediaTypes: mediaTypes, parentId: parentId, isMovie: isMovie, isSeries: isSeries, isNews: isNews, isKids: isKids, isSports: isSports, includePeople: includePeople, includeMedia: includeMedia, includeGenres: includeGenres, includeStudios: includeStudios, includeArtists: includeArtists).execute { (response, error) -> Void in
completion(response?.body, error)
}
}
/**
Gets the search hint result.
- GET /Search/Hints
-
- API Key:
- type: apiKey X-Emby-Authorization
- name: CustomAuthentication
- examples: [{contentType=application/json, example={
"TotalRecordCount" : 9,
"SearchHints" : [ {
"RunTimeTicks" : 5,
"PrimaryImageTag" : "PrimaryImageTag",
"Album" : "Album",
"ParentIndexNumber" : 1,
"ChannelId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ItemId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"Name" : "Name",
"StartDate" : "2000-01-23T04:56:07.000+00:00",
"ThumbImageTag" : "ThumbImageTag",
"ProductionYear" : 6,
"AlbumId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ThumbImageItemId" : "ThumbImageItemId",
"MediaType" : "MediaType",
"IndexNumber" : 0,
"PrimaryImageAspectRatio" : 7.061401241503109,
"Status" : "Status",
"EpisodeCount" : 2,
"BackdropImageItemId" : "BackdropImageItemId",
"EndDate" : "2000-01-23T04:56:07.000+00:00",
"MatchedTerm" : "MatchedTerm",
"AlbumArtist" : "AlbumArtist",
"Series" : "Series",
"Type" : "Type",
"ChannelName" : "ChannelName",
"Id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"BackdropImageTag" : "BackdropImageTag",
"IsFolder" : true,
"Artists" : [ "Artists", "Artists" ],
"SongCount" : 5
}, {
"RunTimeTicks" : 5,
"PrimaryImageTag" : "PrimaryImageTag",
"Album" : "Album",
"ParentIndexNumber" : 1,
"ChannelId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ItemId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"Name" : "Name",
"StartDate" : "2000-01-23T04:56:07.000+00:00",
"ThumbImageTag" : "ThumbImageTag",
"ProductionYear" : 6,
"AlbumId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ThumbImageItemId" : "ThumbImageItemId",
"MediaType" : "MediaType",
"IndexNumber" : 0,
"PrimaryImageAspectRatio" : 7.061401241503109,
"Status" : "Status",
"EpisodeCount" : 2,
"BackdropImageItemId" : "BackdropImageItemId",
"EndDate" : "2000-01-23T04:56:07.000+00:00",
"MatchedTerm" : "MatchedTerm",
"AlbumArtist" : "AlbumArtist",
"Series" : "Series",
"Type" : "Type",
"ChannelName" : "ChannelName",
"Id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"BackdropImageTag" : "BackdropImageTag",
"IsFolder" : true,
"Artists" : [ "Artists", "Artists" ],
"SongCount" : 5
} ]
}}]
- parameter searchTerm: (query) The search term to filter on.
- parameter startIndex: (query) Optional. The record index to start at. All items with a lower index will be dropped from the results. (optional)
- parameter limit: (query) Optional. The maximum number of records to return. (optional)
- parameter userId: (query) Optional. Supply a user id to search within a user's library or omit to search all. (optional)
- parameter includeItemTypes: (query) If specified, only results with the specified item types are returned. This allows multiple, comma delimeted. (optional)
- parameter excludeItemTypes: (query) If specified, results with these item types are filtered out. This allows multiple, comma delimeted. (optional)
- parameter mediaTypes: (query) If specified, only results with the specified media types are returned. This allows multiple, comma delimeted. (optional)
- parameter parentId: (query) If specified, only children of the parent are returned. (optional)
- parameter isMovie: (query) Optional filter for movies. (optional)
- parameter isSeries: (query) Optional filter for series. (optional)
- parameter isNews: (query) Optional filter for news. (optional)
- parameter isKids: (query) Optional filter for kids. (optional)
- parameter isSports: (query) Optional filter for sports. (optional)
- parameter includePeople: (query) Optional filter whether to include people. (optional, default to true)
- parameter includeMedia: (query) Optional filter whether to include media. (optional, default to true)
- parameter includeGenres: (query) Optional filter whether to include genres. (optional, default to true)
- parameter includeStudios: (query) Optional filter whether to include studios. (optional, default to true)
- parameter includeArtists: (query) Optional filter whether to include artists. (optional, default to true)
- returns: RequestBuilder<SearchHintResult>
*/
open class func callGetWithRequestBuilder(searchTerm: String, startIndex: Int? = nil, limit: Int? = nil, userId: UUID? = nil, includeItemTypes: [String]? = nil, excludeItemTypes: [String]? = nil, mediaTypes: [String]? = nil, parentId: UUID? = nil, isMovie: Bool? = nil, isSeries: Bool? = nil, isNews: Bool? = nil, isKids: Bool? = nil, isSports: Bool? = nil, includePeople: Bool? = nil, includeMedia: Bool? = nil, includeGenres: Bool? = nil, includeStudios: Bool? = nil, includeArtists: Bool? = nil) -> RequestBuilder<SearchHintResult> {
let path = "/Search/Hints"
let URLString = SwaggerClientAPI.basePath + path
let parameters: [String:Any]? = nil
var url = URLComponents(string: URLString)
url?.queryItems = APIHelper.mapValuesToQueryItems([
"startIndex": startIndex?.encodeToJSON(),
"limit": limit?.encodeToJSON(),
"userId": userId,
"searchTerm": searchTerm,
"includeItemTypes": includeItemTypes,
"excludeItemTypes": excludeItemTypes,
"mediaTypes": mediaTypes,
"parentId": parentId,
"isMovie": isMovie,
"isSeries": isSeries,
"isNews": isNews,
"isKids": isKids,
"isSports": isSports,
"includePeople": includePeople,
"includeMedia": includeMedia,
"includeGenres": includeGenres,
"includeStudios": includeStudios,
"includeArtists": includeArtists
])
let requestBuilder: RequestBuilder<SearchHintResult>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}
}