/// <summary>
        /// Updates localized vocabulary value content for an existing attribute, based on the `localeCode`.
        /// </summary>
        /// <param name="attributeFQN">Fully qualified name for an attribute.</param>
        /// <param name="localeCode">The two character country code that sets the locale, such as US for United States. Sites, tenants, and catalogs use locale codes for localizing content, such as translated product text per supported country.</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="dataViewMode">{<see cref="Mozu.Api.DataViewMode"/>}</param>
        /// <param name="localizedContent">The localized text for the string value of a product attribute.</param>
        /// <returns>
        ///  <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent"/>}
        /// </returns>
        /// <example>
        /// <code>
        ///   var mozuClient=UpdateAttributeVocabularyValueLocalizedContent( localizedContent,  attributeFQN,  value,  localeCode,  responseFields);
        ///   var attributeVocabularyValueLocalizedContentClient = mozuClient.WithBaseAddress(url).Execute().Result();
        /// </code>
        /// </example>
        public static MozuClient <Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent> UpdateAttributeVocabularyValueLocalizedContentClient(Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent localizedContent, string attributeFQN, string value, string localeCode, string responseFields = null)
        {
            var          url        = Mozu.Api.Urls.Commerce.Catalog.Admin.Attributedefinition.Attributes.AttributeVocabularyValueUrl.UpdateAttributeVocabularyValueLocalizedContentUrl(attributeFQN, value, localeCode, responseFields);
            const string verb       = "PUT";
            var          mozuClient = new MozuClient <Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent>()
                                      .WithVerb(verb).WithResourceUrl(url)
                                      .WithBody <Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent>(localizedContent);

            return(mozuClient);
        }
예제 #2
0
        /// <summary>
        /// Updates localized vocabulary value content for an existing attribute, based on the `localeCode`.
        /// </summary>
        /// <param name="attributeFQN">Fully qualified name for an attribute.</param>
        /// <param name="localeCode">The two character country code that sets the locale, such as US for United States. Sites, tenants, and catalogs use locale codes for localizing content, such as translated product text per supported country.</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="dataViewMode">{<see cref="Mozu.Api.DataViewMode"/>}</param>
        /// <param name="localizedContent">The localized text for the string value of a product attribute.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var attributevocabularyvalue = new AttributeVocabularyValue();
        ///   var attributeVocabularyValueLocalizedContent = await attributevocabularyvalue.UpdateAttributeVocabularyValueLocalizedContentAsync( localizedContent,  attributeFQN,  value,  localeCode,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent> UpdateAttributeVocabularyValueLocalizedContentAsync(Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent localizedContent, string attributeFQN, string value, string localeCode, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Attributedefinition.Attributes.AttributeVocabularyValueClient.UpdateAttributeVocabularyValueLocalizedContentClient(localizedContent, attributeFQN, value, localeCode, responseFields);

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

            return(await response.ResultAsync());
        }
        /// <summary>
        /// Updates localized vocabulary value content for an existing attribute, based on the `localeCode`.
        /// <example>
        ///  <code>
        /// var result = AttributeVocabularyValueFactory.UpdateAttributeVocabularyValueLocalizedContent(handler : handler,  localizedContent :  localizedContent,  attributeFQN :  attributeFQN,  value :  value,  localeCode :  localeCode,  responseFields :  responseFields,  expectedCode: expectedCode, successCode: successCode);
        /// var optionalCasting = ConvertClass<AttributeVocabularyValueLocalizedContent/>(result);
        /// return optionalCasting;
        ///  </code>
        /// </example>
        /// </summary>
        public static Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent UpdateAttributeVocabularyValueLocalizedContent(ServiceClientMessageHandler handler,
                                                                                                                                              Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent localizedContent, string attributeFQN, string value, string localeCode, 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.Attributedefinition.Attributes.AttributeVocabularyValueClient.UpdateAttributeVocabularyValueLocalizedContentClient(
                localizedContent:  localizedContent, attributeFQN:  attributeFQN, value:  value, localeCode:  localeCode, responseFields:  responseFields);

            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);
        }
예제 #4
0
        public virtual Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent AddAttributeVocabularyValueLocalizedContent(Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent localizedContent, string attributeFQN, string value, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Attributedefinition.Attributes.AttributeVocabularyValueClient.AddAttributeVocabularyValueLocalizedContentClient(localizedContent, attributeFQN, value, responseFields);

            client.WithContext(_apiContext);
            response = client.Execute();
            return(response.Result());
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="attributeFQN">Fully qualified name for an attribute.</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="dataViewMode">{<see cref="Mozu.Api.DataViewMode"/>}</param>
        /// <param name="localizedContent">The localized text for the string value of a product attribute.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var attributevocabularyvalue = new AttributeVocabularyValue();
        ///   var attributeVocabularyValueLocalizedContent = await attributevocabularyvalue.AddAttributeVocabularyValueLocalizedContentAsync( localizedContent,  attributeFQN,  value,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent> AddAttributeVocabularyValueLocalizedContentAsync(Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent localizedContent, string attributeFQN, string value, string responseFields = null, CancellationToken ct = default(CancellationToken))
        {
            MozuClient <Mozu.Api.Contracts.ProductAdmin.AttributeVocabularyValueLocalizedContent> response;
            var client = Mozu.Api.Clients.Commerce.Catalog.Admin.Attributedefinition.Attributes.AttributeVocabularyValueClient.AddAttributeVocabularyValueLocalizedContentClient(localizedContent, attributeFQN, value, responseFields);

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

            return(await response.ResultAsync());
        }