private function updateFields($parent, SKU $sku, array $values) {
    $additionalFields = $this->skuFieldsManager->getFieldAdditions();

    // Filter fields for the parent requested.
    $additionalFields = array_filter($additionalFields, function ($field) use ($parent) {
      return ($field['parent'] == $parent);
    });

    // Loop through all the fields we want to read from product data.
    foreach ($additionalFields as $key => $field) {
      $source = isset($field['source']) ? $field['source'] : $key;

      // Field key.
      $field_key = 'attr_' . $key;

      switch ($field['type']) {
        case 'attribute':
          // If attribute is not coming in response, then unset it.
          if (!isset($values[$source])) {
            $sku->{$field_key}->set(0, NULL);
          }
          else {
            $value = $values[$source];
            $value = $field['cardinality'] != 1 ? explode(',', $value) : [$value];
            foreach ($value as $index => $val) {
              if ($term = $this->productOptionsManager->loadProductOptionByOptionId($source, $val, $sku->language()->getId())) {
                $sku->{$field_key}->set($index, $term->getName());
              }
              else {
                $sku->{$field_key}->set($index, $val);
              }
            }
          }
          break;

        case 'string':
          // If attribute is not coming in response, then unset it.
          if (!isset($values[$source])) {
            $sku->{$field_key}->setValue(NULL);
          }
          else {
            $value = $values[$source];
            $value = $field['cardinality'] != 1 ? explode(',', $value) : $value;
            $sku->{$field_key}->setValue($value);
          }
          break;

        case 'text_long':
          // If attribute is not coming in response, then unset it.
          if (!isset($values[$source])) {
            $sku->{$field_key}->setValue(NULL);
          }
          else {
            $value = $values[$source];
            $value = !empty($field['serialize']) ? serialize($value) : $value;
            $sku->{$field_key}->setValue($value);
          }
          break;
      }
    }
  }