<?php

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

use GraphQL\Type\Definition\ResolveInfo;
use Axtiva\FlexibleGraphql\Resolver\UnionResolveTypeInterface;
use idoit\Module\SyneticsJdisc\Graphql\Schema\Model\DefaultProgressInfoExType;
use idoit\Module\SyneticsJdisc\Graphql\Schema\Model\FaultProgressInfoExType;
use idoit\Module\SyneticsJdisc\Graphql\Schema\Model\FinishProgressInfoExType;

/**
 * This code is @generated by axtiva/flexible-graphql-php
 * and will be regenerated. Do not edit it manually
 * This object contains information about background processes and their status/progress.
Lengthy operations can return a ProgressInfo object which holds the current state of the operation.
The client can poll with the instanceId the status of such an operation.

Once the operation has failed or finished, the result will stay on the server for a while and will then be deleted. */
final class ProgressInfoExTypeResolver implements UnionResolveTypeInterface
{
    public function __invoke($model, $context, ResolveInfo $info)
    {
        if (isset($model)) {
            switch (get_class($model)) {
                case DefaultProgressInfoExType::class:
                    return $info->schema->getType('DefaultProgressInfoEx');
                case FaultProgressInfoExType::class:
                    return $info->schema->getType('FaultProgressInfoEx');
                case FinishProgressInfoExType::class:
                    return $info->schema->getType('FinishProgressInfoEx');
            }
        }
        return null;
    }
}