Ejemplo n.º 1
0
        /// <summary>
        /// 查询版本信息列表
        /// </summary>
        public async Task <ShowVersionsResponse> ShowVersionsAsync(ShowVersionsRequest showVersionsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();
            string              urlPath          = HttpUtils.AddUrlPath("/", urlParam);
            SdkRequest          request          = HttpUtils.InitSdkRequest(urlPath, "application/json", showVersionsRequest);
            HttpResponseMessage response         = await DoHttpRequestAsync("GET", request);

            return(JsonUtils.DeSerialize <ShowVersionsResponse>(response));
        }
        /// <summary>
        /// 查询版本信息列表
        /// </summary>
        public ShowVersionsResponse ShowVersions(ShowVersionsRequest showVersionsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();
            string              urlPath          = HttpUtils.AddUrlPath("/", urlParam);
            SdkRequest          request          = HttpUtils.InitSdkRequest(urlPath, showVersionsRequest);
            HttpResponseMessage response         = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowVersionsResponse>(response));
        }
Ejemplo n.º 3
0
        private static void GetVersions(KmsClient kmsClient)
        {
            try
            {
                var req  = new ShowVersionsRequest();
                var resp = kmsClient.ShowVersions(req);

                Console.WriteLine(resp.HttpStatusCode);
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }