C# Class PodioAPI.Services.FileService

Mostrar archivo Open project: podio/podio-dotnet

Public Methods

Method Description
AttachFile ( int fileId, string refType, int refId ) : System.Threading.Tasks.Task

Attaches the uploaded file to the given object.

Podio API Reference: https://developers.podio.com/doc/files/attach-file-22518

CopyFile ( int fileId ) : Task

Copies the file, which makes it available for attaching to another object.

Podio API Reference: https://developers.podio.com/doc/files/copy-file-89977

DeleteFile ( int fileId ) : System.Threading.Tasks.Task

Deletes the file with the given id

Podio API Reference: https://developers.podio.com/doc/files/delete-file-22453

DownloadFile ( FileAttachment fileAttachment ) : Task

To directly download the file of a FileAttachment

For more information see https://developers.podio.com/examples/files

FileService ( Podio currentInstance ) : System.Collections.Generic
GetFile ( int fileId ) : Task

Returns the file with the given id

Podio API Reference: https://developers.podio.com/doc/files/get-file-22451

GetFiles ( string attachedTo = null, string createdBy = null, string createdOn = null, string filetype = null, string hostedBy = null, int limit = 20, string sortBy = null, bool sortDesc = false ) : Task>

Returns a list of all files matching the given filters and sorted by the specified attribute.

Podio API Reference: https://developers.podio.com/doc/files/get-files-4497983

GetFilesOnApp ( int appId, string attachedTo = null, string createdBy = null, string createdOn = null, string filetype = null, string hostedBy = null, int limit = 20, int offset, string sortBy = null, bool sortDesc = false ) : Task>

Returns all the files related to the items in the application. This includes files both on the item itself and in comments on the item.

Podio API Reference: https://developers.podio.com/doc/files/get-files-on-app-22472

GetFilesOnSpace ( int spaceId, string attachedTo = null, string createdBy = null, string createdOn = null, string filetype = null, string hostedBy = null, int limit = 20, int offset, string sortBy = null, bool sortDesc = false ) : Task>

Returns all the files on the space order by the file name.

Podio API Reference: https://developers.podio.com/doc/files/get-files-on-space-22471

ReplaceFile ( int oldFileId, int fileId ) : System.Threading.Tasks.Task

Marks the current file as an replacement for the old file. Only files with type of "attachment" can be replaced.

Podio API Reference: https://developers.podio.com/doc/files/replace-file-22450

UpdateFile ( int fileId, string description ) : System.Threading.Tasks.Task

Used to update the description of the file.

Podio API Reference: https://developers.podio.com/doc/files/update-file-22454

UploadFile ( string fileName, byte data, string mimeType ) : Task

Uploads a new file

Podio API Reference: https://developers.podio.com/doc/files/upload-file-1004361

UploadFile ( string filePath, string fileName ) : Task

Uploads a new file

Podio API Reference: https://developers.podio.com/doc/files/upload-file-1004361

UploadFileFromUrl ( string fileUrl ) : Task

Upload a new file from URL

Method Details

AttachFile() public method

Attaches the uploaded file to the given object.

Podio API Reference: https://developers.podio.com/doc/files/attach-file-22518

public AttachFile ( int fileId, string refType, int refId ) : System.Threading.Tasks.Task
fileId int
refType string /// The type of object the file should be attached to. /// Valid objects are "status", "item", "comment", "space", or "task". ///
refId int
return System.Threading.Tasks.Task

CopyFile() public method

Copies the file, which makes it available for attaching to another object.

Podio API Reference: https://developers.podio.com/doc/files/copy-file-89977

public CopyFile ( int fileId ) : Task
fileId int
return Task

DeleteFile() public method

Deletes the file with the given id

Podio API Reference: https://developers.podio.com/doc/files/delete-file-22453

public DeleteFile ( int fileId ) : System.Threading.Tasks.Task
fileId int
return System.Threading.Tasks.Task

DownloadFile() public method

To directly download the file of a FileAttachment

For more information see https://developers.podio.com/examples/files

public DownloadFile ( FileAttachment fileAttachment ) : Task
fileAttachment PodioAPI.Models.FileAttachment
return Task

FileService() public method

public FileService ( Podio currentInstance ) : System.Collections.Generic
currentInstance Podio
return System.Collections.Generic

GetFile() public method

Returns the file with the given id

Podio API Reference: https://developers.podio.com/doc/files/get-file-22451

public GetFile ( int fileId ) : Task
fileId int
return Task

GetFiles() public method

Returns a list of all files matching the given filters and sorted by the specified attribute.

Podio API Reference: https://developers.podio.com/doc/files/get-files-4497983

