public OicqRequestTgtgt(uint uin, string password, uint ssoseq, KeyRing keyring) { _cmd = 0x0810; _subCmd = 0x09; _keyBody = new KeyBody(keyring._randKey, keyring._defaultPublicKey); _tlvBody = new TlvBody(_subCmd, uin, password, ssoseq, keyring._tgtgKey); // 構建 oicq_request PutByte(0x02); // 頭部 0x02 EnterBarrier(2, Endian.Big, 4); { PutUshortBE(8001); // 協議版本 1F 41 PutUshortBE(_cmd); PutUshortBE(1); PutUintBE(uin); PutByte(0x03); PutByte(0x87); // 加密方式id PutByte(0x00); // 永遠0 PutUintBE(2); PutUintBE(AppInfo.appClientVersion); PutUintBE(0); PutPacket(_keyBody); PutPacketEncrypted(_tlvBody, TeaCryptor.Instance, keyring._shareKey); } LeaveBarrier(); PutByte(0x03); // 尾部 0x03 }
public void GetAllTest() { // TODO: add unit test for the method 'GetAll' string appId = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value instance.GetAll(appId, body); }
public void DeleteAllCacheTest() { // TODO: add unit test for the method 'DeleteAllCache' string appId = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.DeleteAllCache(appId, body); Assert.IsInstanceOf <List <CacheRequest> > (response, "response is List<CacheRequest>"); }
public void GetAllQueuesTest() { // TODO: add unit test for the method 'GetAllQueues' string appId = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.GetAllQueues(appId, body); Assert.IsInstanceOf <List <Queue> > (response, "response is List<Queue>"); }
public void CreateCacheTest() { // TODO: add unit test for the method 'CreateCache' string appId = null; // TODO: replace null with proper value string cacheName = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.CreateCache(appId, cacheName, body); Assert.IsInstanceOf <Cache> (response, "response is Cache"); }
public void GetItemsCountTest() { // TODO: add unit test for the method 'GetItemsCount' string appId = null; // TODO: replace null with proper value string cacheName = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.GetItemsCount(appId, cacheName, body); Assert.IsInstanceOf <int?> (response, "response is int?"); }
public void GetAllItemsTest() { // TODO: add unit test for the method 'GetAllItems' string appId = null; // TODO: replace null with proper value string cacheName = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.GetAllItems(appId, cacheName, body); Assert.IsInstanceOf <List <CacheItem> > (response, "response is List<CacheItem>"); }
public void DeleteFileTest() { // TODO: add unit test for the method 'DeleteFile' string appId = null; // TODO: replace null with proper value string fileId = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.DeleteFile(appId, fileId, body); Assert.IsInstanceOf <string> (response, "response is string"); }
public void FetchFileContentTest() { // TODO: add unit test for the method 'FetchFileContent' string appId = null; // TODO: replace null with proper value string fileId = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.FetchFileContent(appId, fileId, body); Assert.IsInstanceOf <string> (response, "response is string"); }
public void GetTest() { // TODO: add unit test for the method 'Get' string tableName = null; // TODO: replace null with proper value string appId = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.Get(tableName, appId, body); Assert.IsInstanceOf <CloudTable> (response, "response is CloudTable"); }
public void GetQueueTest() { // TODO: add unit test for the method 'GetQueue' string appId = null; // TODO: replace null with proper value string queueName = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.GetQueue(appId, queueName, body); Assert.IsInstanceOf <Queue> (response, "response is Queue"); }
public void GetItemTest() { // TODO: add unit test for the method 'GetItem' string appId = null; // TODO: replace null with proper value string cacheName = null; // TODO: replace null with proper value string dataKey = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.GetItem(appId, cacheName, dataKey, body); Assert.IsInstanceOf <string> (response, "response is string"); }
public void DeleteMessageTest() { // TODO: add unit test for the method 'DeleteMessage' string appId = null; // TODO: replace null with proper value string queueName = null; // TODO: replace null with proper value string messageId = null; // TODO: replace null with proper value KeyBody body = null; // TODO: replace null with proper value var response = instance.DeleteMessage(appId, queueName, messageId, body); Assert.IsInstanceOf <List <QueueMessage> > (response, "response is List<QueueMessage>"); }
/// <summary> /// count items in a cloud cache count items in a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>int?</returns> public int? GetItemsCount (string appId, string cacheName, KeyBody body) { ApiResponse<int?> localVarResponse = GetItemsCountWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
/// <summary> /// get item from a cloud cache get item from a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="dataKey">key under which data should be got in cache</param> /// <param name="body">master key of app</param> /// <returns>string</returns> public string GetItem (string appId, string cacheName, string dataKey, KeyBody body) { ApiResponse<string> localVarResponse = GetItemWithHttpInfo(appId, cacheName, dataKey, body); return localVarResponse.Data; }
/// <summary> /// get item from a cloud cache get item from a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="dataKey">key under which data should be got in cache</param> /// <param name="body">master key of app</param> /// <returns>Task of string</returns> public async System.Threading.Tasks.Task<string> GetItemAsync (string appId, string cacheName, string dataKey, KeyBody body) { ApiResponse<string> localVarResponse = await GetItemAsyncWithHttpInfo(appId, cacheName, dataKey, body); return localVarResponse.Data; }
/// <summary> /// fetch file content /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">ID of app</param> /// <param name="fileId">file id</param> /// <param name="body">request body (optional)</param> /// <returns>Task of ApiResponse (string)</returns> public async System.Threading.Tasks.Task<ApiResponse<string>> FetchFileContentAsyncWithHttpInfo (string appId, string fileId, KeyBody body = null) { // verify the required parameter 'appId' is set if (appId == null) throw new ApiException(400, "Missing required parameter 'appId' when calling FetchFileContent"); // verify the required parameter 'fileId' is set if (fileId == null) throw new ApiException(400, "Missing required parameter 'fileId' when calling FetchFileContent"); var localVarPath = "file/{app_id}/{file_id}"; var localVarPathParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>(); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary<String, String>(); var localVarFileParams = new Dictionary<String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "application/octet-stream" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json localVarPathParams.Add("format", "json"); if (appId != null) localVarPathParams.Add("app_id", Configuration.ApiClient.ParameterToString(appId)); // path parameter if (fileId != null) localVarPathParams.Add("file_id", Configuration.ApiClient.ParameterToString(fileId)); // path parameter if (body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (localVarStatusCode >= 400) throw new ApiException (localVarStatusCode, "Error calling FetchFileContent: " + localVarResponse.Content, localVarResponse.Content); else if (localVarStatusCode == 0) throw new ApiException (localVarStatusCode, "Error calling FetchFileContent: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); return new ApiResponse<string>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); }
/// <summary> /// get info about a CloudCache get info about a CloudCache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>Cache</returns> public Cache GetCacheInfo (string appId, string cacheName, KeyBody body) { ApiResponse<Cache> localVarResponse = GetCacheInfoWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
/// <summary> /// clear all items from a cloud cache clear all items from a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>Task of List<CacheRequest></returns> public async System.Threading.Tasks.Task<List<CacheRequest>> ClearCacheAsync (string appId, string cacheName, KeyBody body) { ApiResponse<List<CacheRequest>> localVarResponse = await ClearCacheAsyncWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
/// <summary> /// create a cloud cache create a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>ApiResponse of Cache</returns> public ApiResponse< Cache > CreateCacheWithHttpInfo (string appId, string cacheName, KeyBody body) { // verify the required parameter 'appId' is set if (appId == null) throw new ApiException(400, "Missing required parameter 'appId' when calling CloudCacheApi->CreateCache"); // verify the required parameter 'cacheName' is set if (cacheName == null) throw new ApiException(400, "Missing required parameter 'cacheName' when calling CloudCacheApi->CreateCache"); // verify the required parameter 'body' is set if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CloudCacheApi->CreateCache"); var localVarPath = "cache/{app_id}/{cache_name}/create"; var localVarPathParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>(); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary<String, String>(); var localVarFileParams = new Dictionary<String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json localVarPathParams.Add("format", "json"); if (appId != null) localVarPathParams.Add("app_id", Configuration.ApiClient.ParameterToString(appId)); // path parameter if (cacheName != null) localVarPathParams.Add("cache_name", Configuration.ApiClient.ParameterToString(cacheName)); // path parameter if (body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (localVarStatusCode >= 400) throw new ApiException (localVarStatusCode, "Error calling CreateCache: " + localVarResponse.Content, localVarResponse.Content); else if (localVarStatusCode == 0) throw new ApiException (localVarStatusCode, "Error calling CreateCache: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); return new ApiResponse<Cache>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Cache) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Cache))); }
/// <summary> /// delete all CloudCaches delete all CloudCaches /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="body">master key of app</param> /// <returns>Task of List<CacheRequest></returns> public async System.Threading.Tasks.Task<List<CacheRequest>> DeleteAllCacheAsync (string appId, KeyBody body) { ApiResponse<List<CacheRequest>> localVarResponse = await DeleteAllCacheAsyncWithHttpInfo(appId, body); return localVarResponse.Data; }
/// <summary> /// delete a CloudCache delete a CloudCache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>CacheRequest</returns> public CacheRequest DeleteCache (string appId, string cacheName, KeyBody body) { ApiResponse<CacheRequest> localVarResponse = DeleteCacheWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
public void Init() { instance = new KeyBody(); }
/// <summary> /// delete all CloudCaches delete all CloudCaches /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="body">master key of app</param> /// <returns>List<CacheRequest></returns> public List<CacheRequest> DeleteAllCache (string appId, KeyBody body) { ApiResponse<List<CacheRequest>> localVarResponse = DeleteAllCacheWithHttpInfo(appId, body); return localVarResponse.Data; }
/// <summary> /// deletes file /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">ID of app</param> /// <param name="fileId">file id</param> /// <param name="body">request body (optional)</param> /// <returns>string</returns> public string DeleteFile (string appId, string fileId, KeyBody body = null) { ApiResponse<string> localVarResponse = DeleteFileWithHttpInfo(appId, fileId, body); return localVarResponse.Data; }
/// <summary> /// fetch file content /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">ID of app</param> /// <param name="fileId">file id</param> /// <param name="body">request body (optional)</param> /// <returns>string</returns> public string FetchFileContent (string appId, string fileId, KeyBody body = null) { ApiResponse<string> localVarResponse = FetchFileContentWithHttpInfo(appId, fileId, body); return localVarResponse.Data; }
/// <summary> /// fetch file content /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">ID of app</param> /// <param name="fileId">file id</param> /// <param name="body">request body (optional)</param> /// <returns>Task of string</returns> public async System.Threading.Tasks.Task<string> FetchFileContentAsync (string appId, string fileId, KeyBody body = null) { ApiResponse<string> localVarResponse = await FetchFileContentAsyncWithHttpInfo(appId, fileId, body); return localVarResponse.Data; }
/// <summary> /// count items in a cloud cache count items in a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>Task of int?</returns> public async System.Threading.Tasks.Task<int?> GetItemsCountAsync (string appId, string cacheName, KeyBody body) { ApiResponse<int?> localVarResponse = await GetItemsCountAsyncWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
/// <summary> /// get all CloudCaches get all CloudCaches /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="body">master key of app</param> /// <returns>List<Cache></returns> public List<Cache> GetAllCache (string appId, KeyBody body) { ApiResponse<List<Cache>> localVarResponse = GetAllCacheWithHttpInfo(appId, body); return localVarResponse.Data; }
/// <summary> /// clear all items from a cloud cache clear all items from a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>List<CacheRequest></returns> public List<CacheRequest> ClearCache (string appId, string cacheName, KeyBody body) { ApiResponse<List<CacheRequest>> localVarResponse = ClearCacheWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
/// <summary> /// get all items from a cloud cache get all items from a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>List<CacheItem></returns> public List<CacheItem> GetAllItems (string appId, string cacheName, KeyBody body) { ApiResponse<List<CacheItem>> localVarResponse = GetAllItemsWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
/// <summary> /// create a cloud cache create a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>Cache</returns> public Cache CreateCache (string appId, string cacheName, KeyBody body) { ApiResponse<Cache> localVarResponse = CreateCacheWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
/// <summary> /// get all items from a cloud cache get all items from a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>Task of List<CacheItem></returns> public async System.Threading.Tasks.Task<List<CacheItem>> GetAllItemsAsync (string appId, string cacheName, KeyBody body) { ApiResponse<List<CacheItem>> localVarResponse = await GetAllItemsAsyncWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
/// <summary> /// create a cloud cache create a cloud cache /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">Id of CloudApp</param> /// <param name="cacheName">Name of cache</param> /// <param name="body">master key of app</param> /// <returns>Task of Cache</returns> public async System.Threading.Tasks.Task<Cache> CreateCacheAsync (string appId, string cacheName, KeyBody body) { ApiResponse<Cache> localVarResponse = await CreateCacheAsyncWithHttpInfo(appId, cacheName, body); return localVarResponse.Data; }
public void Init() { instance = new KeyBody(); }