Exemplo n.º 1
0
        /// <summary>
        /// Get listPrice for given partNumber&#39;s.
        /// </summary>
        /// <exception cref="Pki.eBusiness.ErpApi.DataAccess.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"> (optional)</param>
        /// <param name="countryCode"> (optional)</param>
        /// <param name="body"> (optional)</param>
        /// <returns>Task of PriceDtoList</returns>
        public async System.Threading.Tasks.Task <PriceDtoList> GetListPriceAsync(string userId = null, string countryCode = null, PriceRequestDto body = null)
        {
            ApiResponse <PriceDtoList> localVarResponse = await GetListPriceAsyncWithHttpInfo(userId, countryCode, body);

            return(localVarResponse.Data);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get listPrice for given partNumber&#39;s.
        /// </summary>
        /// <exception cref="Pki.eBusiness.ErpApi.DataAccess.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"> (optional)</param>
        /// <param name="countryCode"> (optional)</param>
        /// <param name="body"> (optional)</param>
        /// <returns>Task of ApiResponse (PriceDtoList)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <PriceDtoList> > GetListPriceAsyncWithHttpInfo(string userId = null, string countryCode = null, PriceRequestDto body = null)
        {
            var    localVarPath         = "/price/listPrice";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <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[] {
            };
            String localVarHttpContentType    = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
            };
            String localVarHttpHeaderAccept    = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (userId != null)
            {
                localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "userId", userId));                 // query parameter
            }
            if (countryCode != null)
            {
                localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "countryCode", countryCode));                      // query parameter
            }
            if (body != null && body.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
            }
            else
            {
                localVarPostBody = body; // byte array
            }

            // authentication (apiKey) required
            if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-api-key")))
            {
                localVarHeaderParams["x-api-key"] = Configuration.GetApiKeyWithPrefix("x-api-key");
            }

            // 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 (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetListPrice", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <PriceDtoList>(localVarStatusCode,
                                                  localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                  (PriceDtoList)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PriceDtoList))));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get listPrice for given partNumber&#39;s.
        /// </summary>
        /// <exception cref="Pki.eBusiness.ErpApi.DataAccess.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"> (optional)</param>
        /// <param name="countryCode"> (optional)</param>
        /// <param name="body"> (optional)</param>
        /// <returns>PriceDtoList</returns>
        public PriceDtoList GetListPrice(string userId = null, string countryCode = null, PriceRequestDto body = null)
        {
            ApiResponse <PriceDtoList> localVarResponse = GetListPriceWithHttpInfo(userId, countryCode, body);

            return(localVarResponse.Data);
        }