/// <summary> /// /// <example> /// <code> /// var result = ReturnFactory.UpdateReturn(handler : handler, ret : ret, returnId : returnId, responseFields : responseFields, expectedCode: expectedCode, successCode: successCode); /// var optionalCasting = ConvertClass<Return/>(result); /// return optionalCasting; /// </code> /// </example> /// </summary> public static Mozu.Api.Contracts.CommerceRuntime.Returns.Return UpdateReturn(ServiceClientMessageHandler handler, Mozu.Api.Contracts.CommerceRuntime.Returns.Return ret, string returnId, 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.ReturnClient.UpdateReturnClient( ret: ret, returnId: returnId, 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> /// Updates one or more properties of a return for items previously shipped in a completed order. /// </summary> /// <param name="responseFields">Use this field to include those fields which are not included by default.</param> /// <param name="returnId">Unique identifier of the return whose items you want to get.</param> /// <param name="ret">Properties of a return of one or more previously fulfilled items.</param> /// <returns> /// <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.CommerceRuntime.Returns.Return"/>} /// </returns> /// <example> /// <code> /// var mozuClient=UpdateReturn( ret, returnId, responseFields); /// var returnClient = mozuClient.WithBaseAddress(url).Execute().Result(); /// </code> /// </example> public static MozuClient <Mozu.Api.Contracts.CommerceRuntime.Returns.Return> UpdateReturnClient(Mozu.Api.Contracts.CommerceRuntime.Returns.Return ret, string returnId, string responseFields = null) { var url = Mozu.Api.Urls.Commerce.ReturnUrl.UpdateReturnUrl(returnId, responseFields); const string verb = "PUT"; var mozuClient = new MozuClient <Mozu.Api.Contracts.CommerceRuntime.Returns.Return>() .WithVerb(verb).WithResourceUrl(url) .WithBody <Mozu.Api.Contracts.CommerceRuntime.Returns.Return>(ret); return(mozuClient); }
/// <summary> /// Updates one or more properties of a return for items previously shipped in a completed order. /// </summary> /// <param name="responseFields">Use this field to include those fields which are not included by default.</param> /// <param name="returnId">Unique identifier of the return whose items you want to get.</param> /// <param name="ret">Properties of a return of one or more previously fulfilled items.</param> /// <returns> /// <see cref="Mozu.Api.Contracts.CommerceRuntime.Returns.Return"/> /// </returns> /// <example> /// <code> /// var return = new Return(); /// var return = await return.UpdateReturnAsync( ret, returnId, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.CommerceRuntime.Returns.Return> UpdateReturnAsync(Mozu.Api.Contracts.CommerceRuntime.Returns.Return ret, string returnId, string responseFields = null) { MozuClient <Mozu.Api.Contracts.CommerceRuntime.Returns.Return> response; var client = Mozu.Api.Clients.Commerce.ReturnClient.UpdateReturnClient(ret, returnId, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(); return(await response.ResultAsync()); }
/// <summary> /// /// </summary> /// <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="returnId">Unique identifier of the return whose items you want to get.</param> /// <param name="ret">Properties of a return of one or more previously fulfilled items.</param> /// <returns> /// <see cref="Mozu.Api.Contracts.CommerceRuntime.Returns.Return"/> /// </returns> /// <example> /// <code> /// var return = new Return(); /// var return = await return.UpdateReturnAsync( ret, returnId, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.CommerceRuntime.Returns.Return> UpdateReturnAsync(Mozu.Api.Contracts.CommerceRuntime.Returns.Return ret, string returnId, string responseFields = null, CancellationToken ct = default(CancellationToken)) { MozuClient <Mozu.Api.Contracts.CommerceRuntime.Returns.Return> response; var client = Mozu.Api.Clients.Commerce.ReturnClient.UpdateReturnClient(ret, returnId, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(ct).ConfigureAwait(false); return(await response.ResultAsync()); }
public virtual Mozu.Api.Contracts.CommerceRuntime.Returns.Return UpdateReturn(Mozu.Api.Contracts.CommerceRuntime.Returns.Return ret, string returnId, string responseFields = null) { MozuClient <Mozu.Api.Contracts.CommerceRuntime.Returns.Return> response; var client = Mozu.Api.Clients.Commerce.ReturnClient.UpdateReturnClient(ret, returnId, responseFields); client.WithContext(_apiContext); response = client.Execute(); return(response.Result()); }