jellyfin-sdk-swift/docs/CollectionAPI.md

166 lines
5.4 KiB
Markdown
Raw Normal View History

2021-06-02 21:05:58 +00:00
# CollectionAPI
2021-06-03 02:08:05 +00:00
All URIs are relative to *http://localhost:8096*
2021-06-02 21:05:58 +00:00
Method | HTTP request | Description
------------- | ------------- | -------------
[**addToCollection**](CollectionAPI.md#addtocollection) | **POST** /Collections/{collectionId}/Items | Adds items to a collection.
[**createCollection**](CollectionAPI.md#createcollection) | **POST** /Collections | Creates a new collection.
[**removeFromCollection**](CollectionAPI.md#removefromcollection) | **DELETE** /Collections/{collectionId}/Items | Removes items from a collection.
# **addToCollection**
```swift
open class func addToCollection(collectionId: String, ids: [String], completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
2021-06-02 21:05:58 +00:00
```
Adds items to a collection.
### Example
```swift
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import JellyfinAPI
2021-06-02 21:05:58 +00:00
let collectionId = "collectionId_example" // String | The collection id.
let ids = ["inner_example"] // [String] | Item ids, comma delimited.
2021-06-02 21:05:58 +00:00
// Adds items to a collection.
CollectionAPI.addToCollection(collectionId: collectionId, ids: ids) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**collectionId** | [**String**](.md) | The collection id. |
**ids** | [**[String]**](String.md) | Item ids, comma delimited. |
2021-06-02 21:05:58 +00:00
### Return type
Void (empty response body)
### Authorization
[CustomAuthentication](../README.md#CustomAuthentication)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **createCollection**
```swift
open class func createCollection(name: String? = nil, ids: [String]? = nil, parentId: String? = nil, isLocked: Bool? = nil, completion: @escaping (_ data: CollectionCreationResult?, _ error: Error?) -> Void)
2021-06-02 21:05:58 +00:00
```
Creates a new collection.
### Example
```swift
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import JellyfinAPI
2021-06-02 21:05:58 +00:00
let name = "name_example" // String | The name of the collection. (optional)
let ids = ["inner_example"] // [String] | Item Ids to add to the collection. (optional)
let parentId = "parentId_example" // String | Optional. Create the collection within a specific folder. (optional)
2021-06-02 21:05:58 +00:00
let isLocked = true // Bool | Whether or not to lock the new collection. (optional) (default to false)
// Creates a new collection.
CollectionAPI.createCollection(name: name, ids: ids, parentId: parentId, isLocked: isLocked) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **String** | The name of the collection. | [optional]
**ids** | [**[String]**](String.md) | Item Ids to add to the collection. | [optional]
**parentId** | [**String**](.md) | Optional. Create the collection within a specific folder. | [optional]
2021-06-02 21:05:58 +00:00
**isLocked** | **Bool** | Whether or not to lock the new collection. | [optional] [default to false]
### Return type
[**CollectionCreationResult**](CollectionCreationResult.md)
### Authorization
[CustomAuthentication](../README.md#CustomAuthentication)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/json; profile=CamelCase, application/json; profile=PascalCase
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **removeFromCollection**
```swift
open class func removeFromCollection(collectionId: String, ids: [String], completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
2021-06-02 21:05:58 +00:00
```
Removes items from a collection.
### Example
```swift
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import JellyfinAPI
2021-06-02 21:05:58 +00:00
let collectionId = "collectionId_example" // String | The collection id.
let ids = ["inner_example"] // [String] | Item ids, comma delimited.
2021-06-02 21:05:58 +00:00
// Removes items from a collection.
CollectionAPI.removeFromCollection(collectionId: collectionId, ids: ids) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**collectionId** | [**String**](.md) | The collection id. |
**ids** | [**[String]**](String.md) | Item ids, comma delimited. |
2021-06-02 21:05:58 +00:00
### Return type
Void (empty response body)
### Authorization
[CustomAuthentication](../README.md#CustomAuthentication)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)