### Setup method signature Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/setup%28groupidentifier%3Adelegate%3Amemorycapacity%3Adiskcapacity%3Aremoveallcachedresponses%3A%29 Defines the configuration parameters for initializing NextcloudKit. ```swift func setup( groupIdentifier: String? = nil, delegate: NextcloudKitDelegate? = nil, memoryCapacity: Int = 30, diskCapacity: Int = 500, removeAllCachedResponses: Bool = false ) ``` -------------------------------- ### setup(groupIdentifier:delegate:memoryCapacity:diskCapacity:removeAllCachedResponses:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/setup%28groupidentifier%3Adelegate%3Amemorycapacity%3Adiskcapacity%3Aremoveallcachedresponses%3A%29 Initializes the NextcloudKit environment with specified cache capacities and delegate. ```APIDOC ## setup(groupIdentifier:delegate:memoryCapacity:diskCapacity:removeAllCachedResponses:) ### Description Initializes the NextcloudKit instance. This method allows for configuring the group identifier, setting a delegate, defining memory and disk cache capacities, and optionally clearing existing cached responses. ### Signature `func setup(groupIdentifier: String? = nil, delegate: NextcloudKitDelegate? = nil, memoryCapacity: Int = 30, diskCapacity: Int = 500, removeAllCachedResponses: Bool = false)` ### Parameters - **groupIdentifier** (String?) - Optional - The identifier for the app group. - **delegate** (NextcloudKitDelegate?) - Optional - The delegate object for handling events. - **memoryCapacity** (Int) - Optional - The memory cache capacity in MB (default: 30). - **diskCapacity** (Int) - Optional - The disk cache capacity in MB (default: 500). - **removeAllCachedResponses** (Bool) - Optional - Whether to clear all cached responses upon setup (default: false). ``` -------------------------------- ### NKBackground.downloadAsync Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkbackground Asynchronously starts a download task for a file. ```APIDOC ## func downloadAsync(serverUrlFileName: Any, fileNameLocalPath: String, taskDescription: String?, account: String, automaticResume: Bool, sessionIdentifier: String) async -> (downloadTask: URLSessionDownloadTask?, error: NKError) ### Description Asynchronously starts a download task for a file from the server to a local path. ### Parameters - **serverUrlFileName** (Any) - The server URL or file name. - **fileNameLocalPath** (String) - The local path where the file will be saved. - **taskDescription** (String?) - Optional description for the task. - **account** (String) - The account identifier. - **automaticResume** (Bool) - Whether to automatically resume the download. - **sessionIdentifier** (String) - The session identifier for the background task. ### Returns - **(downloadTask: URLSessionDownloadTask?, error: NKError)** - A tuple containing the download task and any potential error. ``` -------------------------------- ### NKBackground.download Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkbackground Starts a download task for a file from the server to a local path. ```APIDOC ## func download(serverUrlFileName: Any, fileNameLocalPath: String, taskDescription: String?, account: String, automaticResume: Bool, sessionIdentifier: String) -> (URLSessionDownloadTask?, error: NKError) ### Description Starts a download task for a file from the server to a local path. ### Parameters - **serverUrlFileName** (Any) - The server URL or file name. - **fileNameLocalPath** (String) - The local path where the file will be saved. - **taskDescription** (String?) - Optional description for the task. - **account** (String) - The account identifier. - **automaticResume** (Bool) - Whether to automatically resume the download. - **sessionIdentifier** (String) - The session identifier for the background task. ### Returns - **(URLSessionDownloadTask?, error: NKError)** - A tuple containing the download task and any potential error. ``` -------------------------------- ### Initiate Login Flow V2 Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/getloginflowv2%28serverurl%3Aoptions%3Ataskhandler%3A%29 Use this method to start the login process and retrieve the required URLs and token for user authentication. ```swift func getLoginFlowV2( serverUrl: String, options: NKRequestOptions = NKRequestOptions(), taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in } ) async throws -> (endpoint: URL, login: URL, token: String) ``` -------------------------------- ### NKBackground.upload Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkbackground Starts an upload task to send a local file to the server. ```APIDOC ## func upload(serverUrlFileName: Any, fileNameLocalPath: String, dateCreationFile: Date?, dateModificationFile: Date?, taskDescription: String?, overwrite: Bool, autoMkcol: Bool, account: String, automaticResume: Bool, sessionIdentifier: String) -> (URLSessionUploadTask?, error: NKError) ### Description Starts an upload task to send a local file to the server. ### Parameters - **serverUrlFileName** (Any) - The destination server URL or file name. - **fileNameLocalPath** (String) - The local path of the file to upload. - **dateCreationFile** (Date?) - Optional creation date. - **dateModificationFile** (Date?) - Optional modification date. - **taskDescription** (String?) - Optional description for the task. - **overwrite** (Bool) - Whether to overwrite existing files. - **autoMkcol** (Bool) - Whether to automatically create collections. - **account** (String) - The account identifier. - **automaticResume** (Bool) - Whether to automatically resume the upload. - **sessionIdentifier** (String) - The session identifier for the background task. ### Returns - **(URLSessionUploadTask?, error: NKError)** - A tuple containing the upload task and any potential error. ``` -------------------------------- ### NKLogTagEmoji start case Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nklogtagemoji/start Represents the start case for the NKLogTagEmoji logging tag. ```text case start ``` -------------------------------- ### NKBackground.uploadAsync Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkbackground Asynchronously starts an upload task to send a local file. ```APIDOC ## func uploadAsync(serverUrlFileName: Any, fileNameLocalPath: String, dateCreationFile: Date?, dateModificationFile: Date?, taskDescription: String?, overwrite: Bool, autoMkcol: Bool, account: String, automaticResume: Bool, sessionIdentifier: String) async -> (uploadTask: URLSessionUploadTask?, error: NKError) ### Description Asynchronously starts an upload task to send a local file to the server. ### Parameters - **serverUrlFileName** (Any) - The destination server URL or file name. - **fileNameLocalPath** (String) - The local path of the file to upload. - **dateCreationFile** (Date?) - Optional creation date. - **dateModificationFile** (Date?) - Optional modification date. - **taskDescription** (String?) - Optional description for the task. - **overwrite** (Bool) - Whether to overwrite existing files. - **autoMkcol** (Bool) - Whether to automatically create collections. - **account** (String) - The account identifier. - **automaticResume** (Bool) - Whether to automatically resume the upload. - **sessionIdentifier** (String) - The session identifier for the background task. ### Returns - **(uploadTask: URLSessionUploadTask?, error: NKError)** - A tuple containing the upload task and any potential error. ``` -------------------------------- ### download(serverUrlFileName:fileNameLocalPath:taskDescription:account:automaticResume:sessionIdentifier:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkbackground/download%28serverurlfilename%3Afilenamelocalpath%3Ataskdescription%3Aaccount%3Aautomaticresume%3Asessionidentifier%3A%29 Starts a download task for a file from the server to a local path. ```APIDOC ## download(serverUrlFileName:fileNameLocalPath:taskDescription:account:automaticResume:sessionIdentifier:) ### Description Starts a download task for a file from the server to a local path. ### Signature ```swift func download( serverUrlFileName: Any, fileNameLocalPath: String, taskDescription: String? = nil, account: String, automaticResume: Bool = true, sessionIdentifier: String ) -> (URLSessionDownloadTask?, error: NKError) ``` ### Parameters - **serverUrlFileName** (Any) - The URL or URL string of the file to download. - **fileNameLocalPath** (String) - The local file path where the downloaded file will be saved. - **taskDescription** (String?) - Optional description to set on the URLSession task. - **account** (String) - The Nextcloud account associated with the download. - **automaticResume** (Bool) - Whether to automatically resume the download. - **sessionIdentifier** (String) - The session identifier for the download task. ### Return Value A tuple containing: - **URLSessionDownloadTask?** - The download task if created successfully. - **error** (NKError) - An NKError indicating success or failure in starting the download. ``` -------------------------------- ### downloadAsync(serverUrlFileName:fileNameLocalPath:taskDescription:account:automaticResume:sessionIdentifier:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkbackground/downloadasync%28serverurlfilename%3Afilenamelocalpath%3Ataskdescription%3Aaccount%3Aautomaticresume%3Asessionidentifier%3A%29 Asynchronously starts a download task for a file. ```APIDOC ## downloadAsync(serverUrlFileName:fileNameLocalPath:taskDescription:account:automaticResume:sessionIdentifier:) ### Description Asynchronously starts a download task for a file. ### Signature ```swift func downloadAsync( serverUrlFileName: Any, fileNameLocalPath: String, taskDescription: String? = nil, account: String, automaticResume: Bool = true, sessionIdentifier: String ) async -> (downloadTask: URLSessionDownloadTask?, error: NKError) ``` ### Parameters - **serverUrlFileName** (Any) - The server URL or file name. - **fileNameLocalPath** (String) - The local path where the file will be saved. - **taskDescription** (String?) - Optional description for the task. - **account** (String) - The account identifier. - **automaticResume** (Bool) - Whether to automatically resume the download. - **sessionIdentifier** (String) - The session identifier for the background task. ### Return Value A tuple containing: - **downloadTask** (URLSessionDownloadTask?) - The download task if successfully created. - **error** (NKError) - The error result. ``` -------------------------------- ### nkLog(start:minimumLogLevel:consoleOnly:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nklog%28start%3Aminimumloglevel%3Aconsoleonly%3A%29 Logs a message with specified log level and console output settings. ```APIDOC ## nkLog(start:minimumLogLevel:consoleOnly:) ### Description Logs a message to the system. This function allows developers to specify the log level and whether the output should be restricted to the console. ### Signature `func nkLog(start message: String, minimumLogLevel: NKLogLevel = .compact, consoleOnly: Bool = false)` ### Parameters - **start** (String) - The message to be logged. - **minimumLogLevel** (NKLogLevel) - Optional. The minimum log level required for this message to be processed. Defaults to .compact. - **consoleOnly** (Bool) - Optional. If true, the log will only be sent to the console. Defaults to false. ``` -------------------------------- ### getLoginFlowV2(serverUrl:options:taskHandler:completion:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/getloginflowv2%28serverurl%3Aoptions%3Ataskhandler%3Acompletion%3A%29 Starts the Login Flow v2 process by requesting a login token and associated parameters from the server. ```APIDOC ## getLoginFlowV2(serverUrl:options:taskHandler:completion:) ### Description Starts the Login Flow v2 process by requesting a login token and associated parameters from the server. ### Signature ```swift func getLoginFlowV2( serverUrl: String, options: NKRequestOptions = NKRequestOptions(), taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }, completion: @escaping (_ token: String?, _ endpoint: String?, _ login: String?, _ responseData: AFDataResponse?, _ error: NKError) -> Void ) ``` ### Parameters - **serverUrl** (String) - The base URL of the Nextcloud server used to initiate the login flow. - **options** (NKRequestOptions) - An optional object containing configuration such as API version, custom headers, and execution queue. - **taskHandler** (Closure) - A closure that provides the URLSessionTask used for the request, useful for monitoring or cancellation. - **completion** (Closure) - A completion handler returning the login token, endpoint, login URL, response data, and any potential error. ``` -------------------------------- ### upload(serverUrlFileName:fileNameLocalPath:dateCreationFile:dateModificationFile:taskDescription:overwrite:autoMkcol:account:automaticResume:sessionIdentifier:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkbackground/upload%28serverurlfilename%3Afilenamelocalpath%3Adatecreationfile%3Adatemodificationfile%3Ataskdescription%3Aoverwrite%3Aautomkcol%3Aaccount%3Aautomaticresume%3Asessionidentifier%3A%29 Starts an upload task to send a local file to the server. ```APIDOC ## Method Signature `func upload(serverUrlFileName: Any, fileNameLocalPath: String, dateCreationFile: Date?, dateModificationFile: Date?, taskDescription: String? = nil, overwrite: Bool = false, autoMkcol: Bool = false, account: String, automaticResume: Bool = true, sessionIdentifier: String) -> (URLSessionUploadTask?, error: NKError)` ### Description Starts an upload task to send a local file to the server. ### Parameters - **serverUrlFileName** (Any) - The server URL or URL string where the file will be uploaded. - **fileNameLocalPath** (String) - The local file path of the file to upload. - **dateCreationFile** (Date?) - Optional creation date metadata for the file. - **dateModificationFile** (Date?) - Optional modification date metadata for the file. - **taskDescription** (String?) - Optional description to set on the URLSession task. - **overwrite** (Bool) - Boolean indicating whether to overwrite existing files on the server. - **autoMkcol** (Bool) - When set to 1, instructs the server to automatically create any missing parent directories when uploading a file. - **account** (String) - The Nextcloud account associated with the upload. - **automaticResume** (Bool) - Flag for automatic resume functionality. - **sessionIdentifier** (String) - A string identifier for the upload session. ### Return Value A tuple containing: - **URLSessionUploadTask?** - The upload task if created successfully. - **error** (NKError) - An NKError indicating success or failure in starting the upload. ``` -------------------------------- ### uploadAsync(serverUrlFileName:fileNameLocalPath:dateCreationFile:dateModificationFile:taskDescription:overwrite:autoMkcol:account:automaticResume:sessionIdentifier:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkbackground/uploadasync%28serverurlfilename%3Afilenamelocalpath%3Adatecreationfile%3Adatemodificationfile%3Ataskdescription%3Aoverwrite%3Aautomkcol%3Aaccount%3Aautomaticresume%3Asessionidentifier%3A%29 Asynchronously starts an upload task to send a local file. ```APIDOC ## uploadAsync(serverUrlFileName:fileNameLocalPath:dateCreationFile:dateModificationFile:taskDescription:overwrite:autoMkcol:account:automaticResume:sessionIdentifier:) ### Description Asynchronously starts an upload task to send a local file. ### Signature ```swift func uploadAsync( serverUrlFileName: Any, fileNameLocalPath: String, dateCreationFile: Date?, dateModificationFile: Date?, taskDescription: String? = nil, overwrite: Bool = false, autoMkcol: Bool = false, account: String, automaticResume: Bool = true, sessionIdentifier: String ) async -> (uploadTask: URLSessionUploadTask?, error: NKError) ``` ### Return Value A tuple containing: - **uploadTask** (URLSessionUploadTask?) - The upload task if successfully created. - **error** (NKError) - The result error. ``` -------------------------------- ### writeLog(start:minimumLogLevel:consoleOnly:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nklogfilemanager/writelog%28start%3Aminimumloglevel%3Aconsoleonly%3A%29 Writes a log message to the file manager with configurable log levels and console output settings. ```APIDOC ## writeLog(start:minimumLogLevel:consoleOnly:) ### Description Writes a log message to the log file manager. This method allows specifying the log message, the minimum log level required for the entry, and whether the log should be restricted to the console only. ### Signature `func writeLog(start message: String, minimumLogLevel: NKLogLevel = .compact, consoleOnly: Bool = false)` ### Parameters - **start** (String) - Required - The log message to be written. - **minimumLogLevel** (NKLogLevel) - Optional - The minimum log level for this entry. Defaults to `.compact`. - **consoleOnly** (Bool) - Optional - If true, the log is output only to the console. Defaults to `false`. ``` -------------------------------- ### init(ocId:contentType:typeIdentifier:date:directory:fileId:fileName:filePath:hasPreview:iconName:size:classFile:livePhoto:trashbinFileName:trashbinOriginalLocation:trashbinDeletionTime:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nktrash/init%28ocid%3Acontenttype%3Atypeidentifier%3Adate%3Adirectory%3Afileid%3Afilename%3Afilepath%3Ahaspreview%3Aiconname%3Asize%3Aclassfile%3Alivephoto%3Atrashbinfilename%3Atrashbinoriginallocation%3Atrashbindeletiontime%3A%29 Initializes a new instance of NKTrash with the provided file and trashbin metadata. ```APIDOC ## init(ocId:contentType:typeIdentifier:date:directory:fileId:fileName:filePath:hasPreview:iconName:size:classFile:livePhoto:trashbinFileName:trashbinOriginalLocation:trashbinDeletionTime:) ### Description Initializes a new NKTrash object with specified file attributes and trashbin-specific information. ### Signature ```swift init( ocId: String = "", contentType: String = "", typeIdentifier: String = "", date: Date = Date(), directory: Bool = false, fileId: String = "", fileName: String = "", filePath: String = "", hasPreview: Bool = false, iconName: String = "", size: Int64 = 0, classFile: String = "", livePhoto: Bool = false, trashbinFileName: String = "", trashbinOriginalLocation: String = "", trashbinDeletionTime: Date = Date() ) ``` ``` -------------------------------- ### init(output:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/taskoutput/init%28output%3A%29 Initializes a new TaskOutput instance with an optional output string. ```APIDOC ## init(output:) ### Description Initializes a new instance of TaskOutput. This method accepts an optional string parameter to set the initial output state. ### Signature `init(output: String? = nil)` ### Parameters - **output** (String?) - Optional - The initial output string to be associated with the task. Defaults to nil. ``` -------------------------------- ### init(id:name:order:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nksearchprovider/init%28id%3Aname%3Aorder%3A%29 Initializes a new NKSearchProvider instance with the provided identifier, name, and order. ```APIDOC ## init(id:name:order:) ### Description Initializes a new instance of the NKSearchProvider class. ### Signature `init(id: String, name: String, order: Int)` ### Parameters - **id** (String) - The unique identifier for the search provider. - **name** (String) - The display name of the search provider. - **order** (Int) - The display order index for the search provider. ``` -------------------------------- ### init(nkCommonInstance: NKCommon) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkdatafilexml Initializes a new instance of NKDataFileXML with a provided NKCommon instance. ```APIDOC ### init(nkCommonInstance: NKCommon) Initializes the NKDataFileXML object with the necessary common configuration. #### Parameters - **nkCommonInstance** (NKCommon) - Required - The common configuration instance used by the class. ``` -------------------------------- ### Get Last Modified Case Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkproperties/getlastmodified Represents the getlastmodified case identifier. ```text case getlastmodified ``` -------------------------------- ### init(sensitivity:retention:hold:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkgovernanceavailablelabels/init%28sensitivity%3Aretention%3Ahold%3A%29 Initializes a new instance of NKGovernanceAvailableLabels with the provided governance labels. ```APIDOC ## init(sensitivity:retention:hold:) ### Description Initializes a new instance of NKGovernanceAvailableLabels with specified sensitivity, retention, and hold labels. ### Signature ```swift init( sensitivity: [NKGovernanceLabel], retention: [NKGovernanceLabel], hold: [NKGovernanceLabel] ) ``` ### Parameters - **sensitivity** ([NKGovernanceLabel]) - Required - An array of sensitivity labels. - **retention** ([NKGovernanceLabel]) - Required - An array of retention labels. - **hold** ([NKGovernanceLabel]) - Required - An array of hold labels. ``` -------------------------------- ### init(tasks:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/tasklist/init%28tasks%3A%29 Initializes a new TaskList instance with a provided array of tasks. ```APIDOC ## init(tasks:) ### Description Initializes a new TaskList instance with a provided array of AssistantTask objects. ### Signature `init(tasks: [AssistantTask])` ### Parameters - **tasks** ([AssistantTask]) - Required - An array of AssistantTask objects to initialize the list with. ``` -------------------------------- ### Get session count in Swift Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/synchronizednksessionarray/count Access the count property to retrieve the number of sessions currently stored. ```swift var count: Int { get } ``` -------------------------------- ### init(endpoint:version:customHeader:customUserAgent:contentType:e2eToken:timeout:taskDescription:createProperties:removeProperties:checkInterceptor:paginate:paginateToken:paginateOffset:paginateCount:queue:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkrequestoptions/init%28endpoint%3Aversion%3Acustomheader%3Acustomuseragent%3Acontenttype%3Ae2etoken%3Atimeout%3Ataskdescription%3Acreateproperties%3Aremoveproperties%3Acheckinterceptor%3Apaginate%3Apaginatetoken%3Apaginateoffset%3Apaginatecount%3Aqueue%3A%29 Initializes a new instance of NKRequestOptions with the specified configuration parameters. ```APIDOC ## init(endpoint:version:customHeader:customUserAgent:contentType:e2eToken:timeout:taskDescription:createProperties:removeProperties:checkInterceptor:paginate:paginateToken:paginateOffset:paginateCount:queue:) ### Description Initializes an NKRequestOptions object to configure network requests within NextcloudKit. ### Signature ```swift init( endpoint: String? = nil, version: String? = nil, customHeader: [String : String]? = nil, customUserAgent: String? = nil, contentType: String? = nil, e2eToken: String? = nil, timeout: TimeInterval = 60, taskDescription: String? = nil, createProperties: [NKProperties]? = nil, removeProperties: [NKProperties] = [], checkInterceptor: Bool = true, paginate: Bool = false, paginateToken: String? = nil, paginateOffset: Int? = nil, paginateCount: Int? = nil, queue: DispatchQueue = .main ) ``` ``` -------------------------------- ### init(capabilities:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/fileautorenamer Initializes a new instance of FileAutoRenamer with the specified capabilities. ```APIDOC ### init(capabilities:) Initializes a new instance of the FileAutoRenamer class. #### Parameters - **capabilities** (NKCapabilities.Capabilities) - Required - The capabilities configuration for the renamer. ``` -------------------------------- ### init(id:name:priority:description:color:isAssigned:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkgovernancelabel/init%28id%3Aname%3Apriority%3Adescription%3Acolor%3Aisassigned%3A%29 Initializes a new NKGovernanceLabel object with the provided parameters. ```APIDOC ## init(id:name:priority:description:color:isAssigned:) ### Description Initializes a new instance of NKGovernanceLabel with the specified properties. ### Signature ```swift init( id: String, name: String, priority: Int, description: String, color: String, isAssigned: Bool ) ``` ### Parameters - **id** (String) - The unique identifier for the label. - **name** (String) - The display name of the label. - **priority** (Int) - The priority level of the label. - **description** (String) - A description of the label. - **color** (String) - The color code associated with the label. - **isAssigned** (Bool) - A flag indicating if the label is currently assigned. ``` -------------------------------- ### init(input:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/taskinput/init%28input%3A%29 Initializes a new instance of TaskInput with an optional string input. ```APIDOC ## init(input:) ### Description Initializes a new TaskInput object. This method accepts an optional string parameter to set the initial input value. ### Signature `init(input: String? = nil)` ### Parameters - **input** (String?) - Optional - The initial input string for the TaskInput instance. Defaults to nil. ``` -------------------------------- ### init(owner:ownerEditor:ownerType:ownerDisplayName:time:timeOut:token:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nklock/init%28owner%3Aownereditor%3Aownertype%3Aownerdisplayname%3Atime%3Atimeout%3Atoken%3A%29 Initializes a new instance of NKLock with the provided raw values. ```APIDOC ## init(owner:ownerEditor:ownerType:ownerDisplayName:time:timeOut:token:) ### Description Initialize an NKLock object from raw values. ### Signature ```swift init( owner: String, ownerEditor: String, ownerType: NKLockType, ownerDisplayName: String, time: Date?, timeOut: Date?, token: String? ) ``` ### Parameters - **owner** (String) - The owner identifier. - **ownerEditor** (String) - The editor identifier. - **ownerType** (NKLockType) - The type of the lock. - **ownerDisplayName** (String) - The display name of the owner. - **time** (Date?) - Optional timestamp. - **timeOut** (Date?) - Optional timeout timestamp. - **token** (String?) - Optional token string. ``` -------------------------------- ### init(path: String?, reshares: Bool, subfiles: Bool, sharedWithMe: Bool) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkshareparameter Initializes a new NKShareParameter instance using a file path. ```APIDOC ## init(path: String?, reshares: Bool, subfiles: Bool, sharedWithMe: Bool) ### Description Initializes an NKShareParameter object using a file path and configuration flags. ### Parameters - **path** (String?) - The path to the file or folder. - **reshares** (Bool) - Flag indicating if reshares are included. - **subfiles** (Bool) - Flag indicating if subfiles are included. - **sharedWithMe** (Bool) - Flag indicating if the share is shared with the current user. ``` -------------------------------- ### init(ext:identifier:name:preview:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkeditortemplate/init%28ext%3Aidentifier%3Aname%3Apreview%3A%29 Initializes a new instance of NKEditorTemplate with optional parameters for extension, identifier, name, and preview. ```APIDOC ## init(ext:identifier:name:preview:) ### Description Initializes a new NKEditorTemplate object with the specified configuration values. ### Signature ```swift init( ext: String = "", identifier: String = "", name: String = "", preview: String = "" ) ``` ### Parameters - **ext** (String) - Optional - The extension associated with the template. - **identifier** (String) - Optional - The unique identifier for the template. - **name** (String) - Optional - The display name of the template. - **preview** (String) - Optional - The preview string or path for the template. ``` -------------------------------- ### init(rawValue:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nktypeiconfile/init%28rawvalue%3A%29 Initializes an NKTypeIconFile instance from a raw string value. ```APIDOC ## init(rawValue:) ### Description Initializes a new instance of NKTypeIconFile using a raw string value. This method is inherited from RawRepresentable. ### Signature `init?(rawValue: String)` ### Parameters - **rawValue** (String) - The raw string value used to initialize the icon file type. ``` -------------------------------- ### init(_:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/synchronizednksessionarray/init%28_%3A%29 Initializes a new synchronized array with optional initial content. ```APIDOC ## init(_:) ### Description Initializes a new synchronized array with optional initial content. ### Signature `init(_ initial: [NKSession] = [])` ### Parameters - **initial** ([NKSession]) - Optional - An initial array of `NKSession` to populate the container with. ``` -------------------------------- ### init(statusCode:fallbackDescription:responseData:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkerror/init%28statuscode%3Afallbackdescription%3Aresponsedata%3A%29 Initializes a new NKError instance using an HTTP status code, a fallback description, and optional response data. ```APIDOC ## init(statusCode:fallbackDescription:responseData:) ### Description Creates an `NKError` from an HTTP status code. ### Signature `init(statusCode: Int, fallbackDescription: String, responseData: Data? = nil)` ### Parameters - **statusCode** (Int) - The HTTP status code. - **fallbackDescription** (String) - A clean fallback description used when the status code is unknown. - **responseData** (Data?) - Optional raw response data associated with the error. ``` -------------------------------- ### Initialize NKSearchProvider Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nksearchprovider/init%28id%3Aname%3Aorder%3A%29 The initializer for creating a new instance of NKSearchProvider. ```swift init( id: String, name: String, order: Int ) ``` -------------------------------- ### init(rawValue:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkgovernancelabeltype/init%28rawvalue%3A%29 Initializes a new NKGovernanceLabelType instance from a raw string value. ```APIDOC ## init(rawValue:) ### Description Initializes an instance of `NKGovernanceLabelType` using a provided raw string value. This method is inherited from `RawRepresentable`. ### Signature `init?(rawValue: String)` ### Parameters - **rawValue** (String) - The raw string value used to initialize the type. ``` -------------------------------- ### init(data:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nklock/init%28data%3A%29 Initializes an NKLock instance from the provided WebDAV response body data. ```APIDOC ## init(data:) ### Description Initialize an NKLock object from the response body data of a WebDAV request. ### Signature `init?(data: Data)` ### Parameters - **data** (Data) - Required - The raw data received from a WebDAV request body. ``` -------------------------------- ### init(rawValue:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkproperties/init%28rawvalue%3A%29 Initializes a new instance of NKProperties from a raw String value. ```APIDOC ## init(rawValue:) ### Description Initializes an instance of NKProperties using a raw String value. This method is inherited from RawRepresentable. ### Signature `init?(rawValue: String)` ### Parameters - **rawValue** (String) - The raw string value used to initialize the property. ``` -------------------------------- ### Initialize NKGovernanceAvailableLabels Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkgovernanceavailablelabels/init%28sensitivity%3Aretention%3Ahold%3A%29 Initializes the governance labels structure with specific sensitivity, retention, and hold configurations. ```swift init( sensitivity: [NKGovernanceLabel], retention: [NKGovernanceLabel], hold: [NKGovernanceLabel] ) ``` -------------------------------- ### init(idShare: Int, reshares: Bool, subfiles: Bool, sharedWithMe: Bool) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkshareparameter Initializes a new NKShareParameter instance using a share ID. ```APIDOC ## init(idShare: Int, reshares: Bool, subfiles: Bool, sharedWithMe: Bool) ### Description Initializes an NKShareParameter object using a specific share ID and configuration flags. ### Parameters - **idShare** (Int) - The unique identifier of the share. - **reshares** (Bool) - Flag indicating if reshares are included. - **subfiles** (Bool) - Flag indicating if subfiles are included. - **sharedWithMe** (Bool) - Flag indicating if the share is shared with the current user. ``` -------------------------------- ### init(rawValue:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nktypeclassfile/init%28rawvalue%3A%29 Initializes a new NKTypeClassFile instance from a raw string value. ```APIDOC ## init(rawValue:) ### Description Initializes an instance of NKTypeClassFile using a provided raw string value. This method is inherited from RawRepresentable. ### Signature `init?(rawValue: String)` ### Parameters - **rawValue** (String) - The raw string value used to initialize the object. ``` -------------------------------- ### Initialize NKRequestOptions Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkrequestoptions/init%28endpoint%3Aversion%3Acustomheader%3Acustomuseragent%3Acontenttype%3Ae2etoken%3Atimeout%3Ataskdescription%3Acreateproperties%3Aremoveproperties%3Acheckinterceptor%3Apaginate%3Apaginatetoken%3Apaginateoffset%3Apaginatecount%3Aqueue%3A%29 The initializer provides default values for all parameters, allowing for flexible configuration of network request options. ```swift init( endpoint: String? = nil, version: String? = nil, customHeader: [String : String]? = nil, customUserAgent: String? = nil, contentType: String? = nil, e2eToken: String? = nil, timeout: TimeInterval = 60, taskDescription: String? = nil, createProperties: [NKProperties]? = nil, removeProperties: [NKProperties] = [], checkInterceptor: Bool = true, paginate: Bool = false, paginateToken: String? = nil, paginateOffset: Int? = nil, paginateCount: Int? = nil, queue: DispatchQueue = .main ) ``` -------------------------------- ### init(xml:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nklock/init%28xml%3A%29 Initializes an NKLock instance from a SwiftyXML accessor, intended for use with PROPFIND response data. ```APIDOC ## init(xml:) ### Description Initializes an NKLock instance based on a superset of required properties returned by a PROPFIND request to the server about an item. ### Signature `init?(xml properties: XML.Accessor)` ``` -------------------------------- ### static func configure(logLevel: NKLogLevel = .normal) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nklogfilemanager/configure%28loglevel%3A%29 Configures the shared logger instance for the NKLogFileManager. ```APIDOC ## static func configure(logLevel:) ### Description Configures the shared logger instance for the NKLogFileManager. ### Signature `static func configure(logLevel: NKLogLevel = .normal)` ### Parameters - **logLevel** (NKLogLevel) - Optional - The desired log level for the logger. Defaults to `.normal`. ``` -------------------------------- ### init(errorCode:errorDescription:responseData:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkerror/init%28errorcode%3Aerrordescription%3Aresponsedata%3A%29 Initializes a new NKError instance with the provided error code, description, and optional response data. ```APIDOC ## init(errorCode:errorDescription:responseData:) ### Description Creates an `NKError` from an explicit code and description. ### Signature `init(errorCode: Int = 0, errorDescription: String = "", responseData: Data? = nil)` ### Parameters - **errorCode** (Int) - The error code. - **errorDescription** (String) - The user-facing error description. - **responseData** (Data?) - Optional raw response data associated with the error. ``` -------------------------------- ### getRecommendedFilesAsync(account:options:request:taskHandler:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/getrecommendedfilesasync%28account%3Aoptions%3Arequest%3Ataskhandler%3A%29 Asynchronously fetches a list of recommended files for the given account. ```APIDOC ## getRecommendedFilesAsync(account:options:request:taskHandler:) ### Description Asynchronously fetches a list of recommended files for the given account. ### Signature ```swift func getRecommendedFilesAsync( account: String, options: NKRequestOptions = NKRequestOptions(), request: @escaping (DataRequest?) -> Void = { _ in }, taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in } ) async -> (account: String, recommendations: [NKRecommendation]?, responseData: AFDataResponse?, error: NKError) ``` ### Parameters - **account** (String) - The Nextcloud account requesting the recommendations. - **options** (NKRequestOptions) - Optional configuration for queue, headers, etc. - **request** (@escaping (DataRequest?) -> Void) - Optional callback to capture the DataRequest object. - **taskHandler** (@escaping (_ task: URLSessionTask) -> Void) - Optional handler for the URLSessionTask. ### Return Value A tuple containing the account, list of recommended files, raw response data, and NKError result. ``` -------------------------------- ### getRecommendedFiles(account:options:request:taskHandler:completion:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/getrecommendedfiles%28account%3Aoptions%3Arequest%3Ataskhandler%3Acompletion%3A%29 Retrieves a list of recommended files from the server. ```APIDOC ## getRecommendedFiles(account:options:request:taskHandler:completion:) ### Description Retrieves a list of recommended files from the server. ### Signature ```swift func getRecommendedFiles( account: String, options: NKRequestOptions = NKRequestOptions(), request: @escaping (DataRequest?) -> Void = { _ in }, taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }, completion: @escaping (_ account: String, _ recommendations: [NKRecommendation]?, _ responseData: AFDataResponse?, _ error: NKError) -> Void ) ``` ### Parameters - **account** (String) - The Nextcloud account used to perform the request. - **options** (NKRequestOptions) - Optional configuration for headers, queue, versioning, etc. - **request** (Closure) - Optional callback to observe or manipulate the underlying DataRequest. - **taskHandler** (Closure) - Callback triggered when the URLSessionTask is created. - **completion** (Closure) - Completion handler returning the account, the list of recommendations, the raw response data, and an NKError result. ``` -------------------------------- ### init(id:name:description:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nktextprocessingtasktype/init%28id%3Aname%3Adescription%3A%29 Initializes a new instance of NKTextProcessingTaskType with optional parameters. ```APIDOC ## init(id:name:description:) ### Description Initializes a new instance of the NKTextProcessingTaskType class with optional identifier, name, and description fields. ### Signature ```swift init( id: String? = nil, name: String? = nil, description: String? = nil ) ``` ### Parameters - **id** (String?) - Optional - The identifier for the task type. - **name** (String?) - Optional - The display name for the task type. - **description** (String?) - Optional - A description of the task type. ``` -------------------------------- ### Download Trash Preview Method Signature Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/downloadtrashpreview%28fileid%3Awidth%3Aheight%3Acrop%3Acropmode%3Aforceicon%3Amimefallback%3Aaccount%3Aoptions%3Ataskhandler%3Acompletion%3A%29 The method signature for downloading a preview of a file located in the trashbin, including default parameter values. ```swift func downloadTrashPreview( fileId: String, width: Int = 512, height: Int = 512, crop: Int = 1, cropMode: String = "cover", forceIcon: Int = 0, mimeFallback: Int = 0, account: String, options: NKRequestOptions = NKRequestOptions(), taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }, completion: @escaping (_ account: String, _ width: Int, _ height: Int, _ responseData: AFDataResponse?, _ error: NKError) -> Void ) ``` -------------------------------- ### downloadPreviewAsync(url:account:etag:options:taskHandler:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/downloadpreviewasync%28url%3Aaccount%3Aetag%3Aoptions%3Ataskhandler%3A%29 Asynchronously downloads a preview image (e.g., thumbnail) from the provided URL. ```APIDOC ## downloadPreviewAsync(url:account:etag:options:taskHandler:) ### Description Asynchronously downloads a preview image (e.g., thumbnail) from the provided URL. ### Signature ```swift func downloadPreviewAsync( url: URL, account: String, etag: String? = nil, options: NKRequestOptions = NKRequestOptions(), taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in } ) async -> (account: String, responseData: AFDataResponse?, error: NKError) ``` ### Parameters - **url** (URL) - The full URL of the preview image. - **account** (String) - The Nextcloud account making the request. - **etag** (String?) - Optional ETag used to validate cache. - **options** (NKRequestOptions) - Additional request options including version, headers, and queues. - **taskHandler** (Closure) - Optional handler for monitoring the URLSessionTask. ### Return Value A tuple containing the account identifier (String), response data (AFDataResponse?), and an NKError object. ``` -------------------------------- ### Retrieve Recommended Files in Swift Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/getrecommendedfiles%28account%3Aoptions%3Arequest%3Ataskhandler%3Acompletion%3A%29 Use this method to fetch file recommendations. It includes optional parameters for request customization and task monitoring. ```swift func getRecommendedFiles( account: String, options: NKRequestOptions = NKRequestOptions(), request: @escaping (DataRequest?) -> Void = { _ in }, taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }, completion: @escaping (_ account: String, _ recommendations: [NKRecommendation]?, _ responseData: AFDataResponse?, _ error: NKError) -> Void ) ``` -------------------------------- ### downloadPreview Method Signature Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/downloadpreview%28fileid%3Awidth%3Aheight%3Aetag%3Aetagresource%3Acrop%3Acropmode%3Aforceicon%3Amimefallback%3Aaccount%3Aoptions%3Ataskhandler%3Acompletion%3A%29 Defines the parameters for requesting a file preview, including dimensions, cropping, and account information. ```swift func downloadPreview( fileId: String, width: Int = 1024, height: Int = 1024, etag: String, etagResource: String? = nil, crop: Int = 1, cropMode: String = "cover", forceIcon: Int = 0, mimeFallback: Int = 0, account: String, options: NKRequestOptions = NKRequestOptions(), taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }, completion: @escaping (_ account: String, _ width: Int, _ height: Int, _ etag: String?, _ responseData: AFDataResponse?, _ error: NKError) -> Void ) ``` -------------------------------- ### createFolderAsync(serverUrlFileName:account:options:taskHandler:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/createfolderasync%28serverurlfilename%3Aaccount%3Aoptions%3Ataskhandler%3A%29 Asynchronously creates a folder on the Nextcloud server. ```APIDOC ## createFolderAsync(serverUrlFileName:account:options:taskHandler:) ### Description Asynchronously creates a folder on the Nextcloud server. ### Signature ```swift func createFolderAsync( serverUrlFileName: String, account: String, options: NKRequestOptions = NKRequestOptions(), taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in } ) async -> (account: String, ocId: String?, date: Date?, responseData: AFDataResponse?, error: NKError) ``` ### Parameters - **serverUrlFileName** (String) - The server URL and file name for the folder. - **account** (String) - The account identifier. - **options** (NKRequestOptions) - Optional request configuration. - **taskHandler** (Closure) - Optional handler for the URLSessionTask. ### Return Value A tuple containing: - **account** (String) - **ocId** (String?) - Optional ID from the server. - **date** (Date?) - Optional date associated with the operation. - **responseData** (AFDataResponse?) - The raw response data. - **error** (NKError) - Any error encountered during the operation. ``` -------------------------------- ### writeLog(success:minimumLogLevel:consoleOnly:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nklogfilemanager/writelog%28success%3Aminimumloglevel%3Aconsoleonly%3A%29 Logs a success message using the NKLogFileManager instance. ```APIDOC ## writeLog(success:minimumLogLevel:consoleOnly:) ### Description Logs a success message to the logging system. Allows specifying the minimum log level and whether the log should be restricted to the console only. ### Signature `func writeLog(success message: String, minimumLogLevel: NKLogLevel = .compact, consoleOnly: Bool = false)` ### Parameters - **success** (String) - The success message to be logged. - **minimumLogLevel** (NKLogLevel) - Optional. The minimum log level required for this message to be processed. Defaults to `.compact`. - **consoleOnly** (Bool) - Optional. If true, the log is output only to the console. Defaults to `false`. ``` -------------------------------- ### downloadingFinish(_:downloadTask:didFinishDownloadingTo:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkitdelegate/downloadingfinish%28_%3Adownloadtask%3Adidfinishdownloadingto%3A%29-9nul An instance method of NextcloudKitDelegate that handles the completion of a download task. ```APIDOC ## downloadingFinish(_:downloadTask:didFinishDownloadingTo:) ### Description This method is called when a download task managed by the NextcloudKit session has finished downloading to a specific location. ### Signature `func downloadingFinish(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL)` ### Parameters - **session** (URLSession) - The URL session that initiated the download task. - **downloadTask** (URLSessionDownloadTask) - The specific download task that has completed. - **location** (URL) - The file system URL where the downloaded file is temporarily stored. ``` -------------------------------- ### downloadPreview Method Signature Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/downloadpreview%28url%3Aaccount%3Aetag%3Aoptions%3Ataskhandler%3Acompletion%3A%29 Defines the parameters for downloading a file preview, including URL, account identifier, optional ETag, request options, task handler, and a completion closure. ```swift func downloadPreview( url: URL, account: String, etag: String? = nil, options: NKRequestOptions = NKRequestOptions(), taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }, completion: @escaping (_ account: String, _ responseData: AFDataResponse?, _ error: NKError) -> Void ) ``` -------------------------------- ### NKRecommendation Initializer Signature Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkrecommendation/init%28id%3Atimestamp%3Aname%3Adirectory%3Aextensiontype%3Amimetype%3Ahaspreview%3Areason%3A%29 The initializer for creating an NKRecommendation instance with specific file and metadata attributes. ```swift init( id: String, timestamp: Date?, name: String, directory: String, extensionType: String, mimeType: String, hasPreview: Bool, reason: String ) ``` -------------------------------- ### createFolder(serverUrlFileName:account:options:taskHandler:completion:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nextcloudkit/createfolder%28serverurlfilename%3Aaccount%3Aoptions%3Ataskhandler%3Acompletion%3A%29 Creates a folder on the Nextcloud server at the specified path. ```APIDOC ## createFolder(serverUrlFileName:account:options:taskHandler:completion:) ### Description Creates a folder on the Nextcloud server at the specified path. ### Signature ```swift func createFolder( serverUrlFileName: String, account: String, options: NKRequestOptions = NKRequestOptions(), taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }, completion: @escaping (_ account: String, _ ocId: String?, _ date: Date?, _ responseData: AFDataResponse?, _ error: NKError) -> Void ) ``` ### Parameters - **serverUrlFileName** (String) - The full URL string of the folder to create. - **account** (String) - The Nextcloud account identifier. - **options** (NKRequestOptions) - Optional request options including headers, timeout, and queue. - **taskHandler** (Closure) - Callback triggered with the underlying URLSessionTask. - **completion** (Closure) - Completion handler returning the account, optional file ID (ocId), optional date, raw Alamofire response data, and an NKError result. ``` -------------------------------- ### init(types:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/tasktypes/init%28types%3A%29 Initializes a new instance of TaskTypes with the specified array of task type data. ```APIDOC ## init(types:) ### Description Initializes the TaskTypes object with a collection of task type data. ### Signature `init(types: [TaskTypeData])` ### Parameters - **types** ([TaskTypeData]) - Required - An array of TaskTypeData objects to initialize the task types with. ``` -------------------------------- ### Initialize TaskOutput Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/taskoutput/init%28output%3A%29 The initializer accepts an optional string parameter for the output. ```swift init(output: String? = nil) ``` -------------------------------- ### init(rawValue:) Source: https://nextcloud.github.io/NextcloudKit/documentation/nextcloudkit/nkloglevel/init%28rawvalue%3A%29 Initializes a new NKLogLevel instance from a raw integer value. This method is inherited from RawRepresentable. ```APIDOC ## init(rawValue:) ### Description Creates an instance of NKLogLevel from a provided integer raw value. Returns nil if the raw value does not correspond to a valid log level. ### Signature `init?(rawValue: Int)` ### Parameters - **rawValue** (Int) - Required - The integer value representing the log level. ```