Skip to content

Commit 3a52c09

Browse files
committed
Update code comments to allow generating documentation using Doxygen
1 parent aefe76b commit 3a52c09

31 files changed

+475
-294
lines changed

Assets/Scripts/Creatubbles/Api/CreationUploadSession.cs

+26-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// CreationUploadSession.cs
3-
// CreatubblesApiClient
3+
// Creatubbles API Client Unity SDK
44
//
55
// Copyright (c) 2016 Creatubbles Pte. Ltd.
66
//
@@ -25,13 +25,17 @@
2525
using System;
2626
using System.Collections;
2727
using UnityEngine;
28+
using Creatubbles.Api.Data;
29+
using Creatubbles.Api.Requests;
2830

2931
namespace Creatubbles.Api
3032
{
3133
/// <summary>
3234
/// Performs series of requests allocating creation, uploading file, updating creation and notifying backend when operation finishes.
33-
/// More info at <see href="https://stateoftheart.creatubbles.com/api/#creation-upload">https://stateoftheart.creatubbles.com/api/#creation-upload</see>.
3435
/// </summary>
36+
/// <remarks>
37+
/// More info at https://stateoftheart.creatubbles.com/api/#creation-upload.
38+
/// </remarks>
3539
public class CreationUploadSession: ICancellable
3640
{
3741
private const string InternalErrorMissingOrInvalidResponseData = "Invalid or missing data in reponse body.";
@@ -43,7 +47,7 @@ public class CreationUploadSession: ICancellable
4347
private NewCreationData creationData;
4448

4549
/// <summary>
46-
/// Upload request is stored in instance variable as data source for UploadProgress.
50+
/// Upload request is stored in instance variable as data source for <see cref="CreationUploadSession.UploadProgress"/>.
4751
/// </summary>
4852
private HttpRequest uploadRequest;
4953

@@ -55,21 +59,23 @@ public class CreationUploadSession: ICancellable
5559
/// <summary>
5660
/// Indicates whether upload session is finished.
5761
/// </summary>
58-
/// <value><c>true</c> if all requests completed or error was encountered, otherwise, <c>false</c>.</value>
62+
/// <value><c>true</c> if all requests completed, upload was cancelled or an error occured, otherwise <c>false</c>.</value>
5963
public bool IsDone { get; private set; }
6064

6165
/// <summary>
6266
/// Determines if session was cancelled.
6367
/// </summary>
6468
/// <value><c>true</c> if session was cancelled, otherwise <c>false</c>.</value>
65-
/// <see cref="ICancellable.Cancel()"></see>
69+
/// <see cref="ICancellable.Cancel()"/>
6670
/// <c>false</c>
6771
public bool IsCancelled { get; private set; }
6872

6973
/// <summary>
7074
/// Indicates whether a system error occured.
71-
/// More info at <see href="https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest-isError.html">https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest-isError.html</see>.
7275
/// </summary>
76+
/// <remarks>
77+
/// More info at https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest-isError.html.
78+
/// </remarks>
7379
/// <value><c>true</c> if Unity encountered a system error like no internet connection, socket errors, errors resolving DNS entries, or the redirect limit being exceeded, otherwise <c>false</c>.</value>
7480
public bool IsSystemError { get; private set; }
7581

@@ -82,7 +88,7 @@ public class CreationUploadSession: ICancellable
8288
/// <summary>
8389
/// Indicates whether an API error occured.
8490
/// </summary>
85-
/// <value><c>true</c> if request ended with an error like HTTP status 4xx or 5xx, otherwise, <c>false</c>.</value>
91+
/// <value><c>true</c> if request ended with an error like HTTP status 4xx or 5xx, otherwise <c>false</c>.</value>
8692
public bool IsApiError { get; private set; }
8793

8894
/// <summary>
@@ -92,25 +98,30 @@ public class CreationUploadSession: ICancellable
9298
public ApiError[] ApiErrors { get; private set; }
9399

94100
/// <summary>
95-
/// Indicates whether this an internal error has occured.
96-
/// Internal errors are not user-recoverable as they usually indicate an issue with implementation (client or backend) e.g. "Something went wrong" kind of error.
101+
/// Indicates whether an internal error has occured.
97102
/// </summary>
98-
/// <value><c>true</c> if some client implementation or internal API issue occured like failed data mapping or malformed response, otherwise <c>false</c>.</value>
103+
/// <remarks>
104+
/// Internal errors are not user-recoverable as they usually indicate an issue with implementation (client or backend) e.g. "Something went wrong" kind of error.
105+
/// </remarks>
106+
/// <value><c>true</c> if some client implementation or internal API issue occured like a failed data mapping or malformed response, otherwise <c>false</c>.</value>
99107
public bool IsInternalError { get; private set; }
100108

101109
/// <summary>
102-
/// Gets the internal error, which represents malformed response, parsing error or other unexpected failure.
110+
/// Gets the internal error message, which describes malformed response, parsing error or other unexpected failure.
103111
/// </summary>
104112
/// <value>The internal error.</value>
105113
public string InternalError { get; private set; }
106114

107-
// true when either system, API or internal errors occured
115+
/// <summary>
116+
/// Indicates whether any error occured during upload session.
117+
/// </summary>
118+
/// <value><c>true</c> if system, API or internal errors occured, otherwise <c>false</c>.</value>
108119
public bool IsAnyError { get { return IsSystemError || IsApiError || IsInternalError; } }
109120

110121
/// <summary>
111122
/// Gets the upload progress.
112123
/// </summary>
113-
/// <value>The upload progress in range <0;1>.</value>
124+
/// <value>The upload progress in range <c><0;1></c>.</value>
114125
public float UploadProgress { get { return uploadRequest == null ? 0 : uploadRequest.UploadProgress; } }
115126

116127
/// <summary>
@@ -126,7 +137,7 @@ public CreationUploadSession(NewCreationData creationData)
126137
/// <summary>
127138
/// Triggers series of requests forming new creation entity, uploading file, updating creation with uploaded file's URL and notifying server when upload is finished.
128139
/// </summary>
129-
/// <param name="creatubbles">Creatubbles.</param>
140+
/// <param name="creatubbles">Creatubbles API Client instance.</param>
130141
public IEnumerator Upload(CreatubblesApiClient creatubbles)
131142
{
132143
ResetFlagsAndFields();
@@ -262,7 +273,7 @@ public void Cancel()
262273
/// <summary>
263274
/// Notifies the backend that file upload is finished, regardless whether it completed successfully or with errors.
264275
/// </summary>
265-
/// <returns>The file upload finished <c>request.Send()</c> enumerator.</returns>
276+
/// <returns>Enumerator.</returns>
266277
/// <param name="creatubbles">Creatubbles.</param>
267278
/// <param name="pingUrl">The URL to which the notification request should be sent.</param>
268279
/// <param name="abortedWithMessage">Should be set to <c>null</c> if request was successful, to body of the response in case of errors and to '<c>user</c>' in case of upload being cancelled by user.</param>

0 commit comments

Comments
 (0)