public static void SetClsClient(string key, TencentCloudClsNativeConfig nativeConfig) { if (string.IsNullOrWhiteSpace(key)) { throw new ArgumentNullException(nameof(key)); } if (nativeConfig == null) { throw new ArgumentNullException(nameof(nativeConfig)); } nativeConfig.Check(); if (key == Constants.GeneralClientKey) { throw new ArgumentException($"Key cannot be same as '{Constants.GeneralClientKey}'."); } var authorization = new Authorization { SecretId = nativeConfig.SecretId, SecretKey = nativeConfig.SecretKey, }; var client = new TencentCloudClsClient(authorization, new TimeSpan(0, 0, nativeConfig.RequestTimeout)); SetClsClient(key, nativeConfig.RequestUri, client, nativeConfig.TopicId, nativeConfig.IsGeneralClient); }
public static void SetClsClient(string key, string requestUri, string secretId, string secretKey, string topicId, int timeout, bool asGeneral = false) { var authorization = new Authorization { SecretId = secretId, SecretKey = secretKey, }; var client = new TencentCloudClsClient(authorization, new TimeSpan(0, 0, timeout)); SetClsClient(key, requestUri, client, topicId, asGeneral); }