C# Client Library
A C# Client Library for the AnalyzeRe REST API
AnalyzeRe.API.Parameters Class Reference

Parameters that can be added to your REST requests to access additional API features. More...

Static Public Member Functions

static RequestParameters AdvancedSearch (string advancedSearchTerms)
 Can be added to your GET requests to send a field filtering request to the server. If the endpoint supports data filtering, the results will be a filtered subset. Supports key/value search with logical operators. Currently supports the 'meta_data' field. More...
 
static RequestParameters DataEntityLength (long totalBytes)
 Creates an HTTP Header RestSharp parameter that specifies the length of an entity to be uploaded in subsequent PATCH requests. More...
 
static RequestParameters DataPatchChunk (long offsetBytes, byte[] chunkData, int count)
 Creates the RestSharp HTTP Header parameter required to PATCH a data endpoint with part of a file. More...
 
static RequestParameters DataPatchChunk (long offsetBytes, string chunkData)
 Creates the RestSharp HTTP Header parameter required to PATCH a data endpoint with part of a file. More...
 
static RequestParameters DataPatchChunk_Object (long offsetBytes, object chunkData, int content_length)
 Creates the RestSharp HTTP Header parameter required to PATCH a data endpoint with part of a file. More...
 
static RequestParameters ExpandReferences ()
 Can be added to your GET requests to recursively resolve resource references in the response. For example, if included in a Layer GET request, rather than returning a list of loss set reference ids, all properties of the loss sets would appear in the response. More...
 
static RequestParameters Fields (IEnumerable< string > fieldNames)
 Can be added to your GET requests to return only the specified fields in the response body. For example, can be used to add the parameter "?fields=id,status" to return only the id and status of a resource. Useful for avoiding large json response bodies when only partial information is desired. Can specify one or more property names. More...
 
static RequestParameters Ids (IEnumerable< string > ids)
 Can be added to your collection GET requests to return only the set of resources whose id matches one of the specified ids. More...
 
static RequestParameters Omit (IEnumerable< string > fieldNames)
 Similar to Fields, but rather than supplying a "white-list", allows one to specify a list of fields to be excluded from the the response body. This is useful if you wish to exclude certain large and/or expensive properties from being transmitted and serialized. Can specify one or more property names. More...
 
static RequestParameters Order (string ordering)
 Can be added to collection GET requests to specify the way items should be ordered. Note: Some properties are not supported, in which case ordering will have no effect. More...
 
static RequestParameters Order< T > (Expression< Func< T, object >> propertyExpression, bool ascending=true)
 Helper function to create RequestParameters for ordering by the specified property. Note: Some properties are not supported, in which case ordering will have no effect. More...
 
static RequestParameters Page (long offset, long limit)
 When getting a collection of items, these parameters can be added to restrict the number of results you get back and page through them. More...
 
static RequestParameters PageNumber (long pageNumber, long resultsPerPage)
 A variation of the 'Page' parameters that achieves the same effect, but by specifying a page number rather than an offset. More...
 
static RequestParameters Search (string searchTerms)
 Can be added to your GET requests to send a search request to the server. If the endpoint supports search, the results will be a filtered subset. More...
 
static RequestParameters Type (string apiTypeName)
 Can be added to your collection GET requests to filter by a specific sub-type when that resource is polymorphic (has several different sub-types). If the endpoint supports filtering by type, the results will be a filtered subset. More...
 
static RequestParameters Type (Type resourceType)
 Can be added to your collection GET requests to filter by a specific sub-type when that resource is polymorphic (has several different sub-types). If the endpoint supports filtering by type, the results will be a filtered subset. More...
 

Public Attributes

const string PATCHContentType = "application/offset+octet-stream"
 The contentType to set when submitting a PATCHED chunk data. More...
 

Detailed Description

Parameters that can be added to your REST requests to access additional API features.

Definition at line 22 of file API.Parameters.cs.

Member Function Documentation

static RequestParameters AnalyzeRe.API.Parameters.AdvancedSearch ( string  advancedSearchTerms)
inlinestatic

Can be added to your GET requests to send a field filtering request to the server. If the endpoint supports data filtering, the results will be a filtered subset. Supports key/value search with logical operators. Currently supports the 'meta_data' field.

In short, if you know a (key, value) pair by which you'd like to filter, you can submit the following sample queries as the content of the 'metaquery' GET parameter. (e.g. ?metaquery=<query>)

