C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AnalyzeRe.APIResourceView.SimulationResult< T > Class Template Referenceabstract

Defines a new SimulationResult endpoint off the current resource. More...

Public Member Functions

Get (IEnumerable< Parameter > parameters=null, int? timeout=null)
 Performs a GET request a at this endpoint.
 
string Get (T options=null, bool blocking=true, int? timeout=null, IEnumerable< Parameter > requestParameters=null)
 Performs a GET for this simulation result and returns the response as string.
 
IRestResponse GetStream (Action< Stream > consumeStream, IEnumerable< Parameter > parameters=null, int? timeout=null)
 Perform a GET on the supplied URL and provide an action for consuming the response stream rather than loading the whole response into memory.
 
IRestResponse GetStream (Action< Stream > consumeStream, T options=null, bool blocking=true, int? timeout=null, IEnumerable< Parameter > requestParameters=null)
 Performs a GET for this simulation result and streams the result to the specified handler, rather than loading the whole response into memory.
 
IRestResponse Head (IEnumerable< Parameter > parameters=null, int? timeout=null)
 Performs a HEAD request at this endpoint.
 
IRestResponse Head (T options=null, int? timeout=null, IEnumerable< Parameter > requestParameters=null)
 Perform a HEAD request for this simulation result. This can be used to determine whether the result is ready (and what the response content length will be).
 

Static Public Member Functions

static implicit operator T (SubResource< T > value)
 Allows implicit conversion of an instance of this class to its expected response return type.
 

Protected Member Functions

 SimulationResult (IAPIResourceView owner, string relativePath)
 Defines a new SimulationResult endpoint off the current resource.
 

Protected Attributes

string PUT_ContentType = "application/octet-stream"
 The contentType to set when submitting this resource's body in a PUT request.
 

Properties

T DefaultOptions [get]
 The default simulation options for the type T .
 
int? DefaultTimeout [get, set]
 Can be used to override the API.DefaultRequestTimeout with one that better suits this SubResource.
 

Detailed Description

Defines a new SimulationResult endpoint off the current resource.

Type Constraints
T :SimulationOptions 

Definition at line 13 of file SimulationResult.cs.

Inheritance diagram for AnalyzeRe.APIResourceView.SimulationResult< T >:
AnalyzeRe.APITypes.DataSubResource AnalyzeRe.APITypes.SubResource< string >

Constructor & Destructor Documentation

◆ SimulationResult()

AnalyzeRe.APIResourceView.SimulationResult< T >.SimulationResult ( IAPIResourceView  owner,
string  relativePath 
)
inlineprotected

Defines a new SimulationResult endpoint off the current resource.

Parameters
ownerThe resource which owns this sub-resource.
relativePathThe relative path to this result.

Definition at line 21 of file SimulationResult.cs.

Member Function Documentation

◆ Get() [1/2]

T AnalyzeRe.APITypes.SubResource< T >.Get ( IEnumerable< Parameter parameters = null,
int timeout = null 
)
inlineinherited

Performs a GET request a at this endpoint.

Parameters
parameters(Optional) Rest parameters to include with the GET request.
timeout(Optional) The timeout before the request fails.
Returns
The data previously uploaded to this endpoint.

Definition at line 51 of file SubResource[T].cs.

◆ Get() [2/2]

string AnalyzeRe.APIResourceView.SimulationResult< T >.Get ( T  options = null,
bool  blocking = true,
int timeout = null,
IEnumerable< Parameter requestParameters = null 
)
inline

Performs a GET for this simulation result and returns the response as string.

Parameters
optionsA set of request options which can be used to produce a distribution net of various filters, loss perspectives, etc.
blocking(Optional - Default: true) Specifies whether the the thread should wait until the result is ready before returning. If set to true, automatically retries using PollingOptions.Default settings.
timeout(Optional) The timeout before the request fails. By default, the request will never timeout.

// TODO: This is inconsistent with the rest of the API

Parameters
requestParameters(Optional) Additional parameters to include in the request.
Returns
The data previously uploaded to this endpoint.
Exceptions
APIRequestExceptionIf there was an error, or if blocking was set to false and the results are not yet available.
NotWaitingExceptionIf blocking is set to true, but specified timeout has been exceeded and the results are not yet available.

Definition at line 38 of file SimulationResult.cs.

◆ GetStream() [1/2]

IRestResponse AnalyzeRe.APITypes.SubResource< T >.GetStream ( Action< Stream consumeStream,
IEnumerable< Parameter parameters = null,
int timeout = null 
)
inlineinherited

