C# Client Library
A C# Client Library for the AnalyzeRe REST API
|
Base interface for all reference entities. More...
Public Member Functions | |
T | GetValue (IEnumerable< Parameter > requestParameters=null, int? timeout=null, bool updateCache=false) |
Gets the resource that this reference refers to by requesting it from the server. | |
void | Resolve (IEnumerable< Parameter > requestParameters=null, int? timeout=null, bool updateCache=false) |
Resolve this reference by retrieving the referenced object. If this reference is already resolved, this method does nothing. To refresh the resolved object (e.g. if the referenced object is mutable and might have changed) you can set updateCache to true. | |
T | ShallowCopy< T > () |
Create a shallow copy of this object. | |
Properties | |
string | CollectionName [get] |
The name of the collection at which this resource resides. | |
string | href [get] |
The HREF that can be used to retrieve the object being referred to. | |
string | ref_id [get] |
The id of the object being referred to. | |
string | reference_type [get] |
In cases where a model can reference resources belonging to one of a number of collections, this property is used to indicate what type of resource the collection refers to. | |
bool | resolved [get] |
Indicates whether the reference has been resolved and the value is available. | |
Type | ResourceType [get] |
Returns the runtime type of resource this reference refers to, or the generic type parameter T if unresolved. | |
T | Value [get] |
Returns the resolved object being referred to. | |
Base interface for all reference entities.
Interface which should be used for all Reference{T} references to ensure covariance can be used. e.g.: Ensures that the assignment IReference{BaseType} layer = new Reference{DerivedType} is possible.
T | : | IAPIResource |
Definition at line 12 of file IReference[T].cs.
T AnalyzeRe.IReference< out T >.GetValue | ( | IEnumerable< Parameter > | requestParameters = null , |
int? | timeout = null , |
||
bool | updateCache = false |
||
) |
Gets the resource that this reference refers to by requesting it from the server.
requestParameters | Optional - Additional parameters to include in the GET request resolving the resource, only used if the resource is not already resolved, or if updateCache is set to true. |
timeout | Optional (Default: no timeout) - The desired request timeout (in milliseconds) after which the request will time out. |
updateCache | Optional (Default: false) - Set to true to ignore the previously resolved reference value (if any) and retrieve an updated copy of the resource from the server. If false, and this reference was previously resolved, a reference to the previously resolved resource will be returned. |
RequestTimeoutException | If the server takes longer than timeout milliseconds to return the resource. |
void AnalyzeRe.IReference< out T >.Resolve | ( | IEnumerable< Parameter > | requestParameters = null , |
int? | timeout = null , |
||
bool | updateCache = false |
||
) |
Resolve this reference by retrieving the referenced object. If this reference is already resolved, this method does nothing. To refresh the resolved object (e.g. if the referenced object is mutable and might have changed) you can set updateCache to true.
requestParameters | Optional - Additional parameters to include in the GET request resolving the resource, only used if the resource is not already resolved. |
timeout | Optional (Default: no timeout) - The desired request timeout (in milliseconds) after which the request will time out. |
updateCache | Optional (Default: false) - Set to true to ignore any previously resolved reference value (if any) and re-retrieve an updated copy of the resource from the server. If false, and this reference was previously resolved, a reference to the previously resolved resource will be returned. |
RequestTimeoutException | If the server takes longer than timeout milliseconds to return the resource. |
|
inherited |
Create a shallow copy of this object.
Implemented in AnalyzeRe.APIType.
T | : | IAPIType |
|
get |
The name of the collection at which this resource resides.
Definition at line 27 of file IReference[T].cs.
|
get |
The HREF that can be used to retrieve the object being referred to.
Implemented in AnalyzeRe.APITypes.Reference.
Definition at line 22 of file IReference.cs.
|
get |
The id of the object being referred to.
Implemented in AnalyzeRe.APITypes.Reference.
Definition at line 17 of file IReference.cs.
|
get |
In cases where a model can reference resources belonging to one of a number of collections, this property is used to indicate what type of resource the collection refers to.
Implemented in AnalyzeRe.APITypes.Reference.
Definition at line 13 of file IReference.cs.
|
get |
Indicates whether the reference has been resolved and the value is available.
Definition at line 16 of file IReference[T].cs.
|
get |
Returns the runtime type of resource this reference refers to, or the generic type parameter T if unresolved.
Definition at line 32 of file IReference[T].cs.
|
get |
Returns the resolved object being referred to.
Definition at line 23 of file IReference[T].cs.