Esempio n. 1
0
        /// <summary>
        /// Returns pet inventories by status Returns a map of status codes to quantities
        /// </summary>
        /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (Dictionary&lt;string, int?&gt;)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Dictionary <string, int?> > > GetInventoryAsyncWithHttpInfo()
        {
            var localVarPath = "./store/inventory";

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts);


            // authentication (api_key) required
            requestParameters.AddAuthKeyInHeader("api_key");

            // make the HTTP request
            var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                   new HttpMethod("GET"), requestParameters);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetInventory", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Dictionary <string, int?> >(localVarStatusCode,
                                                                localVarResponse.ToHeaders(),
                                                                this.Configuration.ApiClient.Deserialize <Dictionary <string, int?> >(localVarResponse)));
        }