<?php

declare (strict_types=1);
namespace idoit\Module\JDisc\Graphql\Schema\UnionResolveType;

use GraphQL\Type\Definition\ResolveInfo;
use Axtiva\FlexibleGraphql\Resolver\UnionResolveTypeInterface;
use idoit\Module\JDisc\Graphql\Schema\Model\DatabaseIdBasedReportActionType;
use idoit\Module\JDisc\Graphql\Schema\Model\OpenReportWithFilterActionType;
use idoit\Module\JDisc\Graphql\Schema\Model\OpenReportWithFilterSingleSelectActionType;
use idoit\Module\JDisc\Graphql\Schema\Model\ReportActionType;
use idoit\Module\JDisc\Graphql\Schema\Model\SeparatorActionType;
use idoit\Module\JDisc\Graphql\Schema\Model\CreateDiagramActionType;

/**
 * This code is @generated by axtiva/flexible-graphql-php
 * and will be regenerated. Do not edit it manually
 */
final class ReportActionInterfaceTypeResolver implements UnionResolveTypeInterface
{
    public function __invoke($model, $context, ResolveInfo $info)
    {
        if (isset($model)) {
            switch (get_class($model)) {
                case DatabaseIdBasedReportActionType::class:
                    return $info->schema->getType('DatabaseIdBasedReportAction');
                case OpenReportWithFilterActionType::class:
                    return $info->schema->getType('OpenReportWithFilterAction');
                case OpenReportWithFilterSingleSelectActionType::class:
                    return $info->schema->getType('OpenReportWithFilterSingleSelectAction');
                case ReportActionType::class:
                    return $info->schema->getType('ReportAction');
                case SeparatorActionType::class:
                    return $info->schema->getType('SeparatorAction');
                case CreateDiagramActionType::class:
                    return $info->schema->getType('CreateDiagramAction');
            }
        }
        return null;
    }
}