Exemple #1
0
        /// <summary>
        /// Updates the localized delta price value for a product extra. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
        /// <example>
        ///  <code>
        /// var result = ProductExtraFactory.UpdateExtraValueLocalizedDeltaPrice(handler : handler,  localizedDeltaPrice :  localizedDeltaPrice,  productCode :  productCode,  attributeFQN :  attributeFQN,  value :  value,  currencyCode :  currencyCode,  responseFields :  responseFields,  dataViewMode: dataViewMode,  expectedCode: expectedCode, successCode: successCode);
        /// var optionalCasting = ConvertClass<ProductExtraValueDeltaPrice/>(result);
        /// return optionalCasting;
        ///  </code>
        /// </example>
        /// </summary>
        public static Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice UpdateExtraValueLocalizedDeltaPrice(ServiceClientMessageHandler handler,
                                                                                                                      Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice localizedDeltaPrice, string productCode, string attributeFQN, string value, 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.ProductExtraClient.UpdateExtraValueLocalizedDeltaPriceClient(
                localizedDeltaPrice:  localizedDeltaPrice, productCode:  productCode, attributeFQN:  attributeFQN, value:  value, 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>
        /// Updates the localized delta price value for a product extra. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
        /// </summary>
        /// <param name="attributeFQN">Fully qualified name for an attribute.</param>
        /// <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="value">The value string to create.</param>
        /// <param name="localizedDeltaPrice">The properties of the price difference between the product extra and the base product.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var productextra = new ProductExtra();
        ///   var productExtraValueDeltaPrice = await productextra.UpdateExtraValueLocalizedDeltaPriceAsync(_dataViewMode,  localizedDeltaPrice,  productCode,  attributeFQN,  value,  currencyCode,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice> UpdateExtraValueLocalizedDeltaPriceAsync(Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice localizedDeltaPrice, string productCode, string attributeFQN, string value, string currencyCode, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductExtraClient.UpdateExtraValueLocalizedDeltaPriceClient(_dataViewMode, localizedDeltaPrice, productCode, attributeFQN, value, currencyCode, responseFields);

            client.WithContext(_apiContext);
            response = await client.ExecuteAsync();

            return(await response.ResultAsync());
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="attributeFQN">Fully qualified name for an attribute.</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="value">The value string to create.</param>
        /// <param name="localizedDeltaPrice">The properties of the price difference between the product extra and the base product.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var productextra = new ProductExtra();
        ///   var productExtraValueDeltaPrice = await productextra.AddExtraValueLocalizedDeltaPriceAsync(_dataViewMode,  localizedDeltaPrice,  productCode,  attributeFQN,  value,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice> AddExtraValueLocalizedDeltaPriceAsync(Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice localizedDeltaPrice, string productCode, string attributeFQN, string value, string responseFields = null, CancellationToken ct = default(CancellationToken))
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductExtraClient.AddExtraValueLocalizedDeltaPriceClient(_dataViewMode, localizedDeltaPrice, productCode, attributeFQN, value, responseFields);

            client.WithContext(_apiContext);
            response = await client.ExecuteAsync(ct).ConfigureAwait(false);

            return(await response.ResultAsync());
        }
        public virtual Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice AddExtraValueLocalizedDeltaPrice(Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice localizedDeltaPrice, string productCode, string attributeFQN, string value, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductExtraClient.AddExtraValueLocalizedDeltaPriceClient(_dataViewMode, localizedDeltaPrice, productCode, attributeFQN, value, responseFields);

            client.WithContext(_apiContext);
            response = client.Execute();
            return(response.Result());
        }
        /// <summary>
        /// Updates the localized delta price value for a product extra. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro.
        /// </summary>
        /// <param name="attributeFQN">Fully qualified name for an attribute.</param>
        /// <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="value">The value string to create.</param>
        /// <param name="localizedDeltaPrice">The properties of the price difference between the product extra and the base product.</param>
        /// <returns>
        ///  <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice"/>}
        /// </returns>
        /// <example>
        /// <code>
        ///   var mozuClient=UpdateExtraValueLocalizedDeltaPrice(dataViewMode,  localizedDeltaPrice,  productCode,  attributeFQN,  value,  currencyCode,  responseFields);
        ///   var productExtraValueDeltaPriceClient = mozuClient.WithBaseAddress(url).Execute().Result();
        /// </code>
        /// </example>
        public static MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice> UpdateExtraValueLocalizedDeltaPriceClient(DataViewMode dataViewMode, Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice localizedDeltaPrice, string productCode, string attributeFQN, string value, string currencyCode, string responseFields = null)
        {
            var          url        = Mozu.Api.Urls.Commerce.Catalog.Admin.Products.ProductExtraUrl.UpdateExtraValueLocalizedDeltaPriceUrl(productCode, attributeFQN, value, currencyCode, responseFields);
            const string verb       = "PUT";
            var          mozuClient = new MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice>()
                                      .WithVerb(verb).WithResourceUrl(url)
                                      .WithBody <Mozu.Api.Contracts.ProductAdmin.ProductExtraValueDeltaPrice>(localizedDeltaPrice).WithHeader(Headers.X_VOL_DATAVIEW_MODE, dataViewMode.ToString())
            ;

            return(mozuClient);
        }