<?php

namespace Fifa\ConnectId\Sdk\ApiModelValidation;

use Fifa\ConnectId\Sdk\Api\Model\PersonDeactivateType;
use Fifa\ConnectId\Sdk\Registration\ValidationException;

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

        ApiModelValidator::cannotBeNull($validationSubject, $validationSubjectName);

        ApiModelValidator::validateDoNotAllowNull($validationSubject->getPersonId(), FifaIdValidator::class, $validationSubjectName.".personId");
        ContextTypeValidator::validate($validationSubject->getRegistrations(), $validationSubjectName.".registrations");
    }
}