exact match

meta_data[key]="value"
meta_data[key]!="value"

substring match

meta_data[key]~"value" ("contains")
meta_data[key]~"valu*" ("starts with")
meta_data[key]~"*alue" ("ends with")

comparison match (lexicographic or numeric)

meta_data[key]<"value"
meta_data[key]>"value"
meta_data[key]<="value"
meta_data[key]>="value"

logical operators

NOT meta_data[key]="value"
meta_data[key1]="value1" AND meta_data[key2]="value2"
meta_data[key1]="value1" OR NOT meta_data[key2]="value2" AND meta_data[key3]="value3"

grouping via parentheses

meta_data[key]="value" AND (meta_data[key2]="value2" OR meta_data[key3]="value3")

filtering by key presence

meta_data[key]
meta_data[key1] AND meta_data[key2]

case sensitivity

By default, queries are case insensitive. Any value may be prefixed with the symbol

@CASE_SENSITIVE@

to activate case sensitivity. e.g.

meta_data[key]="@CASE_SENSITIVE@value"

quoting keys and values

Keys and values need not be double-quoted. However, unquoted keys and values may not contain certain characters including but not limited to whitespace. Surround keys and values with double-quotation marks for safety. See below for the full list of characters disallowed in unquoted keys/values.

In greater detail:

The elements of a filtering query follow this format:

{field}[{key}]{op}{value}

Where

{field} must be the string "meta_data".
{key} must be a string, representing a key in your field.
{op} is an operator from the following list (see below):
"!=", "<=", ">=", ">", "<", "=", "~"
{value} is an integer, real number or string representing a
value in your field.

Furthermore, query elements may be combined using parentheses and logical operators which include:

"(", ")", AND, OR, NOT

Unquoted keys and values may not contain the following tokens:

whitespace "AND" "NOT" "OR" "__" ! " [ ] ( ) = ~ < >

Quoted keys and values may contain any character except unescaped quotes. Quotes may be escaped by repetition. e.g. a query for a value containing double-quotes:

meta_data[key]="The question was ""to be or not to be""."

or a query with a key containing quotes

meta_data["key_with_""quoted portion"""]=value
Parameters
advancedSearchTermsA string defining a filtering query consisting of keys and values, operations and logic that selects a subset of objects at the endpoint based on object metadata.

Definition at line 159 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.DataEntityLength ( long  totalBytes)
inlinestatic

Creates an HTTP Header RestSharp parameter that specifies the length of an entity to be uploaded in subsequent PATCH requests.

Parameters
totalBytesThe total number of bytes of the data to be uploaded.
Returns
The parameters to add to your POST request to initiate a large file upload.

Definition at line 345 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.DataPatchChunk ( long  offsetBytes,
byte[]  chunkData,
int  count 
)
inlinestatic

Creates the RestSharp HTTP Header parameter required to PATCH a data endpoint with part of a file.

Parameters
offsetBytesThe offset in the file being PATCHed at which to insert this segment of data.
chunkDataThe bytes array containing the data to patch.
countThe number of bytes from the data to include.
Returns
The parameters to add to your PATCH request during a large file upload.

Definition at line 359 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.DataPatchChunk ( long  offsetBytes,
string  chunkData 
)
inlinestatic

Creates the RestSharp HTTP Header parameter required to PATCH a data endpoint with part of a file.

Parameters
offsetBytesThe offset in the file being PATCHed at which to insert this segment of data.
chunkDataThe string contents to patch.
Returns
The parameters to add to your PATCH request during a large file upload.

Definition at line 382 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.DataPatchChunk_Object ( long  offsetBytes,
object  chunkData,
int  content_length 
)
inlinestatic

Creates the RestSharp HTTP Header parameter required to PATCH a data endpoint with part of a file.

Parameters
offsetBytesThe offset in the file being PATCHed at which to insert this segment of data.
chunkDataThe data to patch.
content_lengthThe length of the byte representation of the data being patched.
Returns
The parameters to add to your PATCH request during a large file upload.

Definition at line 397 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.ExpandReferences ( )
inlinestatic

Can be added to your GET requests to recursively resolve resource references in the response. For example, if included in a Layer GET request, rather than returning a list of loss set reference ids, all properties of the loss sets would appear in the response.

Returns
The parameters to add to your GET request to resolve resource references in the response.

Definition at line 235 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.Fields ( IEnumerable< string >  fieldNames)
inlinestatic

Can be added to your GET requests to return only the specified fields in the response body. For example, can be used to add the parameter "?fields=id,status" to return only the id and status of a resource. Useful for avoiding large json response bodies when only partial information is desired. Can specify one or more property names.

Parameters
fieldNamesThe fields names to return in the json response.
Returns
The parameters to add to your GET request to include only the specified fields.

Definition at line 251 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.Ids ( IEnumerable< string >  ids)
inlinestatic

Can be added to your collection GET requests to return only the set of resources whose id matches one of the specified ids.

Parameters
idsThe fields names to return in the json response.

If an invalid GUID is specified in the list of ids, the entire request will fail. If a valid GUID is specified, but no resource in this collection has that id, the request will succeed and simply not contain a result for that GUID.

The server may impose a limit on the number of ids that can be requested at one time.

Returns
The parameters to add to your GET request to include only the specified fields.

Definition at line 289 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.Omit ( IEnumerable< string >  fieldNames)
inlinestatic

Similar to Fields, but rather than supplying a "white-list", allows one to specify a list of fields to be excluded from the the response body. This is useful if you wish to exclude certain large and/or expensive properties from being transmitted and serialized. Can specify one or more property names.

Parameters
fieldNamesThe fields names to exclude from the json response.
Returns
The parameters to add to your GET request to omit the specified fields.

Definition at line 269 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.Order ( string  ordering)
inlinestatic

Can be added to collection GET requests to specify the way items should be ordered. Note: Some properties are not supported, in which case ordering will have no effect.

Parameters
orderingA comma delimited string of properties to order by. Each property can be preceded by a negative sign (-) to order descending. For instance, to sort first by description, then by most recently created (for duplicate descriptions) use "description,-created".
Returns
The parameters to add to your collection GET request to order items.

Definition at line 197 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.Order< T > ( Expression< Func< T, object >>  propertyExpression,
bool  ascending = true 
)
inlinestatic

Helper function to create RequestParameters for ordering by the specified property. Note: Some properties are not supported, in which case ordering will have no effect.

Parameters
propertyExpressionThe property to order by.
ascendingBy default, properties are sorted in ascending order. Set to false to sort by this property descending.
Returns
The parameters to add to your collection GET request to order items.

Definition at line 214 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.Page ( long  offset,
long  limit 
)
inlinestatic

When getting a collection of items, these parameters can be added to restrict the number of results you get back and page through them.

Parameters
offsetThe number of results to skip before starting to return results.
limitThe maximum number of results to return.
Returns
The parameters to add to your GetResourceList request to paginate results.

Definition at line 308 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.PageNumber ( long  pageNumber,
long  resultsPerPage 
)
inlinestatic

A variation of the 'Page' parameters that achieves the same effect, but by specifying a page number rather than an offset.

Parameters
pageNumberThe page or results you wish to return (starting at page 1).
resultsPerPageThe number of results per page.
Returns
The parameters to add to your GetResourceList request to paginate results.

Definition at line 326 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.Search ( string  searchTerms)
inlinestatic

Can be added to your GET requests to send a search request to the server. If the endpoint supports search, the results will be a filtered subset.

Returns
The parameters to add to your GET request to search for the specified terms.

Definition at line 34 of file API.Parameters.cs.

static RequestParameters AnalyzeRe.API.Parameters.Type ( string  apiTypeName)
static

Can be added to your collection GET requests to filter by a specific sub-type when that resource is polymorphic (has several different sub-types). If the endpoint supports filtering by type, the results will be a filtered subset.

Parameters
apiTypeNameIf you know the exact API type name you want, you can specify it here. Otherwise, you can use the overload.
Returns
The parameters to add to your GET request to perform type filtering.
static RequestParameters AnalyzeRe.API.Parameters.Type ( Type  resourceType)
static

Can be added to your collection GET requests to filter by a specific sub-type when that resource is polymorphic (has several different sub-types). If the endpoint supports filtering by type, the results will be a filtered subset.

Parameters
resourceTypeThe type of resource you wish to retrieve. This should correspond to a instantiable resource type. Base types or interfaces that do not correspond to a single API type return no results.
Returns
The parameters to add to your GET request to perform type filtering.

Member Data Documentation

const string AnalyzeRe.API.Parameters.PATCHContentType = "application/offset+octet-stream"

The contentType to set when submitting a PATCHED chunk data.

Definition at line 25 of file API.Parameters.cs.


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