本文整理汇总了C#中IO.Swagger.Client.ApiClient类的典型用法代码示例。如果您正苦于以下问题:C# ApiClient类的具体用法?C# ApiClient怎么用?C# ApiClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApiClient类属于IO.Swagger.Client命名空间,在下文中一共展示了ApiClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AuthenticationMethodsApi
/// <summary>
/// Initializes a new instance of the <see cref="AuthenticationMethodsApi"/> class.
/// </summary>
/// <param name="apiClient"> an instance of ApiClient (optional)</param>
/// <returns></returns>
public AuthenticationMethodsApi(ApiClient apiClient = null)
{
if (apiClient == null) // use the default one in Configuration
this.ApiClient = Configuration.DefaultApiClient;
else
this.ApiClient = apiClient;
}
示例2: VariableUserSourceApi
/// <summary>
/// Initializes a new instance of the <see cref="VariableUserSourceApi"/> class.
/// </summary>
/// <param name="apiClient"> an instance of ApiClient (optional)</param>
/// <returns></returns>
public VariableUserSourceApi(ApiClient apiClient = null)
{
if (apiClient == null) // use the default one in Configuration
this.ApiClient = Configuration.DefaultApiClient;
else
this.ApiClient = apiClient;
}
示例3: StoreApi
/// <summary>
/// Initializes a new instance of the <see cref="StoreApi"/> class.
/// </summary>
/// <param name="apiClient"> an instance of ApiClient (optional)</param>
/// <returns></returns>
public StoreApi(ApiClient apiClient = null)
{
if (apiClient == null) // use the default one in Configuration
this.ApiClient = Configuration.DefaultApiClient;
else
this.ApiClient = apiClient;
}
示例4: ConversionApi
/// <summary>
/// Initializes a new instance of the <see cref="ConversionApi"/> class.
/// </summary>
/// <param name="apiClient"> an instance of ApiClient (optional)
/// <returns></returns>
public ConversionApi(ApiClient apiClient = null) {
if (apiClient == null) { // use the default one in Configuration
this.apiClient = Configuration.apiClient;
} else {
this.apiClient = apiClient;
}
}
示例5: Configuration
/// <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>
/// <param name="userAgent">HTTP user agent</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,
string userAgent = "Swagger-Codegen/1.0.0/csharp"
)
{
setApiClientUsingDefault(apiClient);
Username = username;
Password = password;
AccessToken = accessToken;
UserAgent = userAgent;
if (defaultHeader != null)
DefaultHeader = defaultHeader;
if (apiKey != null)
ApiKey = apiKey;
if (apiKeyPrefix != null)
ApiKeyPrefix = apiKeyPrefix;
TempFolderPath = tempFolderPath;
DateTimeFormat = dateTimeFormat;
Timeout = timeout;
}
示例6: Configuration
/// <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
)
{
if (apiClient == null)
ApiClient = ApiClient.Default;
else
ApiClient = 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;
}
示例7: TestParameterToStringWithTimeZoneForDateTime
public void TestParameterToStringWithTimeZoneForDateTime ()
{
ApiClient api = new ApiClient ();
// test datetime with a time zone
DateTimeOffset dateWithTz = DateTimeOffset.Parse("2008-04-10T13:30:00.0000000-04:00", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual("2008-04-10T13:30:00.0000000-04:00", api.ParameterToString(dateWithTz));
}
示例8: Main
static void Main(string[] args)
{
Configuration.ApiKey.Add("_apikey", "ef0eaa14199a40acb6d21099a5ef6b5e5fe650c545317c92eb31cd5cc33ada7112e337c68d642d3e336a19ac2bbf8eb008adceda71366d9fcf91b48cb13b1c8796dce23c3edaa03a415326818b9b0cf2");
ApiClient client = new ApiClient();
MagicMethodsApi mc = new MagicMethodsApi(client);
var result= mc.Magic("http://vashmagazin.ua/nerukhomist/kvartyry/", true, 1, "");
}
示例9: TestParameterToString_DateTime_WithCustomFormat
public void TestParameterToString_DateTime_WithCustomFormat()
{
// Setup the DateTimeFormat across all of the calls
Configuration.DateTimeFormat = "dd/MM/yy HH:mm:ss";
ApiClient api = new ApiClient();
// test datetime
DateTime dateUtc = DateTime.Parse("2009-06-15 20:45:30Z", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual("15/06/09 20:45:30", api.ParameterToString(dateUtc));
}
示例10: AssetServerTests
public AssetServerTests()
{
client = new ApiClient(Resource.Base);
client.AddDefaultHeader("Cache-Control", "no-cache");
api = new AssetServersApi(client);
httpClient = new HttpClient();
httpClient.BaseAddress = new Uri(Resource.Base);
httpClient.DefaultRequestHeaders.Add("Cache-Control", "no-cache");
}
示例11: TestParameterToStringForDateTimeWithUFormat
public void TestParameterToStringForDateTimeWithUFormat ()
{
// Setup the DateTimeFormat across all of the calls
Configuration.Default.DateTimeFormat = "u";
ApiClient api = new ApiClient();
// test datetime
DateTime dateUtc = DateTime.Parse("2009-06-15 20:45:30Z", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual("2009-06-15 20:45:30Z", api.ParameterToString(dateUtc));
}
示例12: TestSelectHeaderContentType
public void TestSelectHeaderContentType ()
{
ApiClient api = new ApiClient ();
String[] contentTypes = new String[] { "application/json", "application/xml" };
Assert.AreEqual("application/json", api.SelectHeaderContentType (contentTypes));
contentTypes = new String[] { "application/xml" };
Assert.AreEqual("application/xml", api.SelectHeaderContentType (contentTypes));
contentTypes = new String[] {};
Assert.IsNull(api.SelectHeaderContentType (contentTypes));
}
示例13: TestParameterToString
public void TestParameterToString ()
{
ApiClient api = new ApiClient ();
// test array of string
List<string> statusList = new List<String>(new String[] {"available", "sold"});
Assert.AreEqual("available,sold", api.ParameterToString (statusList));
// test array of int
List<int> numList = new List<int>(new int[] {1, 37});
Assert.AreEqual("1,37", api.ParameterToString (numList));
}
示例14: TestParameterToStringForDateTime
public void TestParameterToStringForDateTime ()
{
ApiClient api = new ApiClient ();
// test datetime
DateTime dateUtc = DateTime.Parse ("2008-04-10T13:30:00.0000000z", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual ("2008-04-10T13:30:00.0000000Z", api.ParameterToString (dateUtc));
// test datetime with no timezone
DateTime dateWithNoTz = DateTime.Parse ("2008-04-10T13:30:00.000", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual ("2008-04-10T13:30:00.0000000", api.ParameterToString (dateWithNoTz));
}
示例15: FeatureApi
/// <summary>
/// Initializes a new instance of the <see cref="FeatureApi"/> class.
/// </summary>
/// <param name="apiClient"> an instance of ApiClient (optional)</param>
/// <returns></returns>
public FeatureApi(ApiClient apiClient = null)
{
ApiClient = apiClient ?? Configuration.DefaultApiClient;
}