C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
CommandSubResource.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using RestSharp;
3
4namespace AnalyzeRe.APITypes
5{
9 {
10 #region Constructors
16 #endregion Constructors
17
18 #region REST Methods
27 public IRestResponse POST(int? timeout = null, bool throwOnError = true,
29 {
30 return EmptyRequestHelper(Method.POST, timeout, throwOnError, requestParameters);
31 }
32
40 public IRestResponse GET(int? timeout = null, bool throwOnError = true,
42 {
43 return EmptyRequestHelper(Method.GET, timeout, throwOnError, requestParameters);
44 }
45
46 private IRestResponse EmptyRequestHelper(Method method, int? timeout, bool throwOnError,
48 {
51 // Use ExtractRestResponse to force an exception if the response code was unsuccessful.
52 if (throwOnError)
54 return response;
55 }
56 #endregion REST Methods
57 }
58}
Describes a command sub-resource available off a resource which can be POSTed to with no data to invo...
IRestResponse GET(int? timeout=null, bool throwOnError=true, IEnumerable< Parameter > requestParameters=null)
Performs an empty GET at this endpoint (executing the command). Throws an APIRequestException if the ...
IRestResponse POST(int? timeout=null, bool throwOnError=true, IEnumerable< Parameter > requestParameters=null)
Performs an empty POST at this endpoint (executing the command). Throws an APIRequestException if the...
CommandSubResource(IEndpoint owner, string relativePath)
Defines a new endpoint off of another.
Describes a collection of resources which can be listed.
Describes an additional sub-resource available off a resource which is not actually a property of tha...
void ValidateOwnerHasId()
Verifies the owner exists and has been POSTed, ensuring that it is safe to invoke actions on this Sub...
string Path
The relative path to this endpoint from the root server URL.
API methods / requests made available to the user.
static object ExtractRestResponse(IRestResponse response, Type deserializeType)
Attempts to deserialize an IRestResponse content to the specified run-time type.
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.
Describes an endpoint on the server that can be interacted with. Inheriting from this interface means...
Definition IEndpoint.cs:10