<?php

namespace Fifa\ConnectId\Sdk\ApiModelValidation;

use Fifa\ConnectId\Sdk\Api\Model\BulkDeactivateRegistrationsRequestType;
use Fifa\ConnectId\Sdk\Registration\ValidationException;
use ReflectionClass;

class BulkDeactivateRegistrationsRequestTypeValidator
{
    /**
     * Method that validates object provided and throws exception when object's properties are invalid
     *
     * @param BulkDeactivateRegistrationsRequestType|null $validationSubject
     * @param string $validationSubjectName
     * @return void
     * @throws ValidationException
     */
    public static function validate(?BulkDeactivateRegistrationsRequestType $validationSubject, string $validationSubjectName)
    {
        $validationSubjectName = ApiModelValidator::resolveValidationSubjectName($validationSubject, $validationSubjectName);

        ApiModelValidator::cannotBeNull($validationSubject, $validationSubjectName);
        ApiModelValidator::validateAllInCollection($validationSubject->getPersons(), PersonDeactivateTypeValidator::class, $validationSubjectName.".persons");
    }
}