/// <summary> /// Gets available shipping options /// </summary> /// <param name="getShippingOptionRequest">A request for getting shipping options</param> /// <returns> /// A task that represents the asynchronous operation /// The task result contains the represents a response of getting shipping rate options /// </returns> public async Task <GetShippingOptionResponse> GetShippingOptionsAsync(GetShippingOptionRequest getShippingOptionRequest) { if (getShippingOptionRequest == null) { throw new ArgumentNullException(nameof(getShippingOptionRequest)); } if (!getShippingOptionRequest.Items?.Any() ?? true) { return new GetShippingOptionResponse { Errors = new[] { "No shipment items" } } } ; if (getShippingOptionRequest.ShippingAddress?.CountryId == null) { return new GetShippingOptionResponse { Errors = new[] { "Shipping address is not set" } } } ; return(await _upsService.GetRatesAsync(getShippingOptionRequest)); }