SaveUpload

public struct SaveUpload : PCloudAPIMethod

Commits an upload session into a file and returns the created file metadata.

  • An action to take in the event of a file conflict during saving. A file conflict can occur when attempting to save a file in a directory where another file with the same name already exists.

    See more

    Declaration

    Swift

    public enum ConflictResolutionPolicy
  • The identifier of the upload session.

    Declaration

    Swift

    public let uploadId: UInt64
  • The identifier of the directory in which to save the file.

    Declaration

    Swift

    public let parentFolderId: UInt64
  • The name of the file. Note that the file might be saved with a different name depending on the conflict resolution policy.

    Declaration

    Swift

    public let fileName: String
  • The date to use as the modification date for the file when creating it in the file system. When nil the file will be created with the current date as the modification date.

    Declaration

    Swift

    public let fileModificationDate: Date?
  • The action to take when file conflict occurs during saving.

    Declaration

    Swift

    public let conflictResolutionPolicy: ConflictResolutionPolicy
  • Declaration

    Swift

    public var requiresAuthentication: Bool { get }
  • Declaration

    Swift

    public init(uploadId: UInt64, parentFolderId: UInt64, fileName: String, fileModificationDate: Date?, onConflict: ConflictResolutionPolicy)

    Parameters

    uploadId

    An upload session identifier.

    parentFolderId

    An identifier of the folder where to save the file.

    fileName

    A file name.

    fileModificationDate

    A date to use as the modification date for the file when creating it in the file system. When nil, the file will be created with the current date as the modification date.

    onConflict

    An action to take if a file conflict occurs.

  • Declaration

    Swift

    public func createCommand() -> Call.Command
  • Declaration

    Swift

    public func createResponseParser() -> ([String : Any]) throws -> Result<File.Metadata, PCloudAPI.Error<Error>>
  • Declaration

    Swift

    public enum Error : Int