<?php

namespace Fifa\ConnectId\Sdk\ApiModelValidation;

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

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

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

        ContextTypeValidator::validate($validationSubject->getPerson(), $validationSubjectName.".person");

        ApiModelValidator::validateAllInCollection($validationSubject->getNameHashes(), HashedNameTypeValidator::class, $validationSubjectName.".nameHashes");
        ApiModelValidator::validateAllInCollectionAllowNull($validationSubject->getOrganisationsFIFAIds(), FifaIdValidator::class, $validationSubjectName.".organisationsFIFAIds");
    }
}