You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Assets/Scripts/Creatubbles/Api/CreationUploadSession.cs
+26-15
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
//
2
2
// CreationUploadSession.cs
3
-
// CreatubblesApiClient
3
+
// Creatubbles API Client Unity SDK
4
4
//
5
5
// Copyright (c) 2016 Creatubbles Pte. Ltd.
6
6
//
@@ -25,13 +25,17 @@
25
25
usingSystem;
26
26
usingSystem.Collections;
27
27
usingUnityEngine;
28
+
usingCreatubbles.Api.Data;
29
+
usingCreatubbles.Api.Requests;
28
30
29
31
namespaceCreatubbles.Api
30
32
{
31
33
/// <summary>
32
34
/// 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>.
34
35
/// </summary>
36
+
/// <remarks>
37
+
/// More info at https://stateoftheart.creatubbles.com/api/#creation-upload.
38
+
/// </remarks>
35
39
publicclassCreationUploadSession:ICancellable
36
40
{
37
41
privateconststringInternalErrorMissingOrInvalidResponseData="Invalid or missing data in reponse body.";
@@ -43,7 +47,7 @@ public class CreationUploadSession: ICancellable
43
47
privateNewCreationDatacreationData;
44
48
45
49
/// <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"/>.
47
51
/// </summary>
48
52
privateHttpRequestuploadRequest;
49
53
@@ -55,21 +59,23 @@ public class CreationUploadSession: ICancellable
55
59
/// <summary>
56
60
/// Indicates whether upload session is finished.
57
61
/// </summary>
58
-
/// <value><c>true</c> if all requests completedor 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>
59
63
publicboolIsDone{get;privateset;}
60
64
61
65
/// <summary>
62
66
/// Determines if session was cancelled.
63
67
/// </summary>
64
68
/// <value><c>true</c> if session was cancelled, otherwise <c>false</c>.</value>
65
-
/// <see cref="ICancellable.Cancel()"></see>
69
+
/// <see cref="ICancellable.Cancel()"/>
66
70
/// <c>false</c>
67
71
publicboolIsCancelled{get;privateset;}
68
72
69
73
/// <summary>
70
74
/// 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>.
72
75
/// </summary>
76
+
/// <remarks>
77
+
/// More info at https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest-isError.html.
78
+
/// </remarks>
73
79
/// <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>
74
80
publicboolIsSystemError{get;privateset;}
75
81
@@ -82,7 +88,7 @@ public class CreationUploadSession: ICancellable
82
88
/// <summary>
83
89
/// Indicates whether an API error occured.
84
90
/// </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>
86
92
publicboolIsApiError{get;privateset;}
87
93
88
94
/// <summary>
@@ -92,25 +98,30 @@ public class CreationUploadSession: ICancellable
92
98
publicApiError[]ApiErrors{get;privateset;}
93
99
94
100
/// <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.
97
102
/// </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>
99
107
publicboolIsInternalError{get;privateset;}
100
108
101
109
/// <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.
103
111
/// </summary>
104
112
/// <value>The internal error.</value>
105
113
publicstringInternalError{get;privateset;}
106
114
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>
@@ -126,7 +137,7 @@ public CreationUploadSession(NewCreationData creationData)
126
137
/// <summary>
127
138
/// Triggers series of requests forming new creation entity, uploading file, updating creation with uploaded file's URL and notifying server when upload is finished.
/// <param name="pingUrl">The URL to which the notification request should be sent.</param>
268
279
/// <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