/// <summary> /// Updates the details of the specified product handling fee rule. /// </summary> /// <param name="id">Unique identifier of the customer segment to retrieve.</param> /// <param name="profilecode">The unique, user-defined code of the profile with which the product handling fee rule is associated.</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="dataViewMode">{<see cref="Mozu.Api.DataViewMode"/>}</param> /// <param name="rule">The updated details of the product handling fee rule.</param> /// <returns> /// <see cref="Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule"/> /// </returns> /// <example> /// <code> /// var handlingfeerule = new HandlingFeeRule(); /// var handlingFeeRule = await handlingfeerule.UpdateProductHandlingFeeRuleAsync(_dataViewMode, rule, profilecode, id, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule> UpdateProductHandlingFeeRuleAsync(Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule rule, string profilecode, string id, string responseFields = null) { MozuClient <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule> response; var client = Mozu.Api.Clients.Commerce.Shipping.Admin.Profiles.HandlingFeeRuleClient.UpdateProductHandlingFeeRuleClient(_dataViewMode, rule, profilecode, id, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(); return(await response.ResultAsync()); }
public virtual Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule CreateProductHandlingFeeRule(Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule rule, string profilecode, string responseFields = null) { MozuClient <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule> response; var client = Mozu.Api.Clients.Commerce.Shipping.Admin.Profiles.HandlingFeeRuleClient.CreateProductHandlingFeeRuleClient(rule, profilecode, responseFields); client.WithContext(_apiContext); response = client.Execute(); return(response.Result()); }
/// <summary> /// Updates the details of the specified product handling fee rule. /// <example> /// <code> /// var result = HandlingFeeRuleFactory.UpdateProductHandlingFeeRule(handler : handler, rule : rule, profilecode : profilecode, id : id, responseFields : responseFields, dataViewMode: dataViewMode, expectedCode: expectedCode, successCode: successCode); /// var optionalCasting = ConvertClass<HandlingFeeRule/>(result); /// return optionalCasting; /// </code> /// </example> /// </summary> public static Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule UpdateProductHandlingFeeRule(ServiceClientMessageHandler handler, Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule rule, string profilecode, string id, 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.Shipping.Admin.Profiles.HandlingFeeRuleClient.UpdateProductHandlingFeeRuleClient( rule: rule, profilecode: profilecode, id: id, 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="profilecode">The unique, user-defined code of the profile with which the order handling fee rule is associated.</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="dataViewMode">{<see cref="Mozu.Api.DataViewMode"/>}</param> /// <param name="rule">The details of the order handling fee rule.</param> /// <returns> /// <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule"/>} /// </returns> /// <example> /// <code> /// var mozuClient=CreateOrderHandlingFeeRule( rule, profilecode, responseFields); /// var handlingFeeRuleClient = mozuClient.WithBaseAddress(url).Execute().Result(); /// </code> /// </example> public static MozuClient <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule> CreateOrderHandlingFeeRuleClient(Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule rule, string profilecode, string responseFields = null) { var url = Mozu.Api.Urls.Commerce.Shipping.Admin.Profiles.OrderHandlingFeeRulesUrl.CreateOrderHandlingFeeRuleUrl(profilecode, responseFields); const string verb = "POST"; var mozuClient = new MozuClient <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule>() .WithVerb(verb).WithResourceUrl(url) .WithBody <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule>(rule); return(mozuClient); }
/// <summary> /// /// </summary> /// <param name="profilecode">The unique, user-defined code of the profile with which the product handling fee rule is associated.</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="dataViewMode">{<see cref="Mozu.Api.DataViewMode"/>}</param> /// <param name="rule">The details of the new product handling fee rule.</param> /// <returns> /// <see cref="Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule"/> /// </returns> /// <example> /// <code> /// var producthandlingfeerules = new ProductHandlingFeeRules(); /// var handlingFeeRule = await producthandlingfeerules.CreateProductHandlingFeeRuleAsync( rule, profilecode, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule> CreateProductHandlingFeeRuleAsync(Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule rule, string profilecode, string responseFields = null, CancellationToken ct = default(CancellationToken)) { MozuClient <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule> response; var client = Mozu.Api.Clients.Commerce.Shipping.Admin.Profiles.ProductHandlingFeeRulesClient.CreateProductHandlingFeeRuleClient(rule, profilecode, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(ct).ConfigureAwait(false); return(await response.ResultAsync()); }
/// <summary> /// /// </summary> /// <param name="id">Unique identifier of the customer segment to retrieve.</param> /// <param name="profilecode">The unique, user-defined code of the profile with which the product handling fee rule is associated.</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="dataViewMode">{<see cref="Mozu.Api.DataViewMode"/>}</param> /// <param name="rule">The updated details of the product handling fee rule.</param> /// <returns> /// <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule"/>} /// </returns> /// <example> /// <code> /// var mozuClient=UpdateProductHandlingFeeRule(dataViewMode, rule, profilecode, id, responseFields); /// var handlingFeeRuleClient = mozuClient.WithBaseAddress(url).Execute().Result(); /// </code> /// </example> public static MozuClient <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule> UpdateProductHandlingFeeRuleClient(DataViewMode dataViewMode, Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule rule, string profilecode, string id, string responseFields = null) { var url = Mozu.Api.Urls.Commerce.Shipping.Admin.Profiles.ProductHandlingFeeRulesUrl.UpdateProductHandlingFeeRuleUrl(profilecode, id, responseFields); const string verb = "PUT"; var mozuClient = new MozuClient <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule>() .WithVerb(verb).WithResourceUrl(url) .WithBody <Mozu.Api.Contracts.ShippingAdmin.Profile.HandlingFeeRule>(rule).WithHeader(Headers.X_VOL_DATAVIEW_MODE, dataViewMode.ToString()) ; return(mozuClient); }