/// <summary> /// Search stores /// </summary> /// <param name="criteria"></param> /// <returns>ApiResponse of VirtoCommerceStoreModuleWebModelSearchResult</returns> public ApiResponse< VirtoCommerceStoreModuleWebModelSearchResult > StoreModuleSearchStoresWithHttpInfo (VirtoCommerceDomainStoreModelSearchCriteria criteria) { // verify the required parameter 'criteria' is set if (criteria == null) throw new ApiException(400, "Missing required parameter 'criteria' when calling StoreModuleApi->StoreModuleSearchStores"); var path_ = "/api/stores/search"; var pathParams = new Dictionary<String, String>(); var queryParams = new Dictionary<String, String>(); var headerParams = new Dictionary<String, String>(Configuration.DefaultHeader); var formParams = new Dictionary<String, String>(); var fileParams = new Dictionary<String, FileParameter>(); Object postBody = null; // to determine the Content-Type header String[] httpContentTypes = new String[] { "application/json", "text/json", "application/x-www-form-urlencoded" }; String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header String[] httpHeaderAccepts = new String[] { "application/json", "text/json" }; String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); if (httpHeaderAccept != null) headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json pathParams.Add("format", "json"); if (criteria.GetType() != typeof(byte[])) { postBody = Configuration.ApiClient.Serialize(criteria); // http body (model) parameter } else { postBody = criteria; // byte array } // make the HTTP request IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, httpContentType); int statusCode = (int) response.StatusCode; if (statusCode >= 400 && (statusCode != 404 || Configuration.ThrowExceptionWhenStatusCodeIs404)) throw new ApiException (statusCode, "Error calling StoreModuleSearchStores: " + response.Content, response.Content); else if (statusCode == 0) throw new ApiException (statusCode, "Error calling StoreModuleSearchStores: " + response.ErrorMessage, response.ErrorMessage); return new ApiResponse<VirtoCommerceStoreModuleWebModelSearchResult>(statusCode, response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (VirtoCommerceStoreModuleWebModelSearchResult) Configuration.ApiClient.Deserialize(response, typeof(VirtoCommerceStoreModuleWebModelSearchResult))); }