Class ClientBase
Client base
Inheritance
System.Object
ClientBase
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Simplic.Cloud.API
Assembly: Simplic.Cloud.API.dll
Syntax
public abstract class ClientBase : IDisposable
Constructors
| Improve this Doc View SourceClientBase()
Initialize client base
Declaration
public ClientBase()
ClientBase(IClient)
Initialize new client base and copy important information
Declaration
public ClientBase(IClient clientBase)
Parameters
Type | Name | Description |
---|---|---|
IClient | clientBase | Client base instance |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Null check for ClientBase argument. |
ClientBase(String)
Initialize client base with custom url
Declaration
public ClientBase(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | Base url |
Fields
| Improve this Doc View SourceApiVersion
Declaration
public const string ApiVersion = "v1-0"
Field Value
Type | Description |
---|---|
System.String |
DefaultUrl
Declaration
public const string DefaultUrl = "https://cloud.simplic.io"
Field Value
Type | Description |
---|---|
System.String |
Properties
| Improve this Doc View SourceHttpClient
Gets the http client instance
Declaration
protected HttpClient HttpClient { get; }
Property Value
Type | Description |
---|---|
System.Net.Http.HttpClient |
Url
Gets the client url
Declaration
public string Url { get; set; }
Property Value
Type | Description |
---|---|
System.String |
User
Gets or sets the current jwt. Get is protected for security reason. However, the getter can be accesses by using reflection.
Declaration
public User User { get; set; }
Property Value
Type | Description |
---|---|
User |
Methods
| Improve this Doc View SourceDeleteAsync<T>(String, String, String, IDictionary<String, String>)
Get async
Declaration
protected async Task<T> DeleteAsync<T>(string api, string controller, string action, IDictionary<string, string> parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | api | Api path |
System.String | controller | Controller |
System.String | action | Action |
System.Collections.Generic.IDictionary<System.String, System.String> | parameters | List of optional parameter |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | Return model |
Type Parameters
Name | Description |
---|---|
T | Return type |
Dispose()
Dispose object
Declaration
public void Dispose()
GetAsync<T>(String, String, String, IDictionary<String, String>)
Get async
Declaration
protected async Task<T> GetAsync<T>(string api, string controller, string action, IDictionary<string, string> parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | api | Api path |
System.String | controller | Controller |
System.String | action | Action |
System.Collections.Generic.IDictionary<System.String, System.String> | parameters | List of optional parameter |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | Return model |
Type Parameters
Name | Description |
---|---|
T | Return type |
PostAsync<T, I>(String, String, String, I)
Post async
Declaration
protected async Task<T> PostAsync<T, I>(string api, string controller, string action, I model)
Parameters
Type | Name | Description |
---|---|---|
System.String | api | Api path |
System.String | controller | Controller |
System.String | action | Action |
I | model | Model to post |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | Return model |
Type Parameters
Name | Description |
---|---|
T | Return type |
I | Model type |
PostMultipartAsync(String, String, String, Byte[], IDictionary<String, String>)
Declaration
protected async Task PostMultipartAsync(string api, string controller, string action, byte[] blob, IDictionary<string, string> formData)
Parameters
Type | Name | Description |
---|---|---|
System.String | api | |
System.String | controller | |
System.String | action | |
System.Byte[] | blob | |
System.Collections.Generic.IDictionary<System.String, System.String> | formData |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
PutAsync<T, I>(String, String, String, I)
Declaration
protected async Task<T> PutAsync<T, I>(string api, string controller, string action, I model)
Parameters
Type | Name | Description |
---|---|---|
System.String | api | |
System.String | controller | |
System.String | action | |
I | model |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> |
Type Parameters
Name | Description |
---|---|
T | |
I |
Implements
System.IDisposable