C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AsyncParameters.cs
Go to the documentation of this file.
1using System;
2
4{
7 {
8 #region Public Properties
10 public new static AsyncParameters Default => new AsyncParameters();
11 #endregion Public Properties
12
13 #region Callbacks
15 public Action<StatusResponse> OnSuccess;
16
20 public Action<Exception> OnError;
21
24 public Action<StatusResponse> OnProgressUpdate;
25 #endregion Callbacks
26
27 #region Constructors
29 public AsyncParameters() { }
30
58 int? min_chunk_size = null,
59 int? max_chunk_size = null,
60 int? max_retries_per_chunk = null,
61 int? chunk_timeout = null,
64 bool? enable_compression = null,
65 Action<StatusResponse> onSuccess = null,
66 Action<Exception> onError = null,
67 Action<StatusResponse> onProgressUpdate = null)
70 {
71 OnSuccess = onSuccess;
72 OnError = onError;
73 OnProgressUpdate = onProgressUpdate;
74 }
75
92 Parameters source,
93 Action<StatusResponse> onSuccess = null,
94 Action<Exception> onError = null,
95 Action<StatusResponse> onProgressUpdate = null)
96 : this(source.min_chunk_size, source.max_chunk_size, source.max_retries_per_chunk,
99 onSuccess ?? (source as AsyncParameters)?.OnSuccess,
100 onError ?? (source as AsyncParameters)?.OnError,
101 onProgressUpdate ?? (source as AsyncParameters)?.OnProgressUpdate)
102 {
103#pragma warning disable 618
105#pragma warning restore 618
106 }
107 #endregion Constructors
108 }
109}
Parameters to be used in a Large Upload operation.
AsyncParameters()
Construct a new set of Default Large Data Async Upload Parameters.
static new AsyncParameters Default
Get a new set of Default Async Large Data Upload Parameters.
Action< StatusResponse > OnProgressUpdate
Action to invoke every time a chunk is uploaded. Callback is supplied with a double indicating progre...
Action< StatusResponse > OnSuccess
Action to invoke upon successful completion of the large upload.
AsyncParameters(int? min_chunk_size=null, int? max_chunk_size=null, int? max_retries_per_chunk=null, int? chunk_timeout=null, PollingOptions commit_polling_options=null, HandleUploadInSessionStrategy? handle_existing_upload_strategy=null, bool? enable_compression=null, Action< StatusResponse > onSuccess=null, Action< Exception > onError=null, Action< StatusResponse > onProgressUpdate=null)
Construct a new set of Large Data Async Upload Parameters.
AsyncParameters(Parameters source, Action< StatusResponse > onSuccess=null, Action< Exception > onError=null, Action< StatusResponse > onProgressUpdate=null)
Construct a new set of Large Data Async Upload Parameters from a set of Large Data Upload Parameters.
Action< Exception > OnError
Action to invoke upon failure of the large upload. If this is supplied, it will be called when an err...
Parameters to be used in a Large Data Upload operation.
Definition Parameters.cs:7
PollingOptions commit_polling_options
Determines how the system polls the status of the data file while waiting for the data to be processe...
Definition Parameters.cs:47
int chunk_timeout
The timeout (in milliseconds) for a single chunk upload to complete. Default: 60,000 ms (1 minute).
Definition Parameters.cs:41
HandleUploadInSessionStrategy handle_existing_upload_strategy
The HandleUploadInSessionStrategy to employ of an existing upload session is already in progress....
Definition Parameters.cs:51
bool enable_compression
Whether to compress (gzip) the data during upload. (Default: False) Set to true if the files you're u...
Definition Parameters.cs:59
int max_chunk_size
The maximum size of a single uploaded chunk in bytes. Default: 2^24 bytes (16 Megabytes).
Definition Parameters.cs:33
int min_chunk_size
The minimum size of a single uploaded chunk in bytes. Set this larger if there is enough latency betw...
Definition Parameters.cs:27
BinaryYELTUploadOptions binary_yelt_options
Options for controlling whether to automatically convert a binary YELTLossSet's data to the binary fo...
Definition Parameters.cs:82
int max_retries_per_chunk
The maximum number of retries for a failed chunk upload before an error is thrown....
Definition Parameters.cs:37
Determines the behaviour of the API when automatically retrying a request whose result is not yet rea...
HandleUploadInSessionStrategy
Behaviour to use if an existing upload is already in progress for an endpoint.