C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AnalyzeRe.APITypes.LargeDataSubResource Class Reference

Describes an endpoint off of some types of resources from which an associated "large data file" can be accessed. This is a standard endpoint that exists for all of IAPIResource_WithDataEndpoint resource types which surfaces a standard set of large file upload functionality. This endpoint supports GET and PUT, as well as chunked large data upload using POST and PATCH. More...

Public Member Functions

 LargeDataSubResource (IAPIResource_WithDataEndpoint owner)
 Defines an endpoint off of some types of resources from which an associated "large data file" can be accessed. This is a standard endpoint that exists for all of IAPIResource_WithDataEndpoint resource types which surfaces a standard set of large file upload functionality.
 
void Delete (int? timeout=null, IEnumerable< Parameter > requestParameters=null)
 Perform a DELETE request on the data endpoint, which would cancel a large data upload if it is in progress.
 
T Get (IEnumerable< Parameter > parameters=null, int? timeout=null)
 Performs a GET request a at this endpoint.
 
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 Head (IEnumerable< Parameter > parameters=null, int? timeout=null)
 Performs a HEAD request at this endpoint.
 
IRestResponse Head (int? timeout=null)
 Perform a HEAD request on the data endpoint, which would return information about whether data is present, or an upload is in progress.
 
void Patch (byte[] data, int count, long bytesOffset, int? timeout=null, IEnumerable< Parameter > requestParameters=null)
 Performs a PATCH of part of this object's data at this endpoint.
 
void Patch (string data, long bytesOffset, int? timeout=null, IEnumerable< Parameter > requestParameters=null)
 Performs a PATCH of part of this object's data at this endpoint.
 
void Post (long? totalSizeBytes, int? timeout=null)
 Performs a POST that initiates a chunked large data upload.
 
void UploadString (string data, LargeDataUpload.Parameters parameters=null)
 Uploads this object's data in its entirety at this endpoint in a single blocking request.
 

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 Attributes

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

Properties

CommandSubResource commit [get]
 The endpoint at which a large file upload is finalized with a POST.
 
intDefaultTimeout [get, set]
 Can be used to override the API.DefaultRequestTimeout with one that better suits this SubResource.
 
SubResource< LargeDataUpload.StatusResponsestatus [get]
 The endpoint at which the status of the data can be determined.
 

Detailed Description

Describes an endpoint off of some types of resources from which an associated "large data file" can be accessed. This is a standard endpoint that exists for all of IAPIResource_WithDataEndpoint resource types which surfaces a standard set of large file upload functionality. This endpoint supports GET and PUT, as well as chunked large data upload using POST and PATCH.

Definition at line 12 of file LargeDataSubResource.cs.

Inheritance diagram for AnalyzeRe.APITypes.LargeDataSubResource:
AnalyzeRe.APITypes.DataSubResource AnalyzeRe.APITypes.SubResource< string >

Constructor & Destructor Documentation

◆ LargeDataSubResource()

AnalyzeRe.APITypes.LargeDataSubResource.LargeDataSubResource ( IAPIResource_WithDataEndpoint  owner)
inline

Defines an endpoint off of some types of resources from which an associated "large data file" can be accessed. This is a standard endpoint that exists for all of IAPIResource_WithDataEndpoint resource types which surfaces a standard set of large file upload functionality.

Parameters
ownerThe resource which owns this data endpoint.

Definition at line 34 of file LargeDataSubResource.cs.

Member Function Documentation

◆ Delete()

void AnalyzeRe.APITypes.LargeDataSubResource.Delete ( int timeout = null,
IEnumerable< Parameter requestParameters = null 
)
inline

Perform a DELETE request on the data endpoint, which would cancel a large data upload if it is in progress.

Parameters
timeout(Optional) The timeout before the request fails.
requestParameters(Optional) Request parameters to include.

Definition at line 116 of file LargeDataSubResource.cs.

◆ Get()

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.

◆ GetStream()

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.

◆ 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.APITypes.LargeDataSubResource.Head ( int timeout = null)
inline

Perform a HEAD request on the data endpoint, which would return information about whether data is present, or an upload is in progress.

Parameters
timeout(Optional) The timeout before the request fails.
Returns
The IRestResponse returned by the server.

TODO: This method is redundant/ambiguous WRT the base SubResource<T>.Head method, but due to a difference in arguments and implementation cannot be easily removed. How are errors handled here compared to the base class that uses API.RequestAndParse?

Definition at line 106 of file LargeDataSubResource.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.

◆ Patch() [1/2]

void AnalyzeRe.APITypes.LargeDataSubResource.Patch ( byte[]  data,
int  count,
long  bytesOffset,
int timeout = null,
IEnumerable< Parameter requestParameters = null 
)
inline

Performs a PATCH of part of this object's data at this endpoint.

Parameters
dataThe bytes of data to include in the PATCH request body.
countThe number of bytes from the data array to use.
bytesOffsetThe offset (in bytes) at which this segment of data starts in the total data being uploaded.
timeout(Optional) The timeout before the request fails.
requestParameters(Optional) Additional request parameters to include.

Definition at line 83 of file LargeDataSubResource.cs.

◆ Patch() [2/2]

void AnalyzeRe.APITypes.LargeDataSubResource.Patch ( string  data,
long  bytesOffset,
int timeout = null,
IEnumerable< Parameter requestParameters = null 
)
inline

Performs a PATCH of part of this object's data at this endpoint.

Parameters
dataThe partial body of data to include in the PATCH request body.
bytesOffsetThe offset (in bytes) at which this segment of data starts in the total data being uploaded.
timeout(Optional) The timeout before the request fails.
requestParameters(Optional) Additional request parameters to include.

Definition at line 67 of file LargeDataSubResource.cs.

◆ Post()

void AnalyzeRe.APITypes.LargeDataSubResource.Post ( long totalSizeBytes,
int timeout = null 
)
inline

Performs a POST that initiates a chunked large data upload.

Parameters
totalSizeBytesThe size (in bytes) of the entire body of data to that will be uploaded in subsequent PATCH requests (if known in advance).
timeout(Optional) The timeout before the request fails.

Definition at line 53 of file LargeDataSubResource.cs.

◆ UploadString()

void AnalyzeRe.APITypes.LargeDataSubResource.UploadString ( string  data,
LargeDataUpload::Parameters  parameters = null 
)
inline

Uploads this object's data in its entirety at this endpoint in a single blocking request.

Parameters
dataThe entire body of data to upload to the server.
parameters(Optional) The upload parameters to use.

Definition at line 42 of file LargeDataSubResource.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

◆ commit

CommandSubResource AnalyzeRe.APITypes.LargeDataSubResource.commit
get

The endpoint at which a large file upload is finalized with a POST.

Definition at line 21 of file LargeDataSubResource.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.

◆ status

SubResource<LargeDataUpload.StatusResponse> AnalyzeRe.APITypes.LargeDataSubResource.status
get

The endpoint at which the status of the data can be determined.

Definition at line 24 of file LargeDataSubResource.cs.


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