C# Class VirtoCommerce.SwaggerApiClient.Client.ApiClient

API client is mainly responible for making the HTTP call to the API backend.
Afficher le fichier Open project: VirtoCommerce/vc-internal Class Usage Examples

Méthodes publiques

Méthode Description
AddDefaultHeader ( string key, string value ) : void

Add default header.

ApiClient ( String basePath = "http://localhost/admin" ) : System

Initializes a new instance of the ApiClient class.

Base64Encode ( string text ) : string

Encode string in base64 format.

CallApi ( String path, RestSharp method, String>.Dictionary queryParams, String postBody, String>.Dictionary headerParams, String>.Dictionary formParams, FileParameter>.Dictionary fileParams, String>.Dictionary pathParams, String authSettings ) : Object

Makes the HTTP request (Sync).

CallApiAsync ( String path, RestSharp method, String>.Dictionary queryParams, String postBody, String>.Dictionary headerParams, String>.Dictionary formParams, FileParameter>.Dictionary fileParams, String>.Dictionary pathParams, String authSettings ) : System.Threading.Tasks.Task

Makes the asynchronous HTTP request.

ConvertType ( dynamic source, Type dest ) : dynamic

Dynamically cast the object into target type. Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast

Deserialize ( string content, Type type, IList headers = null ) : object

Deserialize the JSON string into a proper object.

EscapeString ( string str ) : string

Escape string (url-encoded).

GetApiKeyWithPrefix ( string apiKeyIdentifier ) : string

Get the API key with prefix.

ParameterToFile ( string name, Stream stream ) : FileParameter

Create FileParameter based on Stream.

ParameterToString ( object obj ) : string

If parameter is DateTime, output in ISO8601 format. If parameter is a list, join the list with ",". Otherwise just return the string.

SelectHeaderAccept ( String accepts ) : String

Select the Accept header's value from the given accepts array: if JSON exists in the given array, use it; otherwise use all of them (joining into a string)

Serialize ( object obj ) : string

Serialize an object into JSON string.

UpdateParamsForAuth ( String>.Dictionary queryParams, String>.Dictionary headerParams, string authSettings ) : void

Update parameters based on authentication.

Private Methods

Méthode Description
PrepareRequest ( String path, RestSharp method, String>.Dictionary queryParams, String postBody, String>.Dictionary headerParams, String>.Dictionary formParams, FileParameter>.Dictionary fileParams, String>.Dictionary pathParams, String authSettings ) : RestRequest

Method Details

AddDefaultHeader() public méthode

Add default header.
public AddDefaultHeader ( string key, string value ) : void
key string Header field name.
value string Header field value.
Résultat void

ApiClient() public méthode

Initializes a new instance of the ApiClient class.
public ApiClient ( String basePath = "http://localhost/admin" ) : System
basePath String The base path.
Résultat System

Base64Encode() public static méthode

Encode string in base64 format.
public static Base64Encode ( string text ) : string
text string String to be encoded.
Résultat string

CallApi() public méthode

Makes the HTTP request (Sync).
public CallApi ( String path, RestSharp method, String>.Dictionary queryParams, String postBody, String>.Dictionary headerParams, String>.Dictionary formParams, FileParameter>.Dictionary fileParams, String>.Dictionary pathParams, String authSettings ) : Object
path String URL path.
method RestSharp HTTP method.
queryParams String>.Dictionary Query parameters.
postBody String HTTP body (POST request).
headerParams String>.Dictionary Header parameters.
formParams String>.Dictionary Form parameters.
fileParams FileParameter>.Dictionary File parameters.
pathParams String>.Dictionary Path parameters.
authSettings String Authentication settings.
Résultat Object

CallApiAsync() public méthode

Makes the asynchronous HTTP request.
public CallApiAsync ( String path, RestSharp method, String>.Dictionary queryParams, String postBody, String>.Dictionary headerParams, String>.Dictionary formParams, FileParameter>.Dictionary fileParams, String>.Dictionary pathParams, String authSettings ) : System.Threading.Tasks.Task
path String URL path.
method RestSharp HTTP method.
queryParams String>.Dictionary Query parameters.
postBody String HTTP body (POST request).
headerParams String>.Dictionary Header parameters.
formParams String>.Dictionary Form parameters.
fileParams FileParameter>.Dictionary File parameters.
pathParams String>.Dictionary Path parameters.
authSettings String Authentication settings.
Résultat System.Threading.Tasks.Task

ConvertType() public static méthode

Dynamically cast the object into target type. Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast
public static ConvertType ( dynamic source, Type dest ) : dynamic
source dynamic Object to be casted
dest System.Type Target type
Résultat dynamic

Deserialize() public méthode

Deserialize the JSON string into a proper object.
public Deserialize ( string content, Type type, IList headers = null ) : object
content string HTTP body (e.g. string, JSON).
type System.Type Object type.
headers IList
Résultat object

EscapeString() public méthode

Escape string (url-encoded).
public EscapeString ( string str ) : string
str string String to be escaped.
Résultat string

GetApiKeyWithPrefix() public méthode

Get the API key with prefix.
public GetApiKeyWithPrefix ( string apiKeyIdentifier ) : string
apiKeyIdentifier string API key identifier (authentication scheme).
Résultat string

ParameterToFile() public méthode

Create FileParameter based on Stream.
public ParameterToFile ( string name, Stream stream ) : FileParameter
name string Parameter name.
stream Stream Input stream.
Résultat RestSharp.FileParameter

ParameterToString() public méthode

If parameter is DateTime, output in ISO8601 format. If parameter is a list, join the list with ",". Otherwise just return the string.
public ParameterToString ( object obj ) : string
obj object The parameter (header, path, query, form).
Résultat string

SelectHeaderAccept() public méthode

Select the Accept header's value from the given accepts array: if JSON exists in the given array, use it; otherwise use all of them (joining into a string)
public SelectHeaderAccept ( String accepts ) : String
accepts String The accepts array to select from.
Résultat String

Serialize() public méthode

Serialize an object into JSON string.
public Serialize ( object obj ) : string
obj object Object.
Résultat string

UpdateParamsForAuth() public méthode

Update parameters based on authentication.
public UpdateParamsForAuth ( String>.Dictionary queryParams, String>.Dictionary headerParams, string authSettings ) : void
queryParams String>.Dictionary Query parameters.
headerParams String>.Dictionary Header parameters.
authSettings string Authentication settings.
Résultat void