class MAGES::Recorder::Cloud

Overview

Cloud handler class. More…

class Cloud
{
public:
    // structs

    struct Recording;

    // classes

    class ProgressableStreamContent;

    // methods

    Cloud(IAuthenticationAPI auth, string baseUrl, string product);
    async Task<(bool, string, RecorderModule.Recording[])> GetRecordings();

    async Task<(bool, string, string)> DownloadRecording(
        string recordingId,
        string folder,
        System.Action onUpdate,
        bool unzip = false
    );

    async Task<(bool, string)> UploadRecording(
        RecorderModule.Recording recording,
        System.Action onUpdate,
        string title = null,
        bool isPublic = false
    );

    async Task<(bool, string)> DeleteRecording(RecorderModule.Recording recording);
    async Task<(bool, string)> DeleteRecordings(IEnumerable<RecorderModule.Recording> recordings);

    async Task<(bool, string)> EditRecording(
        string recordingId,
        RecorderModule.Recording newData
    );
};

Detailed Documentation

Cloud handler class.

Methods

Cloud(IAuthenticationAPI auth, string baseUrl, string product)

Initializes a new instance of the Cloud class.

Parameters:

auth

The authentication API to use.

baseUrl

The base URL to use.

product

The product code to use.

async Task<(bool, string, RecorderModule.Recording[])> GetRecordings()

Gets all the recordings.

Returns:

A tuple containing a value indicating whether the operation was successful, a message, and an array of recordings.

async Task<(bool, string, string)> DownloadRecording(
    string recordingId,
    string folder,
    System.Action onUpdate,
    bool unzip = false
)

Downloads and unzips a recording.

Parameters:

recordingId

The recording.

folder

The destination folder.

onUpdate

A callback to update the progress.

unzip

A value indicating whether to unzip the recording.

Returns:

A tuple containing a value indicating whether the operation was successful, a message, and a string of the first file that was unzipped.

async Task<(bool, string)> UploadRecording(
    RecorderModule.Recording recording,
    System.Action onUpdate,
    string title = null,
    bool isPublic = false
)

Uploads a recording.

Parameters:

recording

The recording to upload.

onUpdate

Progress indicator callback.

title

The title of the recording. If left null, ‘{product} Recording’ will be used.

isPublic

A value indicating whether to mark the recording as public.

Returns:

A tuple containing a boolean that indicates whether the upload process was successful, and a string that contains a more descriptive message.

async Task<(bool, string)> DeleteRecording(RecorderModule.Recording recording)

Deletes a recording.

Parameters:

recording

The recording to delete.

Returns:

A tuple containing a boolean that indicates whether the deletion process was successful, and a string that contains a more descriptive message.

async Task<(bool, string)> DeleteRecordings(IEnumerable<RecorderModule.Recording> recordings)

Deletes multiple recordings.

Parameters:

recordings

The recordings to delete.

Returns:

A tuple containing a boolean that indicates whether the deletion process was successful, and a string that contains a more descriptive message.

async Task<(bool, string)> EditRecording(
    string recordingId,
    RecorderModule.Recording newData
)

Edits a recording.

Parameters:

recordingId

The recording id to edit.

newData

The new data to write to the recording.

Returns:

A tuple containing a boolean that indicates whether the edit process was successful, and a string that contains a more descriptive message.