Perform a GET on the supplied URL and provide an action for consuming the response stream rather than loading the whole response into memory.

Warning: The consumeStream action will always be invoked and handed the response body, even if the response status was an error. Your consumeStream action should be able to handle scenarios where the message body is an error message or otherwise contains unexpected content.

Parameters
consumeStreamThe action that will consume the response stream.
parametersAny additional parameters to include in the request.
timeoutOptional - The desired request response timeout (in milliseconds).
Returns
The IRestResponse returned after executing the request. This response object contains all the details about the request (whether it was successful or not) except for the raw data, which is handled by the user-supplied stream action.
Exceptions
APIRequestExceptionIf the request failed to reach the API.

Definition at line 72 of file SubResource[T].cs.

◆ GetStream() [2/2]

IRestResponse AnalyzeRe.APIResourceView.SimulationResult< T >.GetStream ( Action< Stream consumeStream,
T  options = null,
bool  blocking = true,
int timeout = null,
IEnumerable< Parameter requestParameters = null 
)
inline

Performs a GET for this simulation result and streams the result to the specified handler, rather than loading the whole response into memory.

Parameters
consumeStreamThe action that will consume the response stream.
optionsA set of request options which can be used to produce a distribution net of various filters, loss perspectives, etc.
blocking(Optional - Default: true) Specifies whether the the thread should wait until the result is ready before returning. If set to true, automatically retries using PollingOptions.Default settings.
timeout(Optional) The timeout before the request fails. By default, the request will never timeout.

// TODO: This is inconsistent with the rest of the API

Parameters
requestParameters(Optional) Additional parameters to include in the request.
Returns
The IRestResponse returned after executing the request. This response object contains all the details about the request (whether it was successful or not) except for the raw data, which is handled by the user-supplied stream action.

The consumeStream action will always be invoked and handed the response body, even if the response status was an error. Your consumeStream action should be able to handle scenarios where the message body is an error message or otherwise contains unexpected content.

Exceptions
APIRequestExceptionIf there was an error, or if blocking was set to false and the results are not yet available.
NotWaitingExceptionIf blocking is set to true, but specified timeout has been exceeded and the results are not yet available.

Definition at line 71 of file SimulationResult.cs.

◆ Head() [1/2]

IRestResponse AnalyzeRe.APITypes.SubResource< T >.Head ( IEnumerable< Parameter parameters = null,
int timeout = null 
)
inlineinherited

Performs a HEAD request at this endpoint.

Parameters
parameters(Optional) Rest parameters to include with the HEAD request.
timeout(Optional) The timeout before the request fails.
Returns
The response.

Definition at line 40 of file SubResource[T].cs.

◆ Head() [2/2]

IRestResponse AnalyzeRe.APIResourceView.SimulationResult< T >.Head ( T  options = null,
int timeout = null,
IEnumerable< Parameter requestParameters = null 
)
inline

Perform a HEAD request for this simulation result. This can be used to determine whether the result is ready (and what the response content length will be).

Parameters
optionsA set of request options which can be used to produce a distribution net of various filters, loss perspectives, etc.
timeout(Optional) The timeout before the request fails.
requestParameters(Optional) Additional parameters to include in the request.
Returns
The IRestResponse from the server.

Definition at line 92 of file SimulationResult.cs.

◆ operator T()

static implicit AnalyzeRe.APITypes.SubResource< T >.operator T ( SubResource< T value)
inlinestaticinherited

Allows implicit conversion of an instance of this class to its expected response return type.

Definition at line 28 of file SubResource[T].cs.

Member Data Documentation

◆ PUT_ContentType

string AnalyzeRe.APITypes.DataSubResource.PUT_ContentType = "application/octet-stream"
protectedinherited

The contentType to set when submitting this resource's body in a PUT request.

Definition at line 10 of file DataSubResource.cs.

Property Documentation

◆ DefaultOptions

T AnalyzeRe.APIResourceView.SimulationResult< T >.DefaultOptions
getabstractprotected

The default simulation options for the type T .

Definition at line 16 of file SimulationResult.cs.

◆ DefaultTimeout

int? AnalyzeRe.APITypes.SubResource< T >.DefaultTimeout
getsetinherited

Can be used to override the API.DefaultRequestTimeout with one that better suits this SubResource.

Definition at line 16 of file SubResource[T].cs.


The documentation for this class was generated from the following file: