/// <summary> /// payments-cards Put Update description DOCUMENT_HERE /// <example> /// <code> /// var result = PublicCardFactory.Update(handler : handler, request : request, cardId : cardId, expectedCode: expectedCode, successCode: successCode); /// var optionalCasting = ConvertClass<SyncResponse/>(result); /// return optionalCasting; /// </code> /// </example> /// </summary> public static Mozu.Api.Contracts.PaymentService.Response.SyncResponse Update(ServiceClientMessageHandler handler, Mozu.Api.Contracts.PaymentService.PublicCard request, string cardId, 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.Payments.PublicCardClient.UpdateClient( request: request, cardId: cardId); 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="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="request"></param> /// <returns> /// <see cref="Mozu.Api.Contracts.PaymentService.Response.SyncResponse"/> /// </returns> /// <example> /// <code> /// var publiccard = new PublicCard(); /// var syncResponse = await publiccard.CreateAsync( request, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.PaymentService.Response.SyncResponse> CreateAsync(Mozu.Api.Contracts.PaymentService.PublicCard request, string responseFields = null, CancellationToken ct = default(CancellationToken)) { MozuClient <Mozu.Api.Contracts.PaymentService.Response.SyncResponse> response; var client = Mozu.Api.Clients.Commerce.Payments.PublicCardClient.CreateClient(request, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(ct).ConfigureAwait(false); 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="request">Mozu.PaymentService.Contracts.PublicCard ApiType DOCUMENT_HERE </param> /// <returns> /// <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.PaymentService.Response.SyncResponse"/>} /// </returns> /// <example> /// <code> /// var mozuClient=Create( request, responseFields); /// var syncResponseClient = mozuClient.WithBaseAddress(url).Execute().Result(); /// </code> /// </example> public static MozuClient <Mozu.Api.Contracts.PaymentService.Response.SyncResponse> CreateClient(Mozu.Api.Contracts.PaymentService.PublicCard request, string responseFields = null) { var url = Mozu.Api.Urls.Commerce.Payments.PublicCardUrl.CreateUrl(responseFields); const string verb = "POST"; var mozuClient = new MozuClient <Mozu.Api.Contracts.PaymentService.Response.SyncResponse>() .WithVerb(verb).WithResourceUrl(url) .WithBody <Mozu.Api.Contracts.PaymentService.PublicCard>(request); return(mozuClient); }
/// <summary> /// payments-cards Post Create description DOCUMENT_HERE /// </summary> /// <param name="request">Mozu.PaymentService.Contracts.PublicCard ApiType DOCUMENT_HERE </param> /// <returns> /// <see cref="Mozu.Api.Contracts.PaymentService.Response.SyncResponse"/> /// </returns> /// <example> /// <code> /// var publiccard = new PublicCard(); /// var syncResponse = await publiccard.CreateAsync( request); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.PaymentService.Response.SyncResponse> CreateAsync(Mozu.Api.Contracts.PaymentService.PublicCard request) { MozuClient <Mozu.Api.Contracts.PaymentService.Response.SyncResponse> response; var client = Mozu.Api.Clients.Commerce.Payments.PublicCardClient.CreateClient(request); client.WithContext(_apiContext); response = await client.ExecuteAsync(); return(await response.ResultAsync()); }
public virtual Mozu.Api.Contracts.PaymentService.Response.SyncResponse Create(Mozu.Api.Contracts.PaymentService.PublicCard request) { MozuClient <Mozu.Api.Contracts.PaymentService.Response.SyncResponse> response; var client = Mozu.Api.Clients.Commerce.Payments.PublicCardClient.CreateClient(request); client.WithContext(_apiContext); response = client.Execute(); return(response.Result()); }
/// <summary> /// payments-cards Put Update description DOCUMENT_HERE /// </summary> /// <param name="cardId">Unique identifier of the card associated with the customer account billing contact.</param> /// <param name="request">Mozu.PaymentService.Contracts.PublicCard ApiType DOCUMENT_HERE </param> /// <returns> /// <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.PaymentService.Response.SyncResponse"/>} /// </returns> /// <example> /// <code> /// var mozuClient=Update( request, cardId); /// var syncResponseClient = mozuClient.WithBaseAddress(url).Execute().Result(); /// </code> /// </example> public static MozuClient <Mozu.Api.Contracts.PaymentService.Response.SyncResponse> UpdateClient(Mozu.Api.Contracts.PaymentService.PublicCard request, string cardId) { var url = Mozu.Api.Urls.Commerce.Payments.PublicCardUrl.UpdateUrl(cardId); const string verb = "PUT"; var mozuClient = new MozuClient <Mozu.Api.Contracts.PaymentService.Response.SyncResponse>() .WithVerb(verb).WithResourceUrl(url) .WithBody <Mozu.Api.Contracts.PaymentService.PublicCard>(request); return(mozuClient); }