<?php
namespace Fifa\ConnectId\Sdk\Exception;

use Fifa\ConnectId\Sdk\Api\ApiException;
use Fifa\ConnectId\Sdk\Api\Model\OrganisationLocalType;

/**
 * Class FifaOrganisationMergedException
 * @package Fifa\ConnectId\Sdk\Exception
 */
class FifaOrganisationMergedException extends FifaConnectIdException
{
    /**
     * @var OrganisationLocalType
     */
    private $requestedOrganisation;

    /**
     * @var string
     */
    private $primaryOrganisationFIFAId;

    /**
     * Constructor
     *
     * @param ApiException $apiException
     * @param string $message
     * @param string $primaryOrganisationFIFAId
     * @param OrganisationLocalType $requestedOrganisation
     */
    public function __construct(ApiException $apiException, $message, $primaryOrganisationFIFAId, OrganisationLocalType $requestedOrganisation)
    {
        parent::__construct($apiException, $message, $apiException->getCode());
        $this->primaryOrganisationFIFAId = $primaryOrganisationFIFAId;
        $this->requestedOrganisation = $requestedOrganisation;
    }

    /**
     * Returns primary organisation FIFA ID
     *
     * @return string
     */
    public function getPrimaryOrganisationFifaId(): string
    {
        return $this->primaryOrganisationFIFAId;
    }

    /**
     * Sets primary organisation FIFA ID
     *
     * @param string $primaryOrganisationFifaId
     * @return FifaOrganisationMergedException
     */
    public function setPrimaryOrganisationFifaId(string $primaryOrganisationFifaId): FifaOrganisationMergedException
    {
        $this->primaryOrganisationFIFAId = $primaryOrganisationFifaId;
        return $this;
    }

    /**
     * Returns requested organisation
     *
     * @return OrganisationLocalType
     */
    public function getRequestedOrganisation(): OrganisationLocalType
    {
        return $this->requestedOrganisation;
    }

    /**
     * Sets requested organisation
     *
     * @param OrganisationLocalType $requestedOrganisation
     * @return FifaOrganisationMergedException
     */
    public function setRequestedOrganisation(OrganisationLocalType $requestedOrganisation): FifaOrganisationMergedException
    {
        $this->requestedOrganisation = $requestedOrganisation;
        return $this;
    }
}