public GetFiles ( string attachedTo = null, string createdBy = null, string createdOn = null, string filetype = null, string hostedBy = null, int limit = 20, string sortBy = null, bool sortDesc = false ) : Task>
attachedTo string /// The type of the entity the file is attached to. Can be one of {"item", "status", "task" and /// "space"} ///
createdBy string /// The entities that created the file. See auth objects on the view area in Podio API /// documentation for details. ///
createdOn string /// The from and to date the file was created between. For valid operations see date filtering /// under the view area in Podio API documentation. ///
filetype string The type of the file. Can be one of {"image", "application", "video", "text", "audio"}.
hostedBy string /// Which provider actually hosts the files. Currently can be one of {"podio", "google", "boxnet", /// "dropbox", "evernote", "live", "sharefile", "sugarsync", "yousendit"}. ///
limit int The maximum number of files to return Default value: 20
sortBy string How the files should be sorted. Can be one of {"name", "created_on"} Default value: name
sortDesc bool true for to sort in descending order, false in ascending Default value: false
return Task>

GetFilesOnApp() public method

Returns all the files related to the items in the application. This includes files both on the item itself and in comments on the item.

Podio API Reference: https://developers.podio.com/doc/files/get-files-on-app-22472

public GetFilesOnApp ( int appId, string attachedTo = null, string createdBy = null, string createdOn = null, string filetype = null, string hostedBy = null, int limit = 20, int offset, string sortBy = null, bool sortDesc = false ) : Task>
appId int App Id
attachedTo string /// The type of the entity the file is attached to. Can be one of {"item", "status", "task" and /// "space"} ///
createdBy string /// The entities that created the file. See auth objects on the view area in Podio API /// documentation for details. ///
createdOn string /// The from and to date the file was created between. For valid operations see date filtering /// under the view area in Podio API documentation. ///
filetype string The type of the file. Can be one of {"image", "application", "video", "text", "audio"}.
hostedBy string /// Which provider actually hosts the files. Currently can be one of {"podio", "google", "boxnet", /// "dropbox", "evernote", "live", "sharefile", "sugarsync", "yousendit"}. ///
limit int The maximum number of files to return Default value: 20
offset int The offset to use when returning files to be used for pagination. Default value: 0
sortBy string How the files should be sorted. Can be one of {"name", "created_on"} Default value: name
sortDesc bool true for to sort in descending order, false in ascending Default value: false
return Task>

GetFilesOnSpace() public method

Returns all the files on the space order by the file name.

Podio API Reference: https://developers.podio.com/doc/files/get-files-on-space-22471

public GetFilesOnSpace ( int spaceId, string attachedTo = null, string createdBy = null, string createdOn = null, string filetype = null, string hostedBy = null, int limit = 20, int offset, string sortBy = null, bool sortDesc = false ) : Task>
spaceId int
attachedTo string /// The type of the entity the file is attached to. Can be one of {"item", "status", "task" and /// "space"} ///
createdBy string /// The entities that created the file. See auth objects on the view area in Podio API /// documentation for details. ///
createdOn string /// The from and to date the file was created between. For valid operations see date filtering /// under the view area in Podio API documentation. ///
filetype string The type of the file. Can be one of {"image", "application", "video", "text", "audio"}.
hostedBy string /// Which provider actually hosts the files. Currently can be one of {"podio", "google", "boxnet", /// "dropbox", "evernote", "live", "sharefile", "sugarsync", "yousendit"}. ///
limit int The maximum number of files to return Default value: 20
offset int The offset to use when returning files to be used for pagination. Default value: 0
sortBy string How the files should be sorted. Can be one of {"name", "created_on"} Default value: name
sortDesc bool true for to sort in descending order, false in ascending Default value: false
return Task>

ReplaceFile() public method

Marks the current file as an replacement for the old file. Only files with type of "attachment" can be replaced.

Podio API Reference: https://developers.podio.com/doc/files/replace-file-22450

public ReplaceFile ( int oldFileId, int fileId ) : System.Threading.Tasks.Task
oldFileId int The id of the old file that should be replacd with the new file
fileId int
return System.Threading.Tasks.Task

UpdateFile() public method

Used to update the description of the file.

Podio API Reference: https://developers.podio.com/doc/files/update-file-22454

public UpdateFile ( int fileId, string description ) : System.Threading.Tasks.Task
fileId int
description string The new description of the file
return System.Threading.Tasks.Task

UploadFile() public method

Uploads a new file

Podio API Reference: https://developers.podio.com/doc/files/upload-file-1004361

public UploadFile ( string fileName, byte data, string mimeType ) : Task
fileName string
data byte
mimeType string
return Task

UploadFile() public method

Uploads a new file

Podio API Reference: https://developers.podio.com/doc/files/upload-file-1004361

public UploadFile ( string filePath, string fileName ) : Task
filePath string Full physical path to the file
fileName string File Name with extension
return Task

UploadFileFromUrl() public method

Upload a new file from URL
public UploadFileFromUrl ( string fileUrl ) : Task
fileUrl string
return Task