{@inheritdoc}

@api

@param \Generated\Shared\Transfer\DataImporterConfigurationTransfer|null $dataImporterConfigurationTransfer

@return \Generated\Shared\Transfer\DataImporterReportTransfer
765044
public function importProductList(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->createProductListDataImport()
            ->import($dataImporterConfigurationTransfer);
    }
1318289
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createCompanyDataImport()->import($dataImporterConfigurationTransfer);
    }
997794
public function importProductMeasurementUnit(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->getProductMeasurementUnitDataImporter()
            ->import($dataImporterConfigurationTransfer);
    }
451872
protected function dataTransferBackup(DNDataTransfer $dataTransfer, DeploynautLogFile $log) {
		$environment = $dataTransfer->Environment();
		$name = $environment->getFullName();

		// Associate a new archive with the transfer.
		// Doesn't retrieve a filepath just yet, need to generate the files first.
		$dataArchive = DNDataArchive::create();
		$dataArchive->Mode = $dataTransfer->Mode;
		$dataArchive->AuthorID = $dataTransfer->AuthorID;
		$dataArchive->OriginalEnvironmentID = $environment->ID;
		$dataArchive->EnvironmentID = $environment->ID;
		$dataArchive->IsBackup = $dataTransfer->IsBackupDataTransfer();

		// Generate directory structure with strict permissions (contains very sensitive data)
		$filepathBase = $dataArchive->generateFilepath($dataTransfer);
		mkdir($filepathBase, 0700, true);

		$databasePath = $filepathBase . DIRECTORY_SEPARATOR . 'database.sql.gz';

		// Backup database
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {
			$log->write(sprintf('Backup of database from "%s" started', $name));
			$command = $this->getCommand('data:getdb', 'db', $environment, array('data_path' => $databasePath), $log);
			$command->run(function($type, $buffer) use($log) {
				$log->write($buffer);
			});
			if(!$command->isSuccessful()) {
				$this->extend('dataTransferFailure', $environment, $log);
				throw new RuntimeException($command->getErrorOutput());
			}
			$log->write(sprintf('Backup of database from "%s" done', $name));
		}

		// Backup assets
		if(in_array($dataTransfer->Mode, array('all', 'assets'))) {
			$log->write(sprintf('Backup of assets from "%s" started', $name));
			$command = $this->getCommand('data:getassets', 'web', $environment, array('data_path' => $filepathBase), $log);
			$command->run(function($type, $buffer) use($log) {
				$log->write($buffer);
			});
			if(!$command->isSuccessful()) {
				$this->extend('dataTransferFailure', $environment, $log);
				throw new RuntimeException($command->getErrorOutput());
			}
			$log->write(sprintf('Backup of assets from "%s" done', $name));
		}

		// ensure the database connection is re-initialised, which is needed if the transfer
		// above took a really long time because the handle to the db may have become invalid.
		global $databaseConfig;
		DB::connect($databaseConfig);

		$log->write('Creating sspak...');

		$sspakFilename = sprintf('%s.sspak', $dataArchive->generateFilename($dataTransfer));
		$sspakFilepath = $filepathBase . DIRECTORY_SEPARATOR . $sspakFilename;

		try {
			$dataArchive->attachFile($sspakFilepath, $dataTransfer);
			$dataArchive->setArchiveFromFiles($filepathBase);
		} catch(Exception $e) {
			$log->write($e->getMessage());
			throw new RuntimeException($e->getMessage());
		}

		// Remove any assets and db files lying around, they're not longer needed as they're now part
		// of the sspak file we just generated. Use --force to avoid errors when files don't exist,
		// e.g. when just an assets backup has been requested and no database.sql exists.
		$process = new Process(sprintf('rm -rf %s/assets && rm -f %s', escapeshellarg($filepathBase), escapeshellarg($databasePath)));
		$process->setTimeout(120);
		$process->run();
		if(!$process->isSuccessful()) {
			$log->write('Could not delete temporary files');
			throw new RuntimeException($process->getErrorOutput());
		}

		$log->write(sprintf('Creating sspak file done: %s', $dataArchive->ArchiveFile()->getAbsoluteURL()));
	}
832179
public function importProductMeasurementSalesUnitStore(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->getProductMeasurementSalesUnitStoreDataImporter()
            ->import($dataImporterConfigurationTransfer);
    }
1029167
public function findCompanyBusinessUnitByExternalReference(
        RestCompanyBusinessUnitsRequestAttributesTransfer $restCompanyBusinessUnitsRequestAttributesTransfer
    ): RestCompanyBusinessUnitsResponseTransfer {
        $companyBusinessUnitTransfer = $this->companyBusinessUnitsRestApiRepository->findCompanyBusinessUnitByExternalReference(
            $restCompanyBusinessUnitsRequestAttributesTransfer->getExternalReference()
        );

        if ($companyBusinessUnitTransfer !== null) {
            return $this->createCompanyBusinessUnitResponseTransfer($companyBusinessUnitTransfer);
        }

        return $this->createCompanyBusinessUnitFailedToLoadErrorResponseTransfer();
    }
