<?php

namespace Fifa\ConnectId\Sdk\ApiModelValidation;

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

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

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

        ApiModelValidator::validateAllowNull($validationSubject->getPictureEmbedded(), PictureEmbeddedTypeValidator::class, $validationSubjectName.".pictureEmbedded");
        ApiModelValidator::validateAllowNull($validationSubject->getPictureLink(), PictureLinkTypeValidator::class, $validationSubjectName.".pictureLink");
    }
}