/// <summary> /// Updates the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro. /// <example> /// <code> /// var result = ProductVariationFactory.UpdateProductVariationLocalizedDeltaPrice(handler : handler, localizedDeltaPrice : localizedDeltaPrice, productCode : productCode, variationKey : variationKey, currencyCode : currencyCode, responseFields : responseFields, dataViewMode: dataViewMode, expectedCode: expectedCode, successCode: successCode); /// var optionalCasting = ConvertClass<ProductVariationDeltaPrice/>(result); /// return optionalCasting; /// </code> /// </example> /// </summary> public static Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice UpdateProductVariationLocalizedDeltaPrice(ServiceClientMessageHandler handler, Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice localizedDeltaPrice, string productCode, string variationKey, string currencyCode, string responseFields = null, DataViewMode dataViewMode = DataViewMode.Live, HttpStatusCode expectedCode = HttpStatusCode.OK, HttpStatusCode successCode = HttpStatusCode.OK) { SetSdKparameters(); var currentClassName = System.Reflection.MethodInfo.GetCurrentMethod().DeclaringType.Name; var currentMethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; Debug.WriteLine(currentMethodName + '.' + currentMethodName); var apiClient = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductVariationClient.UpdateProductVariationLocalizedDeltaPriceClient( localizedDeltaPrice: localizedDeltaPrice, productCode: productCode, variationKey: variationKey, currencyCode: currencyCode, responseFields: responseFields, dataViewMode: dataViewMode); try { apiClient.WithContext(handler.ApiContext).Execute(); } catch (ApiException ex) { // Custom error handling for test cases can be placed here Exception customException = TestFailException.GetCustomTestException(ex, currentClassName, currentMethodName, expectedCode); if (customException != null) { throw customException; } return(null); } return(ResponseMessageFactory.CheckResponseCodes(apiClient.HttpResponse.StatusCode, expectedCode, successCode) ? (apiClient.Result()) : null); }
/// <summary> /// /// </summary> /// <param name="currencyCode">The three character ISOÂ currency code, such as USDÂ for US Dollars.</param> /// <param name="productCode">The unique, user-defined product code of a product, used throughout to reference and associate to a product.</param> /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param> /// <param name="variationKey">System-generated key that represents the attribute values that uniquely identify a specific product variation.</param> /// <param name="localizedDeltaPrice">The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".</param> /// <returns> /// <see cref="Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice"/> /// </returns> /// <example> /// <code> /// var productvariation = new ProductVariation(); /// var productVariationDeltaPrice = await productvariation.UpdateProductVariationLocalizedDeltaPriceAsync(_dataViewMode, localizedDeltaPrice, productCode, variationKey, currencyCode, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice> UpdateProductVariationLocalizedDeltaPriceAsync(Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice localizedDeltaPrice, string productCode, string variationKey, string currencyCode, string responseFields = null, CancellationToken ct = default(CancellationToken)) { MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice> response; var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductVariationClient.UpdateProductVariationLocalizedDeltaPriceClient(_dataViewMode, localizedDeltaPrice, productCode, variationKey, currencyCode, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(ct).ConfigureAwait(false); return(await response.ResultAsync()); }
public virtual Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice UpdateProductVariationLocalizedDeltaPrice(Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice localizedDeltaPrice, string productCode, string variationKey, string currencyCode, string responseFields = null) { MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice> response; var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductVariationClient.UpdateProductVariationLocalizedDeltaPriceClient(_dataViewMode, localizedDeltaPrice, productCode, variationKey, currencyCode, responseFields); client.WithContext(_apiContext); response = client.Execute(); return(response.Result()); }
/// <summary> /// Updatesthe localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro. /// </summary> /// <param name="currencyCode">The three character ISO currency code, such as USD for US Dollars.</param> /// <param name="productCode">The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.</param> /// <param name="responseFields">Use this field to include those fields which are not included by default.</param> /// <param name="variationKey">System-generated key that represents the attribute values that uniquely identify a specific product variation.</param> /// <param name="localizedDeltaPrice">The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".</param> /// <returns> /// <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice"/>} /// </returns> /// <example> /// <code> /// var mozuClient=UpdateProductVariationLocalizedDeltaPrice(dataViewMode, localizedDeltaPrice, productCode, variationKey, currencyCode, responseFields); /// var productVariationDeltaPriceClient = mozuClient.WithBaseAddress(url).Execute().Result(); /// </code> /// </example> public static MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice> UpdateProductVariationLocalizedDeltaPriceClient(DataViewMode dataViewMode, Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice localizedDeltaPrice, string productCode, string variationKey, string currencyCode, string responseFields = null) { var url = Mozu.Api.Urls.Commerce.Catalog.Admin.Products.ProductVariationUrl.UpdateProductVariationLocalizedDeltaPriceUrl(productCode, variationKey, currencyCode, responseFields); const string verb = "PUT"; var mozuClient = new MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice>() .WithVerb(verb).WithResourceUrl(url) .WithBody <Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice>(localizedDeltaPrice).WithHeader(Headers.X_VOL_DATAVIEW_MODE, dataViewMode.ToString()) ; return(mozuClient); }
/// <summary> /// Adds the localized delta price value for a product variation. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro. /// </summary> /// <param name="productCode">The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.</param> /// <param name="responseFields">Use this field to include those fields which are not included by default.</param> /// <param name="variationKey">System-generated key that represents the attribute values that uniquely identify a specific product variation.</param> /// <param name="localizedDeltaPrice">The difference between the base price for the product and this variation of the product, which can be a positive or negative decimal value. For example, if the base price for a t-shirt product is $10, but the XL variation should cost $12, the DeltaPrice value should be "2". However, if the XS variation should only cost $8, the DeltaPrice value should be "-2".</param> /// <returns> /// <see cref="Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice"/> /// </returns> /// <example> /// <code> /// var productvariation = new ProductVariation(); /// var productVariationDeltaPrice = await productvariation.AddProductVariationLocalizedDeltaPriceAsync(_dataViewMode, localizedDeltaPrice, productCode, variationKey, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice> AddProductVariationLocalizedDeltaPriceAsync(Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice localizedDeltaPrice, string productCode, string variationKey, string responseFields = null) { MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductVariationDeltaPrice> response; var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductVariationClient.AddProductVariationLocalizedDeltaPriceClient(_dataViewMode, localizedDeltaPrice, productCode, variationKey, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(); return(await response.ResultAsync()); }