• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Client.ApiClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IO.Swagger.Client.ApiClient的典型用法代码示例。如果您正苦于以下问题:C# ApiClient类的具体用法?C# ApiClient怎么用?C# ApiClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ApiClient类属于IO.Swagger.Client命名空间,在下文中一共展示了ApiClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:Ma3yTa,项目名称:ImportIOClient,代码行数:12,代码来源:AuthenticationMethodsApi.cs


示例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;
 }
开发者ID:QuantiModo,项目名称:quantimodo-sdk-CsharpDotNet2,代码行数:12,代码来源:VariableUserSourceApi.cs


示例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;
 }
开发者ID:Roustalski,项目名称:swagger-codegen,代码行数:12,代码来源:StoreApi.cs


示例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;
   }
 }
开发者ID:onlineconvert,项目名称:onlineconvert-api-sdk-csharp,代码行数:12,代码来源:ConversionApi.cs


示例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;
        }
开发者ID:expectedbehavior,项目名称:swagger-codegen,代码行数:45,代码来源:Configuration.cs


示例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;
        }
开发者ID:anuchandy,项目名称:swagger-codegen,代码行数:45,代码来源:Configuration.cs


示例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));
		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:7,代码来源:ApiClientTests.cs


示例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, "");
        }
开发者ID:Ma3yTa,项目名称:ImportIOClient,代码行数:9,代码来源:Program.cs


示例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));
        }
开发者ID:romerod,项目名称:swagger-codegen,代码行数:10,代码来源:TestApiClient.cs


示例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");
        }
开发者ID:bzshang,项目名称:piwebapi-c-sharp-client-tests,代码行数:10,代码来源:AssetServerTests.cs


示例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));
		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:10,代码来源:ApiClientTests.cs


示例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));	
		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:12,代码来源:ApiClientTests.cs


示例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));
		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:12,代码来源:ApiClientTests.cs


示例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));
		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:12,代码来源:ApiClientTests.cs


示例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;
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:9,代码来源:FeatureApi.cs


示例16: AssetDatabasesApi

 /// <summary>
 /// Initializes a new instance of the <see cref="AssetDatabasesApi"/> class.
 /// </summary>
 /// <param name="apiClient"> an instance of ApiClient (optional)</param>
 /// <returns></returns>
 public AssetDatabasesApi(ApiClient apiClient = null)
 {
     if (apiClient == null) // use the default one in Configuration
         this.ApiClient = Configuration.DefaultApiClient; 
     else
         this.ApiClient = apiClient;
 }
开发者ID:bzshang,项目名称:piwebapi-c-sharp-client-tests,代码行数:12,代码来源:AssetDatabasesApi.cs


示例17: TestApiClientInstance

		public void TestApiClientInstance ()
		{
			PetApi p1 = new PetApi ();
			PetApi p2 = new PetApi ();

			Configuration c1 = new Configuration (); // using default ApiClient
			PetApi p3 = new PetApi (c1);

			ApiClient a1 = new ApiClient();
			Configuration c2 = new Configuration (a1); // using "a1" as the ApiClient
			PetApi p4 = new PetApi (c2);


			// ensure both using the same default ApiClient
			Assert.AreSame(p1.Configuration.ApiClient, p2.Configuration.ApiClient);
			Assert.AreSame(p1.Configuration.ApiClient, Configuration.Default.ApiClient);

			// ensure both using the same default ApiClient
			Assert.AreSame(p3.Configuration.ApiClient, c1.ApiClient);
			Assert.AreSame(p3.Configuration.ApiClient, Configuration.Default.ApiClient);

			// ensure it's not using the default ApiClient
			Assert.AreSame(p4.Configuration.ApiClient, c2.ApiClient);
			Assert.AreNotSame(p4.Configuration.ApiClient, Configuration.Default.ApiClient);

		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:26,代码来源:ApiClientTests.cs


示例18: setApiClientUsingDefault

        /// <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;
            }
        }
开发者ID:expectedbehavior,项目名称:swagger-codegen,代码行数:22,代码来源:Configuration.cs


示例19: TestUsage

		public void TestUsage ()
		{
			// basic use case using default base URL
			PetApi p1 = new PetApi (); 
			Assert.AreSame (p1.Configuration, Configuration.Default, "PetApi should use default configuration");

			// using a different base URL
			PetApi p2 = new PetApi ("http://new-base-url.com/");
			Assert.AreEqual (p2.Configuration.ApiClient.RestClient.BaseUrl.ToString(), "http://new-base-url.com/");

			// using a different configuration
			Configuration c1 = new Configuration ();
			PetApi p3 = new PetApi (c1);
			Assert.AreSame (p3.Configuration, c1);

			// using a different base URL via a new ApiClient
			ApiClient a1 = new ApiClient ("http://new-api-client.com");
			Configuration c2 = new Configuration (a1);
			PetApi p4 = new PetApi (c2);
			Assert.AreSame (p4.Configuration.ApiClient, a1);
		}
开发者ID:Roustalski,项目名称:swagger-codegen,代码行数:21,代码来源:TestConfiguration.cs


示例20: Init

 public void Init(string server)
 {
     this.subscriptions = new Dictionary<string, Subscription>();
     this.server = server;
     client = new ApiClient(server + "/api");            
     layers = new LayerApi(client);
     features = new FeatureApi(client); 
     resources = new ResourceApi(client);           
     InitSocketConnection();
     //TestApis();
     
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:12,代码来源:Api.cs



注:本文中的IO.Swagger.Client.ApiClient类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Model.Pet类代码示例发布时间:2022-05-26
下一篇:
C# Api.PetApi类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap