Validates the provided target create struct.

@throws \Netgen\BlockManager\Exception\Validation\ValidationException If the validation failed
17360
public function validateTargetCreateStruct(TargetCreateStruct $targetCreateStruct): void
    {
        $this->validate(
            $targetCreateStruct->type,
            [
                new Constraints\NotBlank(),
                new Constraints\Type(['type' => 'string']),
            ],
            'type'
        );

        $targetType = $this->targetTypeRegistry->getTargetType($targetCreateStruct->type);

        $this->validate(
            $targetCreateStruct->value,
            $targetType->getConstraints(),
            'value'
        );
    }
896386
protected function validate(Model $model)
    {
        $attributes = $model->getAttributes();

        $messages = isset($model->validationMessages) ? $model->validationMessages : [];

        $validator = $this->factory->make($attributes, $model->rules, $messages);

        if ($validator->fails()) {
            throw new ValidationException($validator->getMessageBag());
        }

        if (method_exists($model, 'validate')) {
            $model->validate();
        }
    }
1074654
private function buildValidation() {
        $validation = new Object\Index($this->getConfiguration());
        $validation->setNamespace(
            $this->getConfiguration()->getRootNamespace()
            . '\Services\Behavior\\' . $this->getConfiguration()->getModelSubNamespace()
            . '\Generated'
        );
        $validation->setName($this->getAbstractClass()->getName());
        $validation->setAbstract(true);
        $validation->setExtends('BehaviorBase');
        $validation->addUse(str_replace('\Generated', '', $this->getAbstractClass()->getNamespace()) . '\\' . $this->getAbstractClass()->getName() . ' as Model');
        $validation->addUse('Phalcon\Mvc\Model\Message');
        $validation->addUse('Bullhorn\FastRest\Api\Services\Behavior\BehaviorBase');


        $method = new Object\Method();
        $method->setAccess('public');
        $method->setName('getEntity');
        $method->setReturnType('Model');
        $method->setContent('return parent::getEntity();');
        $validation->addMethod($method);


        //Before Delete Method
        $content = '';
        foreach($this->getRelationships() as $relationship) {
            if($relationship->isPlural() && !$relationship->isNullable() && $relationship->getAction() != 'ACTION_CASCADE') {
                $content .= 'parent::beforeDelete();
        if($this->isUnitTestingChildren()) {
            return;
        }
        $entity = $this->getEntity();
        if ($entity->count' . ucfirst($relationship->getAlias()) . '()>0) {
			$entity->appendMessage(new Message(\'Multiple ' . ucfirst($relationship->getAlias()) . ' found\'));
		}';
            }
        }
        $method = new Object\Method();
        $method->setAccess('protected');
        $method->setDescription('Validates if the entity can be deleted');
        $method->setReturnType('void');
        $method->setName('beforeDelete');
        $method->setContent($content);
        $validation->addMethod($method);
        //End Before Delete Method


        //Validation Method
        $content = 'parent::validation();
        if($this->isUnitTestingChildren()) {
            return;
        }
        $entity = $this->getEntity();
        //Check to see if it is automatically updated
		$automaticAttributes = $entity->getModelsMetaData()->getAutomaticCreateAttributes($entity);
		$columnMap = $entity->getModelsMetaData()->getColumnMap($entity);
		$automaticFields = array_fill_keys($entity->getAutomaticallyUpdatedFields(), null);
		foreach($automaticAttributes as $fullName=>$null) {
			$automaticFields[$columnMap[$fullName]] = null;
		}
';
        foreach($this->getFields() as $field) {
            if(!is_null($field->getEnumOptions())) {
                $validation->addUse('Phalcon\Mvc\Model\Validator\Inclusionin as ValidateEnum');
                $subMethod = new Object\Method();
                $subMethod->setAccess('private');
                $subMethod->setDescription('Validates ' . $field->getShortName() . ' is in the enum list');
                $subMethod->setReturnType('void');
                $subMethod->setName('validate' . ucfirst($field->getShortName()) . 'Enum');
                $subMethod->setContent(
                    '$this->validate(
			new ValidateEnum(
				array(
					\'field\' => \'' . $field->getShortName() . '\',
					\'domain\' => [\'' . implode('\',\'', $field->getEnumOptions()) . '\']
				)
			)
		);'
                );
                $validation->addMethod($subMethod);
                $content .= '		$this->validate' . ucfirst($field->getShortName()) . 'Enum();
';
            }
            if(!$field->isNullable()) {
                $subMethod = new Object\Method();
                $subMethod->setAccess('private');
                $subMethod->setDescription('Validates ' . $field->getShortName() . ' is not null');
                $subMethod->setReturnType('void');
                $subMethod->setName('validate' . ucfirst($field->getShortName()) . 'NotNull');
                $parameter = new Object\Parameter();
                $parameter->setName('entity');
                $parameter->setType('Model');
                $parameter->setStrictType(true);
                $subMethod->addParameter($parameter);
                $parameter = new Object\Parameter();
                $parameter->setName('automaticFields');
                $parameter->setType('array');
                $parameter->setStrictType(true);
                $subMethod->addParameter($parameter);
                $subMethod->setContent(
                    'if(!array_key_exists(\'' . $field->getShortName() . '\', $automaticFields) && is_null($entity->readAttribute(\'' . $field->getShortName() . '\'))) {
			$entity->appendMessage(new Message(\'Null Error with the field: ' . $field->getShortname() . ', Expected Type: ' . $field->getType() . '\'));
		}'
                );
                $validation->addMethod($subMethod);
                $content .= '		$this->validate' . ucfirst($field->getShortName()) . 'NotNull($entity, $automaticFields);
';
            }
        }

        foreach($this->getIndexes() as $index) {
            if($index->isUnique() && !$index->isPrimary()) {
                $validation->addUse('Bullhorn\FastRest\Api\Services\Validator\Unique as ValidateUnique');
                $fields = array();
                foreach($index->getColumns() as $column) {
                    $fields[] = $this->getField($column)->getShortName();
                }
                $name = 'validate';
                foreach($fields as $field) {
                    $name .= ucfirst($field);
                }
                $name .= 'Unique';
                $subMethod = new Object\Method();
                $subMethod->setAccess('private');
                $subMethod->setDescription('Validates this combination of ' . implode(', ', $fields) . ' is unique in the database');
                $subMethod->setReturnType('void');
                $subMethod->setName($name);
                $subMethod->setContent(
                    '$this->validate(
			$validation = new ValidateUnique(
				[
					\'fields\'  => [\'' . implode('\',\'', $fields) . '\'],
					\'message\' => \'A unique constraint failed on: ' . implode(',', $fields) . '\'
				]
			)
		);'
                );
                $validation->addMethod($subMethod);
                $content .= '		$this->' . $name . '();
';
            }
        }

        foreach($this->getRelationships() as $relationship) {
            $field = $this->getField($relationship->getLocalColumn());
            if(!$relationship->isPlural()) {
                //Ex: Not Required relationship, make sure if the value isn't null, it is valid
                $subMethod = new Object\Method();
                $subMethod->setAccess('private');
                $subMethod->setDescription('Validates the ' . ucfirst($relationship->getAlias()) . ' Relationship');
                $subMethod->setReturnType('void');
                $subMethod->setName('validate' . ucfirst($relationship->getAlias()) . 'Relationship');
                $parameter = new Object\Parameter();
                $parameter->setName('entity');
                $parameter->setType('Model');
                $parameter->setStrictType(true);
                $subMethod->addParameter($parameter);
                $subMethod->setContent(
                    'if ($entity->get' . ucfirst($relationship->getAlias()) . '()===false '
                    . ($field->isNullable() ? '&& !is_null($entity->get' . ucfirst($field->getShortName()) . '())' : '') . ') {
			$entity->appendMessage(new Message(\'No ' . ucfirst($relationship->getAlias()) . ' found with the id \'.$entity->get' . ucfirst($field->getShortName()) . '()));
		}'
                );
                $validation->addMethod($subMethod);
                $content .= '		$this->validate' . ucfirst($relationship->getAlias()) . 'Relationship($entity);
';
            }
        }
        $method = new Object\Method();
        $method->setAccess('protected');
        $method->setDescription('Validates if the entity can be updated or inserted');
        $method->setReturnType('void');
        $method->setName('validation');
        $method->setContent($content);
        $validation->addMethod($method);
        //End Validation Method

        $this->setValidationClass($validation);

        $childValidation = new Object\Index($this->getConfiguration());
        $childValidation->setNamespace(
            $this->getConfiguration()->getRootNamespace()
            . '\Services\Behavior\\' . $this->getConfiguration()->getModelSubNamespace()
        );
        $childValidation->setName($this->getAbstractClass()->getName());
        $childValidation->setExtends('Generated\\' . $this->getAbstractClass()->getName());
        $childValidation->addUse(str_replace('\Generated', '', $this->getAbstractClass()->getNamespace()) . '\\' . $this->getAbstractClass()->getName() . ' as Model');

        $this->setValidationChildClass($childValidation);
        $this->getAbstractClass()->addUse($childValidation->getNamespace() . '\\' . $childValidation->getName() . ' as ModelValidator');
        return '		$this->addBehavior(new ModelValidator());' . "\n";
    }
259141
public function validate()
    {
        $this->debug->groupCollapsed(__METHOD__, $this->attribs['name']);
        $this->props['isValid'] = true;
        $this->classRemove($this->props['attribsContainer'], 'has-error');
        $attribs = $this->attribs;
        if (\in_array($attribs['type'], array('checkbox','radio','select'))) {  // these types use the 'options' array
            $this->validateCrs();
        } elseif (\in_array($attribs['type'], array('submit','reset','image'))) {
            $this->debug->log('not checking');
        } elseif (!empty($this->props['newPage'])) {
            $this->debug->log('not checking newPage');
        } elseif (\in_array($attribs['type'], array('file'))) {
            $this->debug->log($attribs['name'].' is a file type');
            if ($this->isRequired() && empty($attribs['disabled']) && empty($attribs['value'])) {
                $this->flag();
            }
        } elseif ($this->isRequired() || $this->props['flagNonReqInvalid']) {
            if (!empty($attribs['placeholder']) && $attribs['value'] === $attribs['placeholder']) {
                $this->debug->log('value == placeholder');
                $attribs['value'] = null;
            }
            $this->validateFromAttributes();
        }
        if ($this->props['isValid']) {
            $isValid = $this->doValidate();
            // validate callback may call flag() directly
            if ($this->props['isValid'] && !$isValid) {
                $this->flag();
            }
        }
        $this->debug->groupEnd();
        return $this->props['isValid'];
    }
560653
public function validate()
    {
        if ($this->getError() === null) {
            $this->verifySettings();
        }
        if ($this->getError() !== null) {
            throw new BuildException($this->errmsg, $this->cause);
        }
    }
933878
public function validate() {
        if (!$this->_data) {
            return false;
        }

        $fields = $this->getFields();
        $messages = $this->getMessages();

        foreach ($this->_data as $field => $value) {
            if (empty($this->_rules[$field])) {
                continue;
            }

            foreach ($this->_rules[$field] as $rule => $params) {
                $options = $params['options'];
                $arguments = $options;
                array_unshift($arguments, $value);

                // Use G11n if it is available
                if (class_exists('Titon\G11n\Utility\Validate')) {
                    $class = 'Titon\G11n\Utility\Validate';
                } else {
                    $class = 'Titon\Utility\Validate';
                }

                if (!call_user_func(array($class, 'hasMethod'), $rule)) {
                    throw new InvalidValidationRuleException(sprintf('Validation rule %s does not exist', $rule));
                }

                // Prepare messages
                $message = $params['message'];

                if (!$message && isset($messages[$rule])) {
                    $message = $messages[$rule];
                }

                if ($message) {
                    $message = String::insert($message, array_map(function($value) {
                        return is_array($value) ? implode(', ', $value) : $value;
                    }, $options + array(
                        'field' => $field,
                        'title' => $fields[$field]
                    )));
                } else {
                    throw new InvalidValidationRuleException(sprintf('Error message for rule %s does not exist', $rule));
                }

                if (!call_user_func_array(array($class, $rule), $arguments)) {
                    $this->addError($field, $message);
                    break;
                }
            }
        }

        return empty($this->_errors);
    }
1176143
public function validate(array $data)
    {
        try {
            $messages = $this->validateArray($data, $this->nested);

        } catch (\RuntimeException $e) {
            throw (new ValidationException($e->getMessage(), $e->getCode(), $e))->setMessages();
        }

        if (!empty($messages)) {
            throw (new ValidationException())->setMessages($messages);
        }
    }
821994
public function validate() {

		if ($this->getLineItemUniqueId() === null) {
			throw new ValidationException("'lineItemUniqueId' can't be null", 'lineItemUniqueId', $this);
		}
		if ($this->getQuantityReduction() === null) {
			throw new ValidationException("'quantityReduction' can't be null", 'quantityReduction', $this);
		}
		if ($this->getUnitPriceReduction() === null) {
			throw new ValidationException("'unitPriceReduction' can't be null", 'unitPriceReduction', $this);
		}
	}
1165983
public function validate()
	{
		$varValue = $this->getPost($this->strName);

		if (!empty($varValue) && !$this->isValidOption($varValue))
		{
			$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], (is_array($varValue) ? implode(', ', $varValue) : $varValue)));
		}

		parent::validate();
	}
107567
public function validate() {
    if (empty($this->fromPrefix)) {
      throw new BuildException("fromPrefix attribute is required.", $this->location);
    }

    if (empty($this->toPrefix)) {
      throw new BuildException("toPrefix attribute is required.", $this->location);
    }
  }
726387
protected function performValidation()
    {
        $this->requireProperties(['name', 'in']);
        if ($this->in === 'path') {
            $this->requireProperties(['required']);
            if (!$this->required) {
                $this->addError("Parameter 'required' must be true for 'in': 'path'.");
            }
        }
        if (!empty($this->content) && !empty($this->schema)) {
            $this->addError("A Parameter Object MUST contain either a schema property, or a content property, but not both. ");
        }
    }
480603
public function validate()
    {
        if (!$this->translations) {
            throw new MappingException(sprintf('No translations specified for %s', $this->name));
        }

        if (!$this->targetEntity) {
            throw new MappingException(sprintf('No translations targetEntity specified for %s', $this->name));
        }
    }
359286
public function validate() {
		$errors = array();
		if ($this->getType() == self::TYPE_DECLARATIVE) {
			$classDescriptor = $this->getClassDescriptor();
			$constructor = $classDescriptor->getConstructor();
			
			if ($constructor) {
				$params = $constructor->getParameters();
				
				$i=0;
				
				foreach ($params as $param) {
					/* @var $param MoufReflectionParameter */
					if (!$param->isOptional()) {
						if (!$this->moufManager->isParameterSetForConstructor($this->getIdentifierName(), $i)) {
							$name = $this->getIdentifierName();
							if ($this->isAnonymous()) {
								$name = "anonymous instance of class ".$this->getClassName();
							}
							$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is compulsory.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
						} elseif (!$param->allowsNull()) {
							$name = $this->getIdentifierName();
							if ($this->isAnonymous()) {
								$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
							}
							if ($this->moufManager->getParameterForConstructor($this->getIdentifierName(), $i) === null) {
								$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is null, but the constructor signature does not allow it to be null.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
							}
						}
					}
					if ($this->moufManager->getParameterTypeForConstructor($this->getIdentifierName(), $i) == 'php') {
						$name = $this->getIdentifierName();
						// Ok, we need to check the code.
						$code = $this->moufManager->getParameterForConstructor($name, $i);
						try {
							CodeValidatorService::validateCode($code);
						} catch (Error $e) {
							if ($this->isAnonymous()) {
								$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
							}
							$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
						}
					}		
					$i++;
				}
			}
			
			foreach ($classDescriptor->getInjectablePropertiesByPublicProperty() as $propertyName=>$moufProperty) {
				$property = $this->getPublicFieldProperty($propertyName);
				if ($property->getOrigin() == 'php') {
					$code = $property->getValue();
					try {
						CodeValidatorService::validateCode($code);
					} catch (Error $e) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
						$errors[] = "In instance <em>".$name."</em>, the public property
									'".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
													<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				}
			}
			
			foreach ($classDescriptor->getInjectablePropertiesBySetter() as $propertyName=>$moufProperty) {
				$property = $this->getSetterProperty($propertyName);
				if ($property->getOrigin() == 'php') {
					$code = $property->getValue();
					try {
						CodeValidatorService::validateCode($code);
					} catch (Error $e) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
						$errors[] = "In instance <em>".$name."</em>, the setter
									'".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
											<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				}
			}
			
			// Now, let's check that the MoufManager instance definition is not using properties that where once declared
			// but that no longer exist in the class:
			
			$definedPublicProperties = $this->moufManager->getParameterNames($this->name);
			if ($definedPublicProperties) {
				$missingPublicProperties = array_diff($definedPublicProperties, array_keys($classDescriptor->getInjectablePropertiesByPublicProperty()));
				foreach ($missingPublicProperties as $missingPublicPropertyName) {
					$name = $this->getIdentifierName();
					if ($this->isAnonymous()) {
						$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
					}
					
					$errors[] = "In instance <em>".$name."</em>, the public property
								'".$missingPublicPropertyName."' is declared but does not exist. It is likely it once existed but was renamed or removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
			}
			
			$definedSetters = $this->moufManager->getParameterNamesForSetter($this->name);
			if ($definedSetters) {
				$missingSetters = array_diff($definedSetters, array_keys($classDescriptor->getInjectablePropertiesBySetter()));
				foreach ($missingSetters as $missingSetterName) {
					$name = $this->getIdentifierName();
					if ($this->isAnonymous()) {
						$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
					}
				
					$errors[] = "In instance <em>".$name."</em>, the setter
								'".$missingSetterName."()' is declared but does not exist. It is likely it once existed but was renamed or removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
			}
			
			$definedConstructorArguments = $this->moufManager->getParameterNamesForConstructor($this->name);
			if ($definedConstructorArguments) {
				$constructor = $classDescriptor->getConstructor();
				if ($constructor) {
					$nbParameters = $classDescriptor->getConstructor()->getNumberOfParameters();
					$missingConstructorArguments = array_filter($definedConstructorArguments, function($nb) use ($nbParameters) { return $nbParameters <= $nb; });
					foreach ($missingConstructorArguments as $missingArgument) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
					
						$errors[] = "In instance <em>".$name."</em>, the constructor argument
								n°".$missingArgument." is used but does not exist. It is likely it once existed but was removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				} else {
					$name = $this->getIdentifierName();
					$errors[] = "In instance <em>".$name."</em>, parameters are injected in the constructor but the constructor does not exist. It is likely it once existed but was removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
				
				
			}
				
		} else {
			$error = $this->moufManager->getErrorOnInstanceCode($this->getIdentifierName());
			if ($error) {
				$name = $this->getIdentifierName();
				if ($this->isAnonymous()) {
					$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
				}
				$errors[] = "The instance <em>".$name."</em> is declared by PHP code and is throwing an error message:
								$error
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
			}
		}
		return $errors;
	}
119741
public function validate()
    {
        $setToBreak = false;

        foreach ($this->_validations as $v) {
            foreach ($v['fields'] as $field) {
                if (isset($this->_skips[$field])) {
                    if ($this->_skips[$field] === self::SKIP_ALL) {
                        break 2;
                    }

                    if ($this->_skips[$field] === self::SKIP_ONE) {
                        break;
                    }
                }

                [$values, $multiple] = $this->getPart($this->_fields, \explode('.', $field));

                // Don't validate if the field is not required and the value is empty
                if (null !== $values && $this->hasRule('optional', $field)) {
                    //Continue with execution below if statement
                } elseif (
                    $v['rule'] !== 'accepted' &&
                    $v['rule'] !== 'required' && !$this->hasRule('required', $field) &&
                    (null === $values || $values === '' || ($multiple && \count($values) === 0))
                ) {
                    continue;
                }

                // Callback is user-specified or assumed method on class
                $errors = $this->getRules();
                if (isset($errors[$v['rule']])) {
                    $callback = $errors[$v['rule']];
                } else {
                    $callback = [$this, 'validate' . \ucfirst($v['rule'])];
                }

                if (!$multiple) {
                    $values = [$values];
                }

                $result = true;
                foreach ($values as $value) {
                    $result = $result && $callback($field, $value, $v['params'], $this->_fields);
                }

                if (!$result) {
                    $this->error($field, $v['message'], $v['params']);
                    if ($this->stopOnFirstFail) {
                        $setToBreak = true;
                        break;
                    }
                    $this->_skips[$field] = $v['skip'];
                }
            }

            if ($setToBreak) {
                break;
            }
        }

        return \count($this->errors()) === 0;
    }
517163
public function validateTarget($target)
    {
        if ($target instanceof Application) {
            $validator = new ApplicationValidator();
            $response = $validator->validate($target);
        } elseif ($target instanceof ApplicationGroup) {
            $validator = new ApplicationGroupValidator();
            $response = $validator->validate($target);
        } else {
            $this->addError('target', 'Target must be a valid instance of Application or ApplicationGroup');
            return false;
        }

        if (!$response) {
            $this->addError('target', 'Target must be a valid instance of Application or ApplicationGroup class - ' . $validator->getErrorsAsString());
        }

        return $response;
    }
508232
public function validate() {

		if ($this->getFieldName() === null) {
			throw new ValidationException("'fieldName' can't be null", 'fieldName', $this);
		}
		if ($this->getSorting() === null) {
			throw new ValidationException("'sorting' can't be null", 'sorting', $this);
		}
	}
813346
public function validateBlockUpdateStruct(Block $block, BlockUpdateStruct $blockUpdateStruct): void
    {
        $this->validate(
            $blockUpdateStruct,
            [
                new BlockUpdateStructConstraint(
                    [
                        'payload' => $block,
                    ]
                ),
            ]
        );

        $this->validate(
            $blockUpdateStruct,
            new ConfigAwareStructConstraint(
                [
                    'payload' => $block->getDefinition(),
                    'allowMissingFields' => true,
                ]
            )
        );
    }