/// <summary> /// Updates the property value for localized content. This content is set by the locale code. /// </summary> /// <param name="attributeFQN">Fully qualified name for an attribute.</param> /// <param name="localeCode">Language used for the entity. Currently, only "en-US" is supported.</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">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="localizedContent">Content of the product property value in the language defined for the locale code.</param> /// <returns> /// <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent"/>} /// </returns> /// <example> /// <code> /// var mozuClient=UpdatePropertyValueLocalizedContent(dataViewMode, localizedContent, productCode, attributeFQN, value, localeCode, responseFields); /// var productPropertyValueLocalizedContentClient = mozuClient.WithBaseAddress(url).Execute().Result(); /// </code> /// </example> public static MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent> UpdatePropertyValueLocalizedContentClient(DataViewMode dataViewMode, Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent localizedContent, string productCode, string attributeFQN, string value, string localeCode, string responseFields = null) { var url = Mozu.Api.Urls.Commerce.Catalog.Admin.Products.ProductPropertyUrl.UpdatePropertyValueLocalizedContentUrl(productCode, attributeFQN, value, localeCode, responseFields); const string verb = "PUT"; var mozuClient = new MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent>() .WithVerb(verb).WithResourceUrl(url) .WithBody <Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent>(localizedContent).WithHeader(Headers.X_VOL_DATAVIEW_MODE, dataViewMode.ToString()) ; return(mozuClient); }
/// <summary> /// Updates the property value for localized content. This content is set by the locale code. /// </summary> /// <param name="attributeFQN">Fully qualified name for an attribute.</param> /// <param name="localeCode">Language used for the entity. Currently, only "en-US" is supported.</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="localizedContent">Content of the product property value in the language defined for the locale code.</param> /// <returns> /// <see cref="Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent"/> /// </returns> /// <example> /// <code> /// var productproperty = new ProductProperty(); /// var productPropertyValueLocalizedContent = await productproperty.UpdatePropertyValueLocalizedContentAsync(_dataViewMode, localizedContent, productCode, attributeFQN, value, localeCode, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent> UpdatePropertyValueLocalizedContentAsync(Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent localizedContent, string productCode, string attributeFQN, string value, string localeCode, string responseFields = null) { MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent> response; var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductPropertyClient.UpdatePropertyValueLocalizedContentClient(_dataViewMode, localizedContent, productCode, attributeFQN, value, localeCode, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(); return(await response.ResultAsync()); }
/// <summary> /// /// <example> /// <code> /// var result = ProductPropertyFactory.UpdatePropertyValueLocalizedContent(handler : handler, localizedContent : localizedContent, productCode : productCode, attributeFQN : attributeFQN, value : value, localeCode : localeCode, responseFields : responseFields, dataViewMode: dataViewMode, expectedCode: expectedCode, successCode: successCode); /// var optionalCasting = ConvertClass<ProductPropertyValueLocalizedContent/>(result); /// return optionalCasting; /// </code> /// </example> /// </summary> public static Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent UpdatePropertyValueLocalizedContent(ServiceClientMessageHandler handler, Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent localizedContent, string productCode, string attributeFQN, string value, string localeCode, 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.ProductPropertyClient.UpdatePropertyValueLocalizedContentClient( localizedContent: localizedContent, productCode: productCode, attributeFQN: attributeFQN, value: value, localeCode: localeCode, responseFields: responseFields, dataViewMode: dataViewMode); 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="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="localizedContent">Content of the product property value in the language defined for the locale code.</param> /// <returns> /// <see cref="Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent"/> /// </returns> /// <example> /// <code> /// var productproperty = new ProductProperty(); /// var productPropertyValueLocalizedContent = await productproperty.AddPropertyValueLocalizedContentAsync(_dataViewMode, localizedContent, productCode, attributeFQN, value, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent> AddPropertyValueLocalizedContentAsync(Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent localizedContent, string productCode, string attributeFQN, string value, string responseFields = null, CancellationToken ct = default(CancellationToken)) { MozuClient <Mozu.Api.Contracts.ProductAdmin.ProductPropertyValueLocalizedContent> response; var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Products.ProductPropertyClient.AddPropertyValueLocalizedContentClient(_dataViewMode, localizedContent, productCode, attributeFQN, value, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(ct).ConfigureAwait(false); return(await response.ResultAsync()); }