API client is mainly responible for making the HTTP call to the API backend.
예제 #1
0
        /// <summary>
        /// Initializes a new instance of the Configuration class with different settings
        /// </summary>
        /// <param name="apiClient">Api client</param>
        /// <param name="defaultHeader">Dictionary of default HTTP header</param>
        /// <param name="username">Username</param>
        /// <param name="password">Password</param>
        /// <param name="accessToken">accessToken</param>
        /// <param name="apiKey">Dictionary of API key</param>
        /// <param name="apiKeyPrefix">Dictionary of API key prefix</param>
        /// <param name="tempFolderPath">Temp folder path</param>
        /// <param name="dateTimeFormat">DateTime format string</param>
        /// <param name="timeout">HTTP connection timeout (in milliseconds)</param>
        public Configuration(ApiClient apiClient = null,
                             Dictionary<String, String> defaultHeader = null,
                             string username = null,
                             string password = null,
                             string accessToken = null,
                             Dictionary<String, String> apiKey = null,
                             Dictionary<String, String> apiKeyPrefix = null,
                             string tempFolderPath = null,
                             string dateTimeFormat = null,
                             int timeout = 100000
                            )
        {
            setApiClientUsingDefault(apiClient);

            Username = username;
            Password = password;
            AccessToken = accessToken;

            if (defaultHeader != null)
                DefaultHeader = defaultHeader;
            if (apiKey != null)
                ApiKey = apiKey;
            if (apiKeyPrefix != null)
                ApiKeyPrefix = apiKeyPrefix;

            TempFolderPath = tempFolderPath;
            DateTimeFormat = dateTimeFormat;
            Timeout = timeout;
        }
예제 #2
0
        /// <summary>
        /// Set the ApiClient using Default or ApiClient instance.
        /// </summary>
        /// <param name="apiClient">An instance of ApiClient.</param>
        /// <returns></returns>
        public void setApiClientUsingDefault(ApiClient apiClient = null)
        {
            if (apiClient == null)
            {
                if (Default != null && Default.ApiClient == null)
                    Default.ApiClient = new ApiClient();

                ApiClient = Default != null ? Default.ApiClient : new ApiClient();
            }
            else
            {
                if (Default != null && Default.ApiClient == null)
                    Default.ApiClient = apiClient;

                ApiClient = apiClient;
            }
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the Configuration class.
 /// </summary>
 /// <param name="apiClient">Api client.</param>
 public Configuration(ApiClient apiClient)
 {
     setApiClientUsingDefault(apiClient);
 }