1201773
protected function createSendgridTransport()
    {
        $config = $this->getConfig();

        $transport = new SendgridTransport();
        $transport->setApiKey($config->get('SENDGRID.key'));

        return $transport;
    }
516983
protected function getComputopPaymentTransfer(QuoteTransfer $quoteTransfer, ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment)
    {
        $computopApiPaymentTransfer = $this->createPaymentTransfer();
        $computopApiPaymentTransfer->fromArray($computopApiHeaderPayment->toArray(), true);
        $computopApiPaymentTransfer->setMerchantId($this->config->getMerchantId());
        $computopApiPaymentTransfer->setCurrency($this->storeFacade->getCurrentStore()->getSelectedCurrencyIsoCode());

        $computopApiPaymentTransfer->setMac(
            $this->computopApiService->generateEncryptedMac($computopApiPaymentTransfer)
        );

        $computopApiPaymentTransfer->setReqId($this->computopApiService->generateReqIdFromQuoteTransfer($quoteTransfer));
        $computopApiPaymentTransfer->setRefNr($quoteTransfer->getOrderReference());

        return $computopApiPaymentTransfer;
    }
1093122
public function getTransport()
    {
        $adapter = $this->getAdapter();

        if ($adapter) {
            return $adapter;
        }

        return ucfirst($this->dsn->scheme);
    }
714546
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createMerchantDataImport()->import($dataImporterConfigurationTransfer);
    }
1294978
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createShipmentTableRateImporter()->import($dataImporterConfigurationTransfer);
    }
77273
protected function getNextTransport(): ?TransportInterface
    {
        $cursor = $this->cursor;
        while (true) {
            $transport = $this->transports[$cursor];

            if (!$this->isTransportDead($transport)) {
                break;
            }

            if ((microtime(true) - $this->deadTransports[$transport]) > $this->retryPeriod) {
                $this->deadTransports->detach($transport);

                break;
            }

            if ($this->cursor === $cursor = $this->moveCursor($cursor)) {
                return null;
            }
        }

        $this->cursor = $this->moveCursor($cursor);

        return $transport;
    }
743557
protected function transformDataProvider(DataProviderInterface $dataProvider)
    {
        if (Craft::$app->getRequest()->getIsHead()) {
            return null;
        } else {
            if (!$transformer = $this->dataTransformer()) {
                return $dataProvider;
            }

            // The transformed data
            $models = Factory::collection(
                $this->resolveTransformer($transformer),
                $dataProvider->getModels(),
                $this->getTransformConfig()
            );

            if ($this->collectionEnvelope === null) {
                return $models;
            } else {
                return [
                    $this->collectionEnvelope => $models,
                ];
            }
        }
    }
1349166
public function request(AdyenApiRequestTransfer $requestTransfer): AdyenApiResponseTransfer
    {
        $requestData = $this->mapper->buildRequestArray($requestTransfer);
        $isSuccess = true;

        try {
            $response = $this->adapter->sendRequest($requestData);
        } catch (RequestException $requestException) {
            $response = $requestException->getResponse();
            $isSuccess = false;
        }

        return $this->converter->convertToResponseTransfer($response, $isSuccess);
    }
853185
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->createPriceProductDataImport()
            ->import($dataImporterConfigurationTransfer);
    }
211059
public static function getTransport($mailer)
    {
        $config = Mailer::getConfig()->get($mailer);
        if (!$config) {
            throw new MailerException(MailerException::INVALID_CONFIGURATION, [$mailer]);
        }

        $lib = self::getLibrary($mailer);

        /* @var MailerInterface $libInstance */
        $libInstance = self::factory($lib, MailerInterface::class);

        $instance = $libInstance::getTransport($config);
        if (!self::isInstanceOf($instance, TransportInterface::class)) {
            throw new MailerException(MailerException::TRANSPORT_INTERFACE);
        }

        return $instance;
    }
1214514
public function expandCustomerTransferWithProductListIds(CustomerTransfer $customerTransfer): CustomerTransfer
    {
        if ($this->hasCustomerTransferProductLists($customerTransfer)) {
            return $customerTransfer;
        }

        $companyUserTransfer = $customerTransfer->getCompanyUserTransfer();

        if ($companyUserTransfer === null || $companyUserTransfer->getCompany() === null) {
            return $customerTransfer;
        }

        $productListCollectionTransfer = $this->productListReader->getProductListCollectionByIdCompanyId(
            $companyUserTransfer->getCompany()
        );

        $this->addProductListsToCustomerTransfer($customerTransfer, $productListCollectionTransfer);

        return $customerTransfer;
    }