1using System.Diagnostics;
13 private struct StatusStruct
16 public string status_message {
get;
set; }
20 private static readonly string[] PollFields =
60 if (
resource.status.IsProcessingComplete())
61 Debug.WriteLine(
$"{resource.GetType().NiceTypeName()} {resource.id} already " +
62 $"has a finalized status of \"{resource.status}\"!");
68 status_message = resource.status_message
75 status => !status.status.IsBusy(),
82 $"The {resource.GetType().NiceTypeName()} {resource.id} is still " +
83 $"{(lastStatus.status == TaskStatus.Queued ? "queued for " : "")}processing " +
84 $"after {ex.TimeWaited} seconds, which exceeds the timeout of {ex.MaxWaitTime}ms.",
85 ex.TimeWaited,
ex.QueuePosition,
ex.RetryTime,
ex.MaxWaitTime,
ex,
ex.RestResponse);
91 resource.status_message =
lastStatus.status_message;
98 string errorMessage =
$"The {resource.GetType().NiceTypeName()} {resource.id} " +
99 (
resource.status.IsError() ?
"failed processing." :
100 $"is no longer processing, but the returned status of {resource.status} is not expected.") +
101 (
resource.status_message ==
null ?
" No message was provided." :
102 $" The following message was provided: {resource.status_message}");
A custom exception class that includes the RestSharp.IRestResponse that generated the exception,...
Describes a collection of resources which can be listed.
Parameters that can be added to your REST requests to access additional API features.
static RequestParameters Fields(IEnumerable< string > fieldNames)
Can be added to your GET requests to return only the specified fields in the response body....
API methods / requests made available to the user.
static void PollUntil(Func< bool > request, AnalyzeRe.PollingOptions pollingOptions=null)
Poll the specified request until it returns true.
Provides the REST request methods available to data endpoints.
static T PollUntilReady< T >(this T resource, PollingOptions pollingOptions=null)
Poll the IStoredAPIResource_WithStatus.status of a resource until it is TaskStatus....
Thrown when a request requires additional time to complete, but it exceeds the time we are willing to...
Determines the behaviour of the API when automatically retrying a request whose result is not yet rea...
Helper class which makes it easier to build a set of request parameters.
Describes an APIResource class that has a "status" property and corresponding "status_message" which ...
string status_message
Resource validation status message (if any).
TaskStatus status
Validation status of this resource.
TaskStatus
The status of a data upload which may be in progress.