/// <summary>
        ///
        /// <example>
        ///  <code>
        /// var result = PriceListEntryFactory.UpdatePriceListEntry(handler : handler,  priceListEntryIn :  priceListEntryIn,  priceListCode :  priceListCode,  productCode :  productCode,  currencyCode :  currencyCode,  startDate :  startDate,  responseFields :  responseFields,  expectedCode: expectedCode, successCode: successCode);
        /// var optionalCasting = ConvertClass<PriceListEntry/>(result);
        /// return optionalCasting;
        ///  </code>
        /// </example>
        /// </summary>
        public static Mozu.Api.Contracts.ProductAdmin.PriceListEntry UpdatePriceListEntry(ServiceClientMessageHandler handler,
                                                                                          Mozu.Api.Contracts.ProductAdmin.PriceListEntry priceListEntryIn, string priceListCode, string productCode, string currencyCode, DateTime?startDate = null, string responseFields = null,
                                                                                          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.Pricelists.PriceListEntryClient.UpdatePriceListEntryClient(
                priceListEntryIn:  priceListEntryIn, priceListCode:  priceListCode, productCode:  productCode, currencyCode:  currencyCode, startDate:  startDate, responseFields:  responseFields);

            try
            {
                apiClient.WithContext(handler.ApiContext).ExecuteAsync(default(CancellationToken)).Wait();
            }
            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="priceListCode">The unique code of the price list associated with the price list entry.</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="startDate">The start date of the price list entry.</param>
        /// <param name="priceListEntryIn">The updated details of the price list entry.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.ProductAdmin.PriceListEntry"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var pricelistentry = new PriceListEntry();
        ///   var priceListEntry = await pricelistentry.UpdatePriceListEntryAsync( priceListEntryIn,  priceListCode,  productCode,  currencyCode,  startDate,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.ProductAdmin.PriceListEntry> UpdatePriceListEntryAsync(Mozu.Api.Contracts.ProductAdmin.PriceListEntry priceListEntryIn, string priceListCode, string productCode, string currencyCode, DateTime?startDate = null, string responseFields = null, CancellationToken ct = default(CancellationToken))
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.PriceListEntry> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Pricelists.PriceListEntryClient.UpdatePriceListEntryClient(priceListEntryIn, priceListCode, productCode, currencyCode, startDate, responseFields);

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

            return(await response.ResultAsync());
        }
Пример #3
0
        /// <summary>
        /// Adds a new price list entry to the specified price list.
        /// </summary>
        /// <param name="priceListCode">The specified price list to which you want to add the price list entry.</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="priceListEntryIn">The details of the new price list entry.</param>
        /// <returns>
        ///  <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.ProductAdmin.PriceListEntry"/>}
        /// </returns>
        /// <example>
        /// <code>
        ///   var mozuClient=AddPriceListEntry( priceListEntryIn,  priceListCode,  responseFields);
        ///   var priceListEntryClient = mozuClient.WithBaseAddress(url).Execute().Result();
        /// </code>
        /// </example>
        public static MozuClient <Mozu.Api.Contracts.ProductAdmin.PriceListEntry> AddPriceListEntryClient(Mozu.Api.Contracts.ProductAdmin.PriceListEntry priceListEntryIn, string priceListCode, string responseFields = null)
        {
            var          url        = Mozu.Api.Urls.Commerce.Catalog.Admin.Pricelists.PriceListEntryUrl.AddPriceListEntryUrl(priceListCode, responseFields);
            const string verb       = "POST";
            var          mozuClient = new MozuClient <Mozu.Api.Contracts.ProductAdmin.PriceListEntry>()
                                      .WithVerb(verb).WithResourceUrl(url)
                                      .WithBody <Mozu.Api.Contracts.ProductAdmin.PriceListEntry>(priceListEntryIn);

            return(mozuClient);
        }
Пример #4
0
        /// <summary>
        /// Updates the details of a price list entry.
        /// </summary>
        /// <param name="currencyCode">The three character ISO currency code, such as USD for US Dollars.</param>
        /// <param name="priceListCode">The unique code of the price list associated with the price list entry.</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="startDate">The start date of the price list entry.</param>
        /// <param name="priceListEntryIn">The updated details of the price list entry.</param>
        /// <returns>
        ///  <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.ProductAdmin.PriceListEntry"/>}
        /// </returns>
        /// <example>
        /// <code>
        ///   var mozuClient=UpdatePriceListEntry( priceListEntryIn,  priceListCode,  productCode,  currencyCode,  startDate,  responseFields);
        ///   var priceListEntryClient = mozuClient.WithBaseAddress(url).Execute().Result();
        /// </code>
        /// </example>
        public static MozuClient <Mozu.Api.Contracts.ProductAdmin.PriceListEntry> UpdatePriceListEntryClient(Mozu.Api.Contracts.ProductAdmin.PriceListEntry priceListEntryIn, string priceListCode, string productCode, string currencyCode, DateTime?startDate = null, string responseFields = null)
        {
            var          url        = Mozu.Api.Urls.Commerce.Catalog.Admin.Pricelists.PriceListEntryUrl.UpdatePriceListEntryUrl(priceListCode, productCode, currencyCode, startDate, responseFields);
            const string verb       = "PUT";
            var          mozuClient = new MozuClient <Mozu.Api.Contracts.ProductAdmin.PriceListEntry>()
                                      .WithVerb(verb).WithResourceUrl(url)
                                      .WithBody <Mozu.Api.Contracts.ProductAdmin.PriceListEntry>(priceListEntryIn);

            return(mozuClient);
        }
Пример #5
0
        public virtual Mozu.Api.Contracts.ProductAdmin.PriceListEntry UpdatePriceListEntry(Mozu.Api.Contracts.ProductAdmin.PriceListEntry priceListEntryIn, string priceListCode, string productCode, string currencyCode, DateTime?startDate = null, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.PriceListEntry> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Pricelists.PriceListEntryClient.UpdatePriceListEntryClient(priceListEntryIn, priceListCode, productCode, currencyCode, startDate, responseFields);

            client.WithContext(_apiContext);
            response = client.Execute();
            return(response.Result());
        }
Пример #6
0
        /// <summary>
        /// Adds a new price list entry to the specified price list.
        /// </summary>
        /// <param name="priceListCode">The specified price list to which you want to add the price list entry.</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="priceListEntryIn">The details of the new price list entry.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.ProductAdmin.PriceListEntry"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var pricelistentry = new PriceListEntry();
        ///   var priceListEntry = await pricelistentry.AddPriceListEntryAsync( priceListEntryIn,  priceListCode,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.ProductAdmin.PriceListEntry> AddPriceListEntryAsync(Mozu.Api.Contracts.ProductAdmin.PriceListEntry priceListEntryIn, string priceListCode, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.PriceListEntry> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Pricelists.PriceListEntryClient.AddPriceListEntryClient(priceListEntryIn, priceListCode, responseFields);

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

            return(await response.ResultAsync());
        }