<?php

namespace Fifa\ConnectId\Sdk\ApiModelValidation;

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

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

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

        ApiModelValidator::cannotBeNullOrWhitespace($validationSubject->getName(), $validationSubjectName.".name");
        ApiModelValidator::validateDoNotAllowNull($validationSubject->getEmail(), EmailValidator::class, $validationSubjectName.".email");
    }
}