<?php

namespace Fifa\ConnectId\Sdk\ApiModelValidation;

use Fifa\ConnectId\Sdk\Api\Model\OrganisationOfficialRegistrationType;
use Fifa\ConnectId\Sdk\Registration\ValidationException;
use Fifa\ConnectId\Sdk\Util\Data\Person\OrganisationOfficialRole;
use Fifa\ConnectId\Sdk\Util\Data\Status;

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

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

        ApiModelValidator::validateDoNotAllowNull($validationSubject->getOrganisationFIFAId(), FifaIdValidator::class, $validationSubjectName.".organisationFIFAId");

        ApiModelValidator::mustMatchEnumValue($validationSubject->getStatus(), Status::getStatuses(), $validationSubjectName.".status");
        ApiModelValidator::mustMatchEnumValue($validationSubject->getOrganisationOfficialRole(), OrganisationOfficialRole::getOrganisationOfficialRoles(), $validationSubjectName.".organisationOfficialRole");
        ApiModelValidator::validateAllowNull($validationSubject->getSystemId(), SystemIdValidator::class, $validationSubjectName.".systemId");
    }
}