C# Client Library
A C# Client Library for the AnalyzeRe REST API
|
API methods / requests made available to the user. More...
Classes | |
class | Parameters |
Parameters that can be added to your REST requests to access additional API features. More... | |
class | PollingOptions |
A duplicate of the AnalyzeRe.PollingOptions class. More... | |
class | PortfolioViewMarginals |
Represents the endpoint on the server for requesting marginal portfolios. More... | |
Public Types | |
enum | SearchType { Basic , Advanced } |
The search type determines the interpretation of the query string. More... | |
Public Member Functions | |
delegate void | AuthenticationRequestedHandler (ref IAccessToken ToAuthenticate, string RequestedAuthentication) |
A handler that can respond to a AuthenticationRequestedHandler event. | |
Static Public Member Functions | |
static ICollectionResponse< IAPIResource > | BatchGet (Type resourceType, IEnumerable< string > ids, IEnumerable< Parameter > requestParameters=null, string collectionNameOverride=null, int? timeout=null) |
Get a collection of resources from the server that match the set of resource ids specified. | |
static ICollectionResponse< T > | BatchGet< T > (IEnumerable< string > ids, IEnumerable< Parameter > requestParameters=null, string collectionNameOverride=null, int? timeout=null) |
Get a collection of resources from the server that match the set of resource ids specified. | |
static void | ClearCachedAuthenticationCredentials (string server=null) |
The Analyze Re API .NET Client Library caches authentication tokens that have been validated via the AuthenticationRequested event. This means that all applications on the same machine using this library can be authenticated once the first application is authenticated. These credentials will automatically be forgotten if they are revoked by the server, but this method can be used to forget all cached credentials, or just the credentials for a specific server if one is specified. | |
static IRestResponse | ExecuteRestRequest (string resource, Method method, IEnumerable< Parameter > requestParameters=null, int? timeout=null, bool returnRawResponse=false, Action< Stream > responseStreamReader=null) |
Perform a REST request on the server. | |
static object | ExtractRestResponse (IRestResponse response, Type deserializeType) |
Attempts to deserialize an IRestResponse content to the specified run-time type. | |
static T | ExtractRestResponse< T > (IRestResponse response) |
Attempts to deserialize an IRestResponse content to the specified type T. | |
static IAPIResource | Get (Type resourceType, string id, IEnumerable< Parameter > requestParameters=null, int? timeout=null) |
Get the selected resource by ID. The appropriate collection is automatically determined by the supplied runtime resource type. (Must derive from IAPIResource) | |
static T | Get< T > (string id, IEnumerable< Parameter > requestParameters=null, int? timeout=null) |
Get the selected resource by ID. The appropriate collection is automatically determined by the resource type. (Must derive from IAPIResource) | |
static AuthenticationStatus | GetAuthenticationStatus (bool force_request=false) |
Determines whether we are currently authenticated against the server with the global default AuthenticationToken. If the current authentication status is unknown, Invokes a request to test the authentication status. | |
static string | GetCollectionName (Type requestType) |
Gets the collection name for the given APIResource type, whether it's instantiable or not. | |
static string | GetCollectionName (Type requestType, out Type declaringClassType, bool suppress_throw=false) |
Gets the collection name for the given APIResource type, whether it's instantiable or not. | |
static string | GetCollectionName< T > () |
Gets the collection name for the given APIResource type, whether it's instantiable or not. | |
static string | GetCollectionName< T > (out Type declaringClassType) |
Gets the collection name for the given APIResource type, whether it's instantiable or not. | |
static string | GetCollectionNameFromResourceHref (string href) |
Return the collection name implied by the href for a given resource assuming the URL is in the format: https://apiurl.net/collection_name/guid | |
static string | GetCurrentAuthorizationString () |
Return the Authorization header string formed by the current AuthenticationToken. | |
static ICollectionResponse< IAPIResource > | GetResourceList (Type resourceType, IEnumerable< Parameter > requestParameters=null, string collectionNameOverride=null, int? timeout=null) |
Get a collection of resources from the server. | |
static ICollectionResponse< T > | GetResourceList< T > (IEnumerable< Parameter > requestParameters=null, string collectionNameOverride=null, int? timeout=null) |
Get a collection of resources from the server. | |
static object | GetUri (Type deserializeType, Uri href, IEnumerable< Parameter > requestParameters=null, int? timeout=null) |
Perform a GET on an arbitrary resource by extracting the path and query parameters from a manually specified Uri. | |
static T | GetUri< T > (Uri href, IEnumerable< Parameter > requestParameters=null, int? timeout=null) |
Perform a GET on an arbitrary resource by extracting the path and query parameters from a manually specified Uri. | |
static bool | IsAReServerActive (string checkServerURL, int? timeout=null) |
Determines if the provided URL is a valid running Analyze Re server. | |
static bool | IsSuccessful (this IRestResponse response) |
Extension method that returns true if the restResponse was completed and contains a successful status code. | |
static void | LoadSettings () |
Reloads all shared client library settings from the current statically configured SharedSettingsProvider.GlobalSettingsLocation. If this method is not invoked, or settings are not individually set, settings are loaded automatically when the first request is made, but can be repeated manually if the external settings file is modified or the desired settings location is changed. | |
static OptionsResponse | Options (IEnumerable< Parameter > requestParameters=null, int? timeout=null) |
Perform an OPTIONS request on the API, which returns a list of features supported for the current authenticated user. | |
static void | PollUntil (Func< bool > request, AnalyzeRe.PollingOptions pollingOptions=null) |
Poll the specified request until it returns true. | |
static TResponse | PollUntil< TResponse > (Func< TResponse > request, Func< TResponse, bool > isPollingComplete, AnalyzeRe.PollingOptions pollingOptions=null) |
Poll the requested resource until a desired state is attained. | |
static T | PollUntilReady< T > (Func< T > functionThatMight503, AnalyzeRe.PollingOptions pollingOptions=null) |
Specialized polling that will executes the specified request delegate, but if a 503 retry-after APIRequestException is encountered, it blocks until the request returns successfully or the maximum polling time is exceeded. | |
static T | PollUntilReady< T > (Func< T > functionThatMight503, double minPollInterval=0d, double maxPollInterval=Double.MaxValue, double maxPollTotalTime=Double.MaxValue) |
Obsolete.
Executes the specified request delegate, but if a 503 retry-after APIRequestException is encountered, it blocks until the request returns successfully or the maximum polling time is exceeded. | |
static string | PrettyPrint (this IRestRequest request) |
Extension method that generates a helpful string representation of an IRestRequest. | |
static string | PrettyPrint (this IRestResponse response) |
Extension method that generates a helpful string representation of an IRestResponse. | |
static object | RequestAndParse (Type deserializeType, string resource, Method method, IEnumerable< Parameter > requestParameters=null, int? timeout=null) |
Perform a REST request on the server and serializes the response to the desired run-time type. | |
static T | RequestAndParse< T > (string resource, Method method, IEnumerable< Parameter > requestParameters=null, int? timeout=null) |
Perform a REST request on the server and serializes the response to the desired compile-time type. | |
static ICollectionResponse< IAPIResource > | SearchResourceList (Type resourceType, string searchTerms, IEnumerable< Parameter > requestParameters=null, string collectionNameOverride=null, int? timeout=null, SearchType searchType=SearchType.Basic) |
Get a collection of resources from the server that match the specified search criteria. | |
static ICollectionResponse< T > | SearchResourceList< T > (string searchTerms, IEnumerable< Parameter > requestParameters=null, string collectionNameOverride=null, int? timeout=null, SearchType searchType=SearchType.Basic) |
Get a collection of resources from the server that match the specified search criteria. | |
static bool | TryHandleAuthenticationErrors (IRestResponse response, int sequentialAttempts=0) |
Checks an IRestResponse object for authentication errors, then invokes configured authentication delegates if the response was an "unauthorized" error. | |
static void | TryPromptForAuthentication () |
Invoke the AuthenticationRequested event, which requests authentication credentials for the server. Note: this will have no effect if already authenticated or authentication is not required for this server. | |
Static Public Attributes | |
static readonly ResourceCollection< Agent > | Agents |
The collection of Agents on the server. | |
static readonly ResourceCollection< Analysis > | Analyses |
The collection of Analyses on the server. | |
static readonly ResourceCollection< AnalysisProfile > | AnalysisProfiles |
The collection of AnalysisProfiles on the server. | |
static readonly string | AnalyzeReCustomServerHeader = "ARE-Server" |
The Custom Server Header returned by valid AnalyzeRe servers. | |
static readonly string | AnalyzeReServerIdentity = "ARE-API" |
The Server identity returned by valid AnalyzeRe servers. | |
static readonly string | DateTimeFormat = @"O" |
The format used when transmitting DateTime information to Analyze Re servers. | |
static readonly ResourceCollection< IDistribution > | Distributions |
The collection of Distributions on the server. | |
static readonly ResourceCollection< EventCatalog > | EventCatalogs |
The collection of EventCatalogs on the server. | |
static readonly ResourceCollection< ExchangeRateProfile > | ExchangeRateProfiles |
The collection of ExchangeRateProfiles on the server. | |
static readonly ResourceCollection< ExchangeRateTable > | ExchangeRateTables |
The collection of ExchangeRateTables on the server. | |
static readonly ResourceCollection< DataFile > | Files |
The collection of Files on the server. | |
static readonly ResourceCollection< ILayer > | Layers |
The collection of Layers on the server. | |
static readonly ResourceCollection< ILayerView > | LayerViews |
The collection of LayerViews on the server. | |
static readonly ResourceCollection< LossFilter > | LossFilters |
The collection of LossFilters on the server. | |
static readonly ResourceCollection< LossSet > | LossSets |
The collection of LossSets on the server. | |
static volatile int | MaxRequestRetries = 3 |
When a temporary communication failure occurs (such as a socket error or an authentication failure for which there is a handler) this property determines how many times the client will automatically retry the same request before returning the error. | |
static readonly ResourceCollection< MetricsFunction > | MetricsFunctions |
The collection of optimization metrics functions on the server. | |
static readonly ResourceCollection< OptimizationView > | OptimizationViews |
The collection of OptimizationViews on the server. | |
static readonly ResourceCollection< Portfolio > | Portfolios |
The collection of Portfolios on the server. | |
static readonly ResourceCollection< PortfolioView > | PortfolioViews |
The collection of PortfolioViews on the server. | |
static readonly ResourceCollection< ProjectionFunction > | ProjectionFunctions |
The collection of optimization projection functions on the server. | |
static readonly ResourceCollection< Simulation > | Simulations |
The collection of Simulations on the server. | |
Properties | |
static IAccessToken | AuthenticationToken [get, set] |
The AccessToken storing authentication information for requests made to the server. | |
static int | DefaultRequestTimeout [get, set] |
The default timeout used for all simple server requests, in milliseconds. | |
static int | DefaultRequestTimeoutCollections [get, set] |
The default timeout used when requesting a resource collection from the server, in milliseconds. | |
static string | DefaultServerURL [get] |
The Default ServerURL the API is instantiated with, as configured in the settings. | |
static bool | ManagedSettingsEnabled = true [get, set] |
By Default, the Analyze Re Client Library will automatically save and restore certain configured settings such as timeouts and credentials. Set this to false to disable these features (for instance if they cause issues for your application). | |
static int | Parallelism [get, set] |
The maximum number of concurrent requests that can be made. | |
static string | ServerURL [get, set] |
The default server URL to be used for all API requests. On change, voids the current cached authentication credentials. | |
static string | UserAgent [get, set] |
The UserAgent identifying the requests made by this client. This can be changed if an application wishes to better identify itself to the server. | |
Events | |
static AuthenticationRequestedHandler | AuthenticationRequested |
An event that fires whenever authentication is requested by the server. This event can be used to prompt a user or other external source for credentials as needed, rather than hard-coding them into the application. | |
API methods / requests made available to the user.
Partial class containing the members tied to requesting marginal portfolios.
Definition at line 18 of file API.Authentication.cs.
The search type determines the interpretation of the query string.
Enumerator | |
---|---|
Basic | Search by keyword on predefined field. |
Advanced | Search by complex query on key-value metadata. See Parameters.AdvancedSearch for details about advanced searching. |
Definition at line 309 of file API.Requests.cs.
delegate void AnalyzeRe.API.AuthenticationRequestedHandler | ( | ref IAccessToken | ToAuthenticate, |
string | RequestedAuthentication | ||
) |
A handler that can respond to a AuthenticationRequestedHandler event.
ToAuthenticate | The AccessToken to authenticate. |
RequestedAuthentication | The WWW-Authenticate header sent from the server. |
|
inlinestatic |
Get a collection of resources from the server that match the set of resource ids specified.
resourceType | The runtime type of IAPIResource being retrieved. |
ids | The list of resource ids to request from the server. |
requestParameters | Optional - Additional parameters to include in the request. |
collectionNameOverride | Optional - The new name of the collection to search from the server (if not using the default collection for the specified resourceType ) |
timeout | Optional - The desired request timeout (in milliseconds). |
This function will automatically set the "limit" parameter to match the number of ids requested, but the server may impose a hard limit on the number of ids that can be requested at one time. See Parameters.Ids for more details.
Definition at line 426 of file API.Requests.cs.
|
inlinestatic |
Get a collection of resources from the server that match the set of resource ids specified.
T | The type of IAPIResource being retrieved. |
ids | The list of resource ids to request from the server. |
requestParameters | Optional - Additional parameters to include in the request. |
collectionNameOverride | Optional - The new name of the collection to search from the server (if not using the default collection for the resource type T ) |
timeout | Optional - The desired request timeout (in milliseconds). |
This function will automatically set the "limit" parameter to match the number of ids requested, but the server may impose a hard limit on the number of ids that can be requested at one time. See Parameters.Ids for more details.
T | : | IAPIResource |
Definition at line 398 of file API.Requests.cs.
|
inlinestatic |
The Analyze Re API .NET Client Library caches authentication tokens that have been validated via the AuthenticationRequested event. This means that all applications on the same machine using this library can be authenticated once the first application is authenticated. These credentials will automatically be forgotten if they are revoked by the server, but this method can be used to forget all cached credentials, or just the credentials for a specific server if one is specified.
server | (Optional) A single server URL whose credentials should be forgotten. |
Definition at line 438 of file API.Authentication.cs.
|
inlinestatic |
Perform a REST request on the server.
resource | The path of the resource or request target, from the root server URL. |
method | The HTTP method to execute, as a Rest.Method enumeration value. |
requestParameters | The data to include in the request, in the form of Rest parameters. |
timeout | Optional - The desired request timeout (in milliseconds). |
returnRawResponse | Optional (Default False) - By default, this client library will look at the response returned from the server and handle a number of known errors and response failures (like 503-RetryAfter errors) and return a more meaningful error, in some cases automatically resolving the errors itself. |
You can disable this and return the raw IRestResponse from the server. To do this you must set the return type (T) to IRestResponse and set "returnRawResponse" to true.
responseStreamReader | (Optional) If supplied, the response body will be returned as a stream to the supplied delegate, rather than in the response body of the IRestResponse. |
IRestResponse
.Definition at line 513 of file API.Requests.cs.
|
inlinestatic |
Attempts to deserialize an IRestResponse content to the specified run-time type.
response | The server response, as an IRestResponse . |
deserializeType | The type to deserialize the JSON response to. |
Definition at line 636 of file API.Requests.cs.
|
inlinestatic |
Attempts to deserialize an IRestResponse content to the specified type T.
T | The type to deserialize the JSON response to. |
response | The server response, as an IRestResponse . |
Definition at line 622 of file API.Requests.cs.
|
inlinestatic |
Get the selected resource by ID. The appropriate collection is automatically determined by the supplied runtime resource type. (Must derive from IAPIResource)
resourceType | The runtime type of the resource to retrieve. |
id | The id of the resource on the server. |
requestParameters | Optional - Additional parameters to include in the request. |
timeout | Optional - The desired request timeout (in milliseconds). |
This method cannot be used to find a resource whose type is not known.
Definition at line 73 of file API.Requests.cs.
|
inlinestatic |
Get the selected resource by ID. The appropriate collection is automatically determined by the resource type. (Must derive from IAPIResource)
T | The type of resource to retrieve. |
id | The id of the resource on the server. |
requestParameters | Optional - Additional parameters to include in the request. |
timeout | Optional - The desired request timeout (in milliseconds). |
This method cannot be used to find a resource whose type is not known.
T | : | IAPIResource |
Definition at line 52 of file API.Requests.cs.
|
inlinestatic |
Determines whether we are currently authenticated against the server with the global default AuthenticationToken. If the current authentication status is unknown, Invokes a request to test the authentication status.
force_request | Set to true to force a request to be made to the server regardless of the cached authentication status on the current authentication token. |
Definition at line 388 of file API.Authentication.cs.
Gets the collection name for the given APIResource type, whether it's instantiable or not.
requestType | The type of resource for which to retrieve the collection name. |
Definition at line 256 of file API.Utilities.cs.
|
inlinestatic |
Gets the collection name for the given APIResource type, whether it's instantiable or not.
requestType | The type of resource for which to retrieve the collection name. |
declaringClassType | Will be set to the Type that declared the collection name. |
suppress_throw | Allows the caller to suppress raising an exception if the no collection name exists for the specified class and return null instead. |
Definition at line 277 of file API.Utilities.cs.
|
inlinestatic |
Gets the collection name for the given APIResource type, whether it's instantiable or not.
T | The type of resource for which to retrieve the collection name. |
T | : | IAPIResource |
Definition at line 233 of file API.Utilities.cs.
|
inlinestatic |
Gets the collection name for the given APIResource type, whether it's instantiable or not.
T | The type of resource for which to retrieve the collection name. |
declaringClassType | Will be set to the Type that declared the collection name. |
T | : | IAPIResource |
Definition at line 245 of file API.Utilities.cs.
Return the collection name implied by the href for a given resource assuming the URL is in the format: https://apiurl.net/collection_name/guid
href | A resource URL. |
Definition at line 436 of file API.Utilities.cs.
|
inlinestatic |
Return the Authorization header string formed by the current AuthenticationToken.
Definition at line 53 of file API.Authentication.cs.
|
inlinestatic |
Get a collection of resources from the server.
resourceType | The type of resource (derived from IAPIResource). |
requestParameters | Optional - Additional parameters to include in the request. |
collectionNameOverride | Optional - The new name of the collection to retrieve from the server (if not using the default collection for the resource type T) |
timeout | Optional - The desired request timeout (in milliseconds). |
Definition at line 171 of file API.Requests.cs.
|
inlinestatic |
Get a collection of resources from the server.
T | The type of resource (derived from IAPIResource). |
requestParameters | Optional - Additional parameters to include in the request. |
collectionNameOverride | Optional - The new name of the collection to retrieve from the server (if not using the default collection for the resource type T) |
timeout | Optional - The desired request timeout (in milliseconds). |
T | : | IAPIResource |
Definition at line 142 of file API.Requests.cs.
|
inlinestatic |
Perform a GET on an arbitrary resource by extracting the path and query parameters from a manually specified Uri.
deserializeType | The expected type of the resource request response. Set to IRestResponse to skip deserializing the request. |
href | The request Uri to use. Note that only the path and query will be used. This method is not intended to facilitate requests made to a host other than the one configured as the ServerURL. |
requestParameters | Optional - Additional parameters to include in the request. |
timeout | Optional - The desired request timeout (in milliseconds). |
Definition at line 122 of file API.Requests.cs.
|
inlinestatic |
Perform a GET on an arbitrary resource by extracting the path and query parameters from a manually specified Uri.
T | The expected type of the resource request response. Set to IRestResponse to skip deserializing the request. |
href | The request Uri to use. Note that only the path and query will be used. This method is not intended to facilitate requests made to a host other than the one configured as the ServerURL. |
requestParameters | Optional - Additional parameters to include in the request. |
timeout | Optional - The desired request timeout (in milliseconds). |
Definition at line 98 of file API.Requests.cs.
|
inlinestatic |
Determines if the provided URL is a valid running Analyze Re server.
checkServerURL | The server URL to check. |
timeout | Optional - The desired request timeout (in milliseconds). |
Definition at line 34 of file API.Utilities.cs.
|
inlinestatic |
Extension method that returns true if the restResponse was completed and contains a successful status code.
response | The response received from the server. |
Definition at line 649 of file API.Utilities.cs.
|
static |
Reloads all shared client library settings from the current statically configured SharedSettingsProvider.GlobalSettingsLocation. If this method is not invoked, or settings are not individually set, settings are loaded automatically when the first request is made, but can be repeated manually if the external settings file is modified or the desired settings location is changed.
Various default settings can be configured by modifying the appropriate Settings.Default attribute and saving changes.
|
inlinestatic |
Perform an OPTIONS request on the API, which returns a list of features supported for the current authenticated user.
requestParameters | Optional - Additional parameters to include in the request. |
timeout | Optional - The desired request timeout (in milliseconds). |
Definition at line 32 of file API.Requests.cs.
|
static |
Poll the specified request until it returns true.
request | A test condition that returns true or false. |
pollingOptions | (Optional) Polling options which determine the polling rates, total time, and allow for asynchronous cancellation. |
NotWaitingException | If the polling options max poll total time is exceeded and the request never returned true. |
TaskCanceledException | If the pollingOptions.CancellationToken enters the cancelled state. |
|
inlinestatic |
Poll the requested resource until a desired state is attained.
TResponse | The type of response expected. |
request | The delegate to invoke each time the resource is polled. |
isPollingComplete | The delegate which determines whether the response to the request is the desired state. This is evaluated after each request. |
pollingOptions | (Optional) Polling options which determine the polling rates, total time, and allow for asynchronous cancellation. |
NotWaitingException | If the polling options max poll total time is exceeded and the result is not yet available. |
TaskCanceledException | If the pollingOptions.CancellationToken enters the cancelled state. |
TODO: In order to avoid exceeding the timeout, we may wish to invoke the request (which in theory might block forever) in a cancellable task with a timeout.
Definition at line 73 of file API.Utilities.cs.
|
inlinestatic |
Specialized polling that will executes the specified request delegate, but if a 503 retry-after APIRequestException is encountered, it blocks until the request returns successfully or the maximum polling time is exceeded.
T | The return type of the delegate function. |
functionThatMight503 | A request delegate function to be executed which may raise a 503 retry-after APIRequestException. |
pollingOptions | (Optional) Determines the behaviour of the API when automatically retrying a request whose result is not yet ready for retrieval. |
NotWaitingException | If the polling options max poll total time is exceeded and the result is not yet available. |
APIRequestException | The server raises an exception other than one that indicates the user should retry the request. |
TaskCanceledException | If the pollingOptions.CancellationToken enters the cancelled state. |
Definition at line 138 of file API.Utilities.cs.
|
inlinestatic |
Obsolete.
Executes the specified request delegate, but if a 503 retry-after APIRequestException is encountered, it blocks until the request returns successfully or the maximum polling time is exceeded.
T | The return type of the delegate function. |
functionThatMight503 | A request delegate function to be executed which may raise a 503 retry-after APIRequestException. |
minPollInterval | Optional (Default: 0) The minimum time (in seconds) to wait between retrying the request. |
maxPollInterval | Optional (Default: double.MaxValue) The maximum time (in seconds) to wait between retrying the request. |
maxPollTotalTime | Optional (Default: double.MaxValue) The maximum time (in seconds) to poll the request before raising a NotWaitingException. |
NotWaitingException | If the max poll total time is exceeded and the result is not yet available. |
APIRequestException | The server raises an exception other than one that indicates the user should retry the request. |
ArgumentOutOfRangeException | The specified min and max polling intervals do not result in meaningful bounds. |
TODO: Delete Deprecated Methods after phase-out period.
Definition at line 724 of file API.Utilities.cs.
|
inlinestatic |
Extension method that generates a helpful string representation of an IRestRequest.
request | The IRestRequest to convert to string. |
Definition at line 568 of file API.Utilities.cs.
|
inlinestatic |
Extension method that generates a helpful string representation of an IRestResponse.
response | The IRestResponse to convert to string. |
Definition at line 601 of file API.Utilities.cs.
|
inlinestatic |
Perform a REST request on the server and serializes the response to the desired run-time type.
deserializeType | The type to deserialize the JSON response to. Set to IRestResponse to bypass deserializing the request from JSON and return the response directly. |
resource | The path of the resource or request target, from the root server URL. |
method | The HTTP method to execute, as a RestSharp.Method enumeration value. |
requestParameters | The data to include in the request, in the form of Rest parameters. |
timeout | Optional - The desired request timeout (in milliseconds). |
Definition at line 481 of file API.Requests.cs.
|
inlinestatic |
Perform a REST request on the server and serializes the response to the desired compile-time type.
T | The type to deserialize the JSON response to. Set to IRestResponse to bypass deserializing the request from JSON and return the response directly. |
resource | The path of the resource or request target, from the root server URL. |
method | The HTTP method to execute, as a RestSharp.Method enumeration value. |
requestParameters | The data to include in the request, in the form of Rest parameters. |
timeout | Optional - The desired request timeout (in milliseconds). |
Definition at line 456 of file API.Requests.cs.
|
inlinestatic |
Get a collection of resources from the server that match the specified search criteria.
resourceType | The type of resource (derived from IAPIResource). |
searchTerms | The search term to pass on to the server. |
requestParameters | Optional - Additional parameters to include in the request. |
collectionNameOverride | Optional - The new name of the collection to search from the server (if not using the default collection for the resource type T) |
timeout | Optional - The desired request timeout (in milliseconds). |
searchType | Optional - Indicates the type of search to perform, affecting search target and query interpretation. (default: SearchType.Basic) |
Definition at line 367 of file API.Requests.cs.
|
inlinestatic |
Get a collection of resources from the server that match the specified search criteria.
T | The type of resource (derived from IAPIResource). |
searchTerms | The search term to pass on to the server. |
requestParameters | Optional - Additional parameters to include in the request. |
collectionNameOverride | Optional - The new name of the collection to search from the server (if not using the default collection for the resource type T) |
timeout | Optional - The desired request timeout (in milliseconds). |
searchType | Optional - Indicates the type of search to perform, affecting search target and query interpretation. (default: SearchType.Basic) See Parameters.AdvancedSearch for details about advanced searching. |
T | : | IAPIResource |
Definition at line 335 of file API.Requests.cs.
|
inlinestatic |
Checks an IRestResponse object for authentication errors, then invokes configured authentication delegates if the response was an "unauthorized" error.
When the AuthenticationRequested event has been handled, standard requests made via this client library that fail due to an authentication error will raise the event so that the user or client application can be prompted for credentials. The client library will then take care of automatically retrying the request with the supplied credentials.
The API.MaxRetries configuration property controls how many times the user will be prompted before the request fails permanently.
response | The response to check for authentication errors. |
sequentialAttempts | The number of times this same request has been attempted (to compare against the maximum allowed authentication retries) |
AuthenticationException | Raises an AuthenticationException if authentication is requested, but there is no delegate configured to handle the request, or there is some other problem with the Authentication request. |
Definition at line 82 of file API.Authentication.cs.
|
inlinestatic |
Invoke the AuthenticationRequested event, which requests authentication credentials for the server. Note: this will have no effect if already authenticated or authentication is not required for this server.
Definition at line 372 of file API.Authentication.cs.
|
static |
The collection of Agents on the server.
Definition at line 16 of file API.Collections.cs.
|
static |
The collection of Analyses on the server.
Definition at line 22 of file API.Collections.cs.
|
static |
The collection of AnalysisProfiles on the server.
Definition at line 26 of file API.Collections.cs.
|
static |
The Custom Server Header returned by valid AnalyzeRe servers.
Definition at line 22 of file API.Configuration.cs.
|
static |
The Server identity returned by valid AnalyzeRe servers.
Definition at line 19 of file API.Configuration.cs.
|
static |
The format used when transmitting DateTime information to Analyze Re servers.
Definition at line 25 of file API.Configuration.cs.
|
static |
The collection of Distributions on the server.
Definition at line 30 of file API.Collections.cs.
|
static |
The collection of EventCatalogs on the server.
Definition at line 34 of file API.Collections.cs.
|
static |
The collection of ExchangeRateProfiles on the server.
Definition at line 38 of file API.Collections.cs.
|
static |
The collection of ExchangeRateTables on the server.
Definition at line 42 of file API.Collections.cs.
|
static |
The collection of Files on the server.
Definition at line 46 of file API.Collections.cs.
|
static |
The collection of Layers on the server.
Definition at line 54 of file API.Collections.cs.
|
static |
The collection of LayerViews on the server.
Definition at line 50 of file API.Collections.cs.
|
static |
The collection of LossFilters on the server.
Definition at line 58 of file API.Collections.cs.
|
static |
The collection of LossSets on the server.
Definition at line 62 of file API.Collections.cs.
|
static |
When a temporary communication failure occurs (such as a socket error or an authentication failure for which there is a handler) this property determines how many times the client will automatically retry the same request before returning the error.
Definition at line 93 of file API.Configuration.cs.
|
static |
The collection of optimization metrics functions on the server.
Definition at line 74 of file API.Collections.cs.
|
static |
The collection of OptimizationViews on the server.
Definition at line 66 of file API.Collections.cs.
|
static |
The collection of Portfolios on the server.
Definition at line 82 of file API.Collections.cs.
|
static |
The collection of PortfolioViews on the server.
Definition at line 78 of file API.Collections.cs.
|
static |
The collection of optimization projection functions on the server.
Definition at line 70 of file API.Collections.cs.
|
static |
The collection of Simulations on the server.
Definition at line 86 of file API.Collections.cs.
|
staticgetset |
The AccessToken storing authentication information for requests made to the server.
Definition at line 48 of file API.Authentication.cs.
|
staticgetset |
The default timeout used for all simple server requests, in milliseconds.
Note: If ManagedSettingsEnabled (by default it is), changing this default has the side-effect of storing the user-setting permanently on the client machine.
Definition at line 120 of file API.Configuration.cs.
|
staticgetset |
The default timeout used when requesting a resource collection from the server, in milliseconds.
Note: If ManagedSettingsEnabled (by default it is), changing this default has the side-effect of storing the user-setting permanently on the client machine.
Definition at line 142 of file API.Configuration.cs.
|
staticget |
The Default ServerURL the API is instantiated with, as configured in the settings.
Note: Unlike some other default settings, this setting cannot be modified using this property. To change the default Server URL for all Analyze Re applications on this machine, you should configure the appropriate Settings.Default attribute.
Definition at line 210 of file API.Configuration.cs.
|
staticgetset |
By Default, the Analyze Re Client Library will automatically save and restore certain configured settings such as timeouts and credentials. Set this to false to disable these features (for instance if they cause issues for your application).
Definition at line 98 of file API.Configuration.cs.
|
staticgetset |
The maximum number of concurrent requests that can be made.
Note: Unlike many other settings, this setting is not stored to the client's local machine. To change the default degree of parallelism for all Analyze Re applications on this machine, you should configure the appropriate Settings.Default attribute.
Definition at line 104 of file API.Configuration.cs.
|
staticgetset |
The default server URL to be used for all API requests. On change, voids the current cached authentication credentials.
Note: If ManagedSettingsEnabled (by default it is), changing this default has the side-effect of storing the user-setting permanently on the client machine.
Warning: This property has side effects: When changed, the client will:
Definition at line 167 of file API.Configuration.cs.
|
staticgetset |
The UserAgent identifying the requests made by this client. This can be changed if an application wishes to better identify itself to the server.
Definition at line 78 of file API.Configuration.cs.
|
static |
An event that fires whenever authentication is requested by the server. This event can be used to prompt a user or other external source for credentials as needed, rather than hard-coding them into the application.
TODO: Authentication Requested event mechanism is flawed and should be revisited This should be a Func{args, IAccessToken}
for which there is at most one implementation per instance. This is currently muddied by the API being a static class (i.e. singleton). For now, suppress the code analysis warning about event handlers.
Definition at line 44 of file API.Authentication.cs.