<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus;

use Gls\GlsPoland\Soap\Client\Caller\CallerInterface;
use Gls\GlsPoland\Soap\Client\Exception\SoapException;
use Gls\GlsPoland\Soap\Client\Type\RequestInterface;
use Gls\GlsPoland\Soap\Client\Type\ResultInterface;

/**
 * @see https://adeplus.gls-poland.com/adeplus/pm1/manuals/webapi2_pl/chapters/function_list_en.htm
 */
class Client
{
    private $caller;
    private $sandbox;

    public function __construct(CallerInterface $caller, bool $isSandbox)
    {
        $this->caller = $caller;
        $this->sandbox = $isSandbox;
    }

    public function isSandbox(): bool
    {
        return $this->sandbox;
    }

    /**
     * @return ResultInterface|Authorization\Session
     */
    public function loginIntegrator(Authorization\LoginIntegrator $parameters): Authorization\Session
    {
        return $this->caller->call('adeLoginIntegrator', $parameters);
    }

    /**
     * @return ResultInterface|Authorization\Session
     */
    public function logout(Authorization\Logout $parameters): Authorization\Session
    {
        return $this->caller->call('adeLogout', $parameters);
    }

    /**
     * @return ResultInterface|Common\Id
     */
    public function preparingBoxInsert(PreparingBox\Insert $parameters): Common\Id
    {
        return $this->caller->call('adePreparingBox_Insert', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePreparingBoxInsertExt $parameters
     *
     * @return ResultInterface|Type\AdePreparingBoxInsertExtResponse
     *
     * @throws SoapException
     */
    public function adePreparingBox_InsertExt(Type\AdePreparingBoxInsertExt $parameters): Type\AdePreparingBoxInsertExtResponse
    {
        return $this->caller->call('adePreparingBox_InsertExt', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePreparingBoxGetConsignIDs $parameters
     *
     * @return ResultInterface|Type\AdePreparingBoxGetConsignIDsResponse
     *
     * @throws SoapException
     */
    public function adePreparingBox_GetConsignIDs(Type\AdePreparingBoxGetConsignIDs $parameters): Type\AdePreparingBoxGetConsignIDsResponse
    {
        return $this->caller->call('adePreparingBox_GetConsignIDs', $parameters);
    }

    /**
     * @return ResultInterface|Common\Id
     */
    public function preparingBoxDeleteConsignment(PreparingBox\DeleteConsignment $parameters): Common\Id
    {
        return $this->caller->call('adePreparingBox_DeleteConsign', $parameters);
    }

    /**
     * @return ResultInterface|Consignment\Consignment
     */
    public function preparingBoxGetConsignment(PreparingBox\GetConsignment $parameters): Consignment\Consignment
    {
        return $this->caller->call('adePreparingBox_GetConsign', $parameters);
    }

    /**
     * @return ResultInterface|Printout\Labels
     */
    public function preparingBoxGetConsignmentLabels(PreparingBox\GetConsignmentLabels $parameters): Printout\Labels
    {
        return $this->caller->call('adePreparingBox_GetConsignLabels', $parameters);
    }

    /**
     * @return ResultInterface|Printout\LabelsCollection
     */
    public function preparingBoxGetConsignmentLabelsExt(PreparingBox\GetConsignmentLabelsExt $parameters): Printout\LabelsCollection
    {
        return $this->caller->call('adePreparingBox_GetConsignLabelsExt', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePreparingBoxGetConsignDocs $parameters
     *
     * @return ResultInterface|Type\AdePreparingBoxGetConsignDocsResponse
     *
     * @throws SoapException
     */
    public function adePreparingBox_GetConsignDocs(Type\AdePreparingBoxGetConsignDocs $parameters): Type\AdePreparingBoxGetConsignDocsResponse
    {
        return $this->caller->call('adePreparingBox_GetConsignDocs', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePreparingBoxGetConsignsLabels $parameters
     *
     * @return ResultInterface|Type\AdePreparingBoxGetConsignsLabelsResponse
     *
     * @throws SoapException
     */
    public function adePreparingBox_GetConsignsLabels(Type\AdePreparingBoxGetConsignsLabels $parameters): Type\AdePreparingBoxGetConsignsLabelsResponse
    {
        return $this->caller->call('adePreparingBox_GetConsignsLabels', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePreparingBoxGetParcelLabel $parameters
     *
     * @return ResultInterface|Type\AdePreparingBoxGetParcelLabelResponse
     *
     * @throws SoapException
     */
    public function adePreparingBox_GetParcelLabel(Type\AdePreparingBoxGetParcelLabel $parameters): Type\AdePreparingBoxGetParcelLabelResponse
    {
        return $this->caller->call('adePreparingBox_GetParcelLabel', $parameters);
    }

    /**
     * @return ResultInterface|Common\Id
     */
    public function pickupCreate(Pickup\Create $parameters): Common\Id
    {
        return $this->caller->call('adePickup_Create', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetIDs $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetIDsResponse
     *
     * @throws SoapException
     */
    public function adePickup_GetIDs(Type\AdePickupGetIDs $parameters): Type\AdePickupGetIDsResponse
    {
        return $this->caller->call('adePickup_GetIDs', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGet $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetResponse
     *
     * @throws SoapException
     */
    public function adePickup_Get(Type\AdePickupGet $parameters): Type\AdePickupGetResponse
    {
        return $this->caller->call('adePickup_Get', $parameters);
    }

    /**
     * @return ResultInterface|Pickup\ConsignmentIdsBindingsCollection
     */
    public function pickupGetConsignmentBindings(Pickup\GetConsignmentBindings $parameters): Pickup\ConsignmentIdsBindingsCollection
    {
        return $this->caller->call('adePickup_GetConsignBinds', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetConsignIDs $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetConsignIDsResponse
     *
     * @throws SoapException
     */
    public function adePickup_GetConsignIDs(
        Type\AdePickupGetConsignIDs $parameters): Type\AdePickupGetConsignIDsResponse
    {
        return $this->caller->call('adePickup_GetConsignIDs', $parameters);
    }

    /**
     * @return ResultInterface|Consignment\Consignment
     */
    public function pickupGetConsignment(Pickup\GetConsignment $parameters): Consignment\Consignment
    {
        return $this->caller->call('adePickup_GetConsign', $parameters);
    }

    /**
     * @return ResultInterface|Printout\PickupReceipt
     */
    public function pickupGetReceipt(Pickup\GetReceipt $parameters): Printout\PickupReceipt
    {
        return $this->caller->call('adePickup_GetReceipt', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetLabels $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetLabelsResponse
     *
     * @throws SoapException
     */
    public function adePickup_GetLabels(
        Type\AdePickupGetLabels $parameters): Type\AdePickupGetLabelsResponse
    {
        return $this->caller->call('adePickup_GetLabels', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetIdent $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetIdentResponse
     *
     * @throws SoapException
     */
    public function adePickup_GetIdent(Type\AdePickupGetIdent $parameters): Type\AdePickupGetIdentResponse
    {
        return $this->caller->call('adePickup_GetIdent', $parameters);
    }

    /**
     * @return ResultInterface|Printout\Labels
     */
    public function pickupGetConsignmentLabels(Pickup\GetConsignmentLabels $parameters): Printout\Labels
    {
        return $this->caller->call('adePickup_GetConsignLabels', $parameters);
    }

    /**
     * @return ResultInterface|Printout\LabelsCollection
     */
    public function pickupGetConsignmentLabelsExt(Pickup\GetConsignmentLabelsExt $parameters): Printout\LabelsCollection
    {
        return $this->caller->call('adePickup_GetConsignLabelsExt', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetParcelLabel $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetParcelLabelResponse
     *
     * @throws SoapException
     */
    public function adePickup_GetParcelLabel(
        Type\AdePickupGetParcelLabel $parameters): Type\AdePickupGetParcelLabelResponse
    {
        return $this->caller->call('adePickup_GetParcelLabel', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetParcelsLabels $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetParcelsLabelsResponse
     *
     * @throws SoapException
     */
    public function adePickup_GetParcelsLabels(
        Type\AdePickupGetParcelsLabels $parameters): Type\AdePickupGetParcelsLabelsResponse
    {
        return $this->caller->call('adePickup_GetParcelsLabels', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupParcelNumberSearch $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupParcelNumberSearchResponse
     *
     * @throws SoapException
     */
    public function adePickup_ParcelNumberSearch(
        Type\AdePickupParcelNumberSearch $parameters): Type\AdePickupParcelNumberSearchResponse
    {
        return $this->caller->call('adePickup_ParcelNumberSearch', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePartnerGetParcelNumber $parameters
     *
     * @return ResultInterface|Type\AdePartnerGetParcelNumberResponse
     *
     * @throws SoapException
     */
    public function adePartner_GetParcelNumber(Type\AdePartnerGetParcelNumber $parameters): Type\AdePartnerGetParcelNumberResponse
    {
        return $this->caller->call('adePartner_GetParcelNumber', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeTrackIDGet $parameters
     *
     * @return ResultInterface|Type\AdeTrackIDGetResponse
     *
     * @throws SoapException
     */
    public function adeTrackID_Get(Type\AdeTrackIDGet $parameters): Type\AdeTrackIDGetResponse
    {
        return $this->caller->call('adeTrackID_Get', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeProfileGetIDs $parameters
     *
     * @return ResultInterface|Type\AdeProfileGetIDsResponse
     *
     * @throws SoapException
     */
    public function adeProfile_GetIDs(Type\AdeProfileGetIDs $parameters): Type\AdeProfileGetIDsResponse
    {
        return $this->caller->call('adeProfile_GetIDs', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeProfileGetActive $parameters
     *
     * @return ResultInterface|Type\AdeProfileGetActiveResponse
     *
     * @throws SoapException
     */
    public function adeProfile_GetActive(Type\AdeProfileGetActive $parameters): Type\AdeProfileGetActiveResponse
    {
        return $this->caller->call('adeProfile_GetActive', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeProfileChange $parameters
     *
     * @return ResultInterface|Type\AdeProfileChangeResponse
     *
     * @throws SoapException
     */
    public function adeProfile_Change(Type\AdeProfileChange $parameters): Type\AdeProfileChangeResponse
    {
        return $this->caller->call('adeProfile_Change', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeLangGetActive $parameters
     *
     * @return ResultInterface|Type\AdeLangGetActiveResponse
     *
     * @throws SoapException
     */
    public function adeLang_GetActive(Type\AdeLangGetActive $parameters): Type\AdeLangGetActiveResponse
    {
        return $this->caller->call('adeLang_GetActive', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeLangChange $parameters
     *
     * @return ResultInterface|Type\AdeLangChangeResponse
     *
     * @throws SoapException
     */
    public function adeLang_Change(Type\AdeLangChange $parameters): Type\AdeLangChangeResponse
    {
        return $this->caller->call('adeLang_Change', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePfcGetStatus $parameters
     *
     * @return ResultInterface|Type\AdePfcGetStatusResponse
     *
     * @throws SoapException
     */
    public function adePfc_GetStatus(Type\AdePfcGetStatus $parameters): Type\AdePfcGetStatusResponse
    {
        return $this->caller->call('adePfc_GetStatus', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePfcGetDictionary $parameters
     *
     * @return ResultInterface|Type\AdePfcGetDictionaryResponse
     *
     * @throws SoapException
     */
    public function adePfc_GetDictionary(Type\AdePfcGetDictionary $parameters): Type\AdePfcGetDictionaryResponse
    {
        return $this->caller->call('adePfc_GetDictionary', $parameters);
    }

    /**
     * @return ResultInterface|SenderAddress\SenderAddressStatus
     */
    public function senderAddressGetStatus(SenderAddress\GetStatus $parameters): SenderAddress\SenderAddressStatus
    {
        return $this->caller->call('adeSendAddr_GetStatus', $parameters);
    }

    /**
     * @return ResultInterface|SenderAddress\SenderAddressesCollection
     */
    public function senderAddressGetDictionary(SenderAddress\GetDictionary $parameters): SenderAddress\SenderAddressesCollection
    {
        return $this->caller->call('adeSendAddr_GetDictionary', $parameters);
    }

    /**
     * @return ResultInterface|Services\Services
     */
    public function servicesGetAllowed(Services\GetAllowed $parameters): Services\Services
    {
        return $this->caller->call('adeServices_GetAllowed', $parameters);
    }

    /**
     * @return ResultInterface|Services\MaxCODAmount
     */
    public function servicesGetMaxCOD(Services\GetMaxCOD $parameters): Services\MaxCODAmount
    {
        return $this->caller->call('adeServices_GetMaxCOD', $parameters);
    }

    /**
     * @return ResultInterface|Services\MaxParcelWeights
     */
    public function servicesGetMaxParcelWeights(Services\GetMaxParcelWeights $parameters): Services\MaxParcelWeights
    {
        return $this->caller->call('adeServices_GetMaxParcelWeights', $parameters);
    }

    /**
     * @return ResultInterface|Services\Services
     *
     * @throws SoapException
     */
    public function servicesGetGuaranteed(Services\GetGuaranteed $parameters): Services\Services
    {
        return $this->caller->call('adeServices_GetGuaranteed', $parameters);
    }

    /**
     * @return ResultInterface|Common\StringArray
     */
    public function servicesGetCountriesSDS(Services\GetCountriesSDS $parameters): Common\StringArray
    {
        return $this->caller->call('adeServices_GetCountriesSDS', $parameters);
    }

    /**
     * @return ResultInterface|Common\StringArray
     */
    public function servicesGetCountriesSRS(Services\GetCountriesSRS $parameters): Common\StringArray
    {
        return $this->caller->call('adeServices_GetCountriesSRS', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeServicesGetCountriesCDX $parameters
     *
     * @return ResultInterface|Type\AdeServicesGetCountriesCDXResponse
     *
     * @throws SoapException
     */
    public function adeServices_GetCountriesCDX(Type\AdeServicesGetCountriesCDX $parameters): Type\AdeServicesGetCountriesCDXResponse
    {
        return $this->caller->call('adeServices_GetCountriesCDX', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeZipGetCity $parameters
     *
     * @return ResultInterface|Type\AdeZipGetCityResponse
     *
     * @throws SoapException
     */
    public function adeZip_GetCity(Type\AdeZipGetCity $parameters): Type\AdeZipGetCityResponse
    {
        return $this->caller->call('adeZip_GetCity', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeZipCustomsRequired $parameters
     *
     * @return ResultInterface|Type\AdeZipCustomsRequiredResponse
     *
     * @throws SoapException
     */
    public function adeZip_CustomsRequired(Type\AdeZipCustomsRequired $parameters): Type\AdeZipCustomsRequiredResponse
    {
        return $this->caller->call('adeZip_CustomsRequired', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeOptionGet $parameters
     *
     * @return ResultInterface|Type\AdeOptionGetResponse
     *
     * @throws SoapException
     */
    public function adeOption_Get(Type\AdeOptionGet $parameters): Type\AdeOptionGetResponse
    {
        return $this->caller->call('adeOption_Get', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeOptionSet $parameters
     *
     * @return ResultInterface|Type\AdeOptionSetResponse
     *
     * @throws SoapException
     */
    public function adeOption_Set(Type\AdeOptionSet $parameters): Type\AdeOptionSetResponse
    {
        return $this->caller->call('adeOption_Set', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\ParcelShop\AdeParcelShopSearchByZip $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\ParcelShop\AdeParcelShopSearchByZipResponse
     *
     * @throws SoapException
     */
    public function adeParcelShop_SearchByZip(
        ParcelShop\AdeParcelShopSearchByZip $parameters): ParcelShop\AdeParcelShopSearchByZipResponse
    {
        return $this->caller->call('adeParcelShop_SearchByZip', $parameters);
    }

    /**
     * @return ResultInterface|ParcelShop\ParcelShop
     */
    public function parcelShopSearchById(ParcelShop\SearchById $parameters): ParcelShop\ParcelShop
    {
        return $this->caller->call('adeParcelShop_SearchByID', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\ParcelShop\AdeParcelShopGetByCountry $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\ParcelShop\AdeParcelShopGetByCountryResponse
     *
     * @throws SoapException
     */
    public function adeParcelShop_GetByCountry(
        ParcelShop\AdeParcelShopGetByCountry $parameters): ParcelShop\AdeParcelShopGetByCountryResponse
    {
        return $this->caller->call('adeParcelShop_GetByCountry', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\ParcelShop\AdeParcelShop2GetByCountry $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\ParcelShop\AdeParcelShop2GetByCountryResponse
     *
     * @throws SoapException
     */
    public function adeParcelShop2_GetByCountry(ParcelShop\AdeParcelShop2GetByCountry $parameters): ParcelShop\CParcelShop2Array
    {
        return $this->caller->call('adeParcelShop2_GetByCountry', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\ParcelShop\AdeParcelShop2SearchByZip $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\ParcelShop\AdeParcelShop2SearchByZipResponse
     *
     * @throws SoapException
     */
    public function adeParcelShop2_SearchByZip(
        ParcelShop\AdeParcelShop2SearchByZip $parameters): ParcelShop\AdeParcelShop2SearchByZipResponse
    {
        return $this->caller->call('adeParcelShop2_SearchByZip', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePreparingBoxGetConsignCustomsDec $parameters
     *
     * @return ResultInterface|Type\AdePreparingBoxGetConsignCustomsDecResponse
     *
     * @throws SoapException
     */
    public function adePreparingBox_GetConsignCustomsDec(Type\AdePreparingBoxGetConsignCustomsDec $parameters): Type\AdePreparingBoxGetConsignCustomsDecResponse
    {
        return $this->caller->call('adePreparingBox_GetConsignCustomsDec', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetConsignCustomsDec $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetConsignCustomsDecResponse
     *
     * @throws SoapException
     */
    public function adePickup_GetConsignCustomsDec(
        Type\AdePickupGetConsignCustomsDec $parameters): Type\AdePickupGetConsignCustomsDecResponse
    {
        return $this->caller->call('adePickup_GetConsignCustomsDec', $parameters);
    }

    /**
     * @param RequestInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetConsignPODs $parameters
     *
     * @return ResultInterface|\Gls\GlsPoland\AdePlus\Type\AdePickupGetConsignPODsResponse
     *
     * @throws SoapException
     */
    public function adePickup_GetConsignPODs(
        Type\AdePickupGetConsignPODs $parameters): Type\AdePickupGetConsignPODsResponse
    {
        return $this->caller->call('adePickup_GetConsignPODs', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdePODGet $parameters
     *
     * @return ResultInterface|Type\AdePODGetResponse
     *
     * @throws SoapException
     */
    public function adePOD_Get(Type\AdePODGet $parameters): Type\AdePODGetResponse
    {
        return $this->caller->call('adePOD_Get', $parameters);
    }

    /**
     * @param RequestInterface|Type\AdeCourierOrder $parameters
     *
     * @return ResultInterface|Type\AdeCourierOrderResponse
     *
     * @throws SoapException
     */
    public function adeCourier_Order(Type\AdeCourierOrder $parameters): Type\AdeCourierOrderResponse
    {
        return $this->caller->call('adeCourier_Order', $parameters);
    }
}
