From 484655dd730d8e5b94eaaeb56110ec2107b12ac9 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 3 May 2023 13:17:15 +0200 Subject: [PATCH 01/26] FORMS-821: Used OS2Web datalookup for CPR and CVR data --- .github/workflows/pr.yaml | 6 +-- CHANGELOG.md | 1 + README.md | 6 +-- composer.json | 3 +- os2forms_digital_post.info.yml | 6 +-- os2forms_digital_post.services.yml | 3 +- src/Helper/MeMoHelper.php | 27 ++++------ src/Helper/WebformHelperSF1601.php | 85 +++++++----------------------- 8 files changed, 43 insertions(+), 94 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 8f5bcc0..321097d 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '7.4' ] + php-versions: [ '8.1' ] dependency-version: [ prefer-stable ] steps: - uses: actions/checkout@master @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '7.4' ] + php-versions: [ '8.1' ] dependency-version: [ prefer-stable ] steps: - uses: actions/checkout@master @@ -89,7 +89,7 @@ jobs: # runs-on: ubuntu-latest # strategy: # matrix: - # php-versions: [ '7.4' ] + # php-versions: [ '8.1' ] # dependency-version: [ prefer-stable ] # steps: # - uses: actions/checkout@master diff --git a/CHANGELOG.md b/CHANGELOG.md index 664af4b..567d070 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Changed composer name to `os2forms/os2forms_digital_post` [PR-47](https://github.com/itk-dev/os2forms_digital_post/pull/47) +- Changed dependency on CPR and CVR lookup modules. ## [2.0.1] diff --git a/README.md b/README.md index 4c3c63d..9c9264e 100644 --- a/README.md +++ b/README.md @@ -156,8 +156,8 @@ Actions](https://github.com/features/actions) when a pull request is made (cf. Check coding standards: ```sh -docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php7.4-fpm:latest composer install -docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php7.4-fpm:latest composer coding-standards-check +docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer install +docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-check docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app install docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app coding-standards-check @@ -166,7 +166,7 @@ docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app Apply coding standards: ```shell -docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php7.4-fpm:latest composer coding-standards-apply +docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-apply docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app coding-standards-apply ``` diff --git a/composer.json b/composer.json index 39fe4aa..1e702fe 100644 --- a/composer.json +++ b/composer.json @@ -37,14 +37,15 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { + "php": "^8.1", "ext-soap": "*", "dompdf/dompdf": "^2.0", "drupal/webform": "^6.0", "http-interop/http-factory-guzzle": "^1.0.0", "itk-dev/beskedfordeler-drupal": "^1.0", - "itk-dev/os2forms_cpr_lookup": "^1.6", "itk-dev/serviceplatformen": "^1.2", "os2forms/os2forms": "^3.0", + "os2web/os2web_datalookup": "^1.5", "php-http/guzzle6-adapter": "^2.0.1", "symfony/options-resolver": "^5.4 || ^6.0", "symfony/property-access": "^4.4", diff --git a/os2forms_digital_post.info.yml b/os2forms_digital_post.info.yml index 764bd20..79c6eb5 100644 --- a/os2forms_digital_post.info.yml +++ b/os2forms_digital_post.info.yml @@ -2,12 +2,10 @@ name: 'OS2Forms Digital Post' type: module description: 'Provides integration to Print service provided by Serviceplatformen.' package: 'OS2Forms' -core: 8.x -core_version_requirement: ^8 || ^9 +core_version_requirement: ^9 dependencies: - 'beskedfordeler:beskedfordeler' - - 'os2forms_cpr_lookup:os2forms_cpr_lookup' - - 'os2forms_cvr_lookup:os2forms_cvr_lookup' + - 'os2web_datalookup:os2web_datalookup' - 'webform:webform' - 'webform:webform_submission_log' diff --git a/os2forms_digital_post.services.yml b/os2forms_digital_post.services.yml index b67c233..3042cd2 100644 --- a/os2forms_digital_post.services.yml +++ b/os2forms_digital_post.services.yml @@ -39,8 +39,7 @@ services: - "@Drupal\\os2forms_digital_post\\Helper\\Settings" - "@Drupal\\os2forms_digital_post\\Helper\\CertificateLocatorHelper" - "@entity_type.manager" - - "@os2forms_cpr_lookup.service" - - "@os2forms_cvr_lookup.service" + - "@plugin.manager.os2web_datalookup" - "@Drupal\\os2forms_digital_post\\Helper\\MeMoHelper" - "@Drupal\\os2forms_digital_post\\Helper\\BeskedfordelerHelper" - "@logger.factory" diff --git a/src/Helper/MeMoHelper.php b/src/Helper/MeMoHelper.php index 9eed746..cac4549 100644 --- a/src/Helper/MeMoHelper.php +++ b/src/Helper/MeMoHelper.php @@ -16,12 +16,12 @@ use DigitalPost\MeMo\Recipient; use DigitalPost\MeMo\Sender; use Drupal\Core\Render\ElementInfoManagerInterface; -use Drupal\os2forms_cpr_lookup\CPR\CprServiceResult; -use Drupal\os2forms_cvr_lookup\CVR\CvrServiceResult; use Drupal\os2forms_digital_post\Exception\InvalidAttachmentElementException; use Drupal\os2forms_digital_post\Exception\InvalidRecipientDataException; use Drupal\os2forms_digital_post\Form\SettingsForm; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; +use Drupal\os2web_datalookup\LookupResult\CompanyLookupResult; +use Drupal\os2web_datalookup\LookupResult\CprLookupResult; use Drupal\webform\WebformSubmissionInterface; use Drupal\webform\WebformTokenManagerInterface; use Drupal\webform_attachment\Element\WebformAttachmentBase; @@ -140,20 +140,15 @@ public function buildMessage(WebformSubmissionInterface $submission, array $opti * Enrich recipient with additional data from a lookup. */ private function enrichRecipient(Recipient $recipient, $recipientData = NULL): Recipient { - if ($recipientData instanceof CprServiceResult) { - $name = implode(' ', array_filter([ - $recipientData->getFirstName(), - $recipientData->getMiddleName(), - $recipientData->getLastName(), - ])); - + if ($recipientData instanceof CprLookupResult) { + $name = $recipientData->getName(); $recipient->setLabel($name); $address = (new Address()) ->setCo('') - ->setAddressLabel($recipientData->getStreetName() ?: '') - ->setHouseNumber($recipientData->getHouseNumber() ?: '') + ->setAddressLabel($recipientData->getStreet() ?: '') + ->setHouseNumber($recipientData->getHouseNr() ?: '') ->setFloor($recipientData->getFloor() ?: '') - ->setDoor($recipientData->getSide() ?: '') + ->setDoor($recipientData->getApartmentNr() ?: '') ->setZipCode($recipientData->getPostalCode() ?: '') ->setCity($recipientData->getCity() ?: '') ->setCountry('DA'); @@ -166,16 +161,16 @@ private function enrichRecipient(Recipient $recipient, $recipientData = NULL): R $recipient->setAttentionData($attentionData); } - elseif ($recipientData instanceof CvrServiceResult) { + elseif ($recipientData instanceof CompanyLookupResult) { $name = $recipientData->getName(); $recipient->setLabel($name); $address = (new Address()) ->setCo('') - ->setAddressLabel($recipientData->getStreetName() ?: '') - ->setHouseNumber($recipientData->getHouseNumber() ?: '') + ->setAddressLabel($recipientData->getStreet() ?: '') + ->setHouseNumber($recipientData->getHouseNr() ?: '') ->setFloor($recipientData->getFloor() ?: '') - ->setDoor($recipientData->getSide() ?: '') + ->setDoor($recipientData->getApartmentNr() ?: '') ->setZipCode($recipientData->getPostalCode() ?: '') ->setCity($recipientData->getCity() ?: '') ->setCountry('DA'); diff --git a/src/Helper/WebformHelperSF1601.php b/src/Helper/WebformHelperSF1601.php index 886868b..cd839b4 100644 --- a/src/Helper/WebformHelperSF1601.php +++ b/src/Helper/WebformHelperSF1601.php @@ -9,17 +9,17 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Logger\LoggerChannelInterface; -use Drupal\os2forms_cpr_lookup\Service\CprServiceInterface; -use Drupal\os2forms_cvr_lookup\Service\CvrServiceInterface; use Drupal\os2forms_digital_post\Exception\InvalidRecipientIdentifierElementException; use Drupal\os2forms_digital_post\Exception\RuntimeException; use Drupal\os2forms_digital_post\Exception\SubmissionNotFoundException; use Drupal\os2forms_digital_post\Form\SettingsForm; use Drupal\os2forms_digital_post\Plugin\AdvancedQueue\JobType\SendDigitalPostSF1601; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; +use Drupal\os2web_datalookup\Plugin\DataLookupManager; +use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCompany; +use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr; use Drupal\webform\WebformSubmissionInterface; use Drupal\webform\WebformSubmissionStorageInterface; -use ItkDev\Serviceplatformen\Service\Exception\ServiceException; use ItkDev\Serviceplatformen\Service\SF1601\Serializer; use ItkDev\Serviceplatformen\Service\SF1601\SF1601; use Psr\Log\LoggerInterface; @@ -34,20 +34,6 @@ final class WebformHelperSF1601 implements LoggerInterface { public const RECIPIENT_IDENTIFIER_TYPE = 'recipient_identifier_type'; public const RECIPIENT_IDENTIFIER = 'recipient_identifier'; - /** - * The settings. - * - * @var \Drupal\os2forms_digital_post\SettingsInterface|Settings - */ - private Settings $settings; - - /** - * The certificate locator helper. - * - * @var CertificateLocatorHelper - */ - private CertificateLocatorHelper $certificateLocatorHelper; - /** * The webform submission storage. * @@ -62,34 +48,6 @@ final class WebformHelperSF1601 implements LoggerInterface { */ protected ConfigEntityStorage $queueStorage; - /** - * The CPR service. - * - * @var \Drupal\os2forms_cpr_lookup\Service\CprServiceInterface - */ - protected CprServiceInterface $cprService; - - /** - * The CVR service. - * - * @var \Drupal\os2forms_cvr_lookup\Service\CvrServiceInterface - */ - protected CvrServiceInterface $cvrService; - - /** - * The MeMo helper. - * - * @var MeMoHelper - */ - protected MeMoHelper $meMoHelper; - - /** - * The Beskedfordeler helper. - * - * @var BeskedfordelerHelper - */ - private BeskedfordelerHelper $beskedfordelerHelper; - /** * The logger. * @@ -108,23 +66,16 @@ final class WebformHelperSF1601 implements LoggerInterface { * Constructor. */ public function __construct( - Settings $settings, - CertificateLocatorHelper $certificateLocatorHelper, + readonly private Settings $settings, + readonly private CertificateLocatorHelper $certificateLocatorHelper, EntityTypeManagerInterface $entityTypeManager, - CprServiceInterface $cprService, - CvrServiceInterface $cvrService, - MeMoHelper $meMoHelper, - BeskedfordelerHelper $beskedfordelerHelper, + readonly private DataLookupManager $dataLookupManager, + readonly private MeMoHelper $meMoHelper, + readonly private BeskedfordelerHelper $beskedfordelerHelper, LoggerChannelFactoryInterface $loggerChannelFactory ) { - $this->settings = $settings; - $this->certificateLocatorHelper = $certificateLocatorHelper; $this->webformSubmissionStorage = $entityTypeManager->getStorage('webform_submission'); $this->queueStorage = $entityTypeManager->getStorage('advancedqueue_queue'); - $this->cprService = $cprService; - $this->cvrService = $cvrService; - $this->meMoHelper = $meMoHelper; - $this->beskedfordelerHelper = $beskedfordelerHelper; $this->logger = $loggerChannelFactory->get('os2forms_digital_post'); $this->submissionLogger = $loggerChannelFactory->get('webform_submission'); } @@ -188,22 +139,26 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h $cvrServiceResult = NULL; if (preg_match('/^\d{8}$/', $recipientIdentifier)) { - try { - $cvrServiceResult = $this->cvrService->search($recipientIdentifier); - $recipientIdentifierType = 'CVR'; + $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cvr_lookup'); + if (!($instance instanceof DataLookupInterfaceCompany)) { + throw new RuntimeException('Cannot get CVR data lookup instance'); } - catch (ServiceException $serviceException) { + $cvrServiceResult = $instance->lookup($recipientIdentifier); + if (!$cvrServiceResult->isSuccessful()) { throw new RuntimeException('Cannot validate recipient CVR'); } + $recipientIdentifierType = 'CVR'; } else { - try { - $cprServiceResult = $this->cprService->search($recipientIdentifier); - $recipientIdentifierType = 'CPR'; + $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cpr_lookup'); + if (!($instance instanceof DataLookupInterfaceCpr)) { + throw new RuntimeException('Cannot get CPR data lookup instance'); } - catch (ServiceException $serviceException) { + $cprServiceResult = $instance->lookup($recipientIdentifier); + if (!$cprServiceResult->isSuccessful()) { throw new RuntimeException('Cannot validate recipient CPR'); } + $recipientIdentifierType = 'CPR'; } $senderSettings = $this->settings->getSender(); From 7d306cc1b4d0fe8d604b36bdba749109646ee99a Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 11:33:35 +0200 Subject: [PATCH 02/26] FORMS-821: Guzzle 7 --- composer.json | 4 ++-- src/Consumer/PrintServiceConsumer.php | 5 +++++ src/Helper/CertificateLocatorHelper.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 1e702fe..ab4d9f4 100644 --- a/composer.json +++ b/composer.json @@ -43,10 +43,10 @@ "drupal/webform": "^6.0", "http-interop/http-factory-guzzle": "^1.0.0", "itk-dev/beskedfordeler-drupal": "^1.0", - "itk-dev/serviceplatformen": "^1.2", + "itk-dev/serviceplatformen": "dev-feature/guzzle7-adapter as 1.5", "os2forms/os2forms": "^3.0", "os2web/os2web_datalookup": "^1.5", - "php-http/guzzle6-adapter": "^2.0.1", + "php-http/guzzle7-adapter": "^1.0", "symfony/options-resolver": "^5.4 || ^6.0", "symfony/property-access": "^4.4", "wsdltophp/packagebase": "^5.0" diff --git a/src/Consumer/PrintServiceConsumer.php b/src/Consumer/PrintServiceConsumer.php index 44c0602..fa7d69e 100644 --- a/src/Consumer/PrintServiceConsumer.php +++ b/src/Consumer/PrintServiceConsumer.php @@ -26,6 +26,11 @@ use ItkDev\Serviceplatformen\Certificate\AzureKeyVaultCertificateLocator; use ItkDev\Serviceplatformen\Certificate\CertificateLocatorInterface; use WsdlToPhp\PackageBase\AbstractSoapClientBase; +use GuzzleHttp\Client; +use Http\Factory\Guzzle\RequestFactory; +use ItkDev\AzureKeyVault\Authorisation\VaultToken; +use Http\Adapter\Guzzle7\Client as GuzzleAdapter; +use ItkDev\AzureKeyVault\KeyVault\VaultSecret; /** * Print service consumer. diff --git a/src/Helper/CertificateLocatorHelper.php b/src/Helper/CertificateLocatorHelper.php index 6d74cc9..ffc816d 100644 --- a/src/Helper/CertificateLocatorHelper.php +++ b/src/Helper/CertificateLocatorHelper.php @@ -4,7 +4,7 @@ use Drupal\os2forms_digital_post\Exception\CertificateLocatorException; use GuzzleHttp\Client; -use Http\Adapter\Guzzle6\Client as GuzzleAdapter; +use Http\Adapter\Guzzle7\Client as GuzzleAdapter; use Http\Factory\Guzzle\RequestFactory; use ItkDev\AzureKeyVault\Authorisation\VaultToken; use ItkDev\AzureKeyVault\KeyVault\VaultSecret; From 23c060a1ce2a7e26c157d1eb8fa5f42c77b7ce79 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 13:16:18 +0200 Subject: [PATCH 03/26] FORMS-821: Guzzle 6 HTTP Adapter --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ab4d9f4..a7f1a61 100644 --- a/composer.json +++ b/composer.json @@ -43,10 +43,10 @@ "drupal/webform": "^6.0", "http-interop/http-factory-guzzle": "^1.0.0", "itk-dev/beskedfordeler-drupal": "^1.0", - "itk-dev/serviceplatformen": "dev-feature/guzzle7-adapter as 1.5", + "itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5", "os2forms/os2forms": "^3.0", "os2web/os2web_datalookup": "^1.5", - "php-http/guzzle7-adapter": "^1.0", + "php-http/guzzle6-adapter": "^2.0", "symfony/options-resolver": "^5.4 || ^6.0", "symfony/property-access": "^4.4", "wsdltophp/packagebase": "^5.0" From 31a0b4ed26c49400878c46bcc0e2248c6cc64c70 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 13:35:34 +0200 Subject: [PATCH 04/26] FORMS-821: Cleaned up --- .../WebformHandler/WebformHandlerSF1601.php | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/src/Plugin/WebformHandler/WebformHandlerSF1601.php b/src/Plugin/WebformHandler/WebformHandlerSF1601.php index db60d10..824a27b 100644 --- a/src/Plugin/WebformHandler/WebformHandlerSF1601.php +++ b/src/Plugin/WebformHandler/WebformHandlerSF1601.php @@ -41,41 +41,6 @@ final class WebformHandlerSF1601 extends WebformHandlerBase { */ private const MESSAGE_HEADER_LABEL_MAX_LENGTH = 128; - /** - * The token manager. - * - * @var \Drupal\webform\WebformTokenManagerInterface - */ - protected $tokenManager; - - /** - * The webform helper. - * - * @var \Drupal\os2forms_digital_post\WebformHelper - */ - protected $webformHelper; - - /** - * The template manager. - * - * @var \Drupal\os2forms_digital_post\Manager\TemplateManager - */ - protected $templateManager; - - /** - * The print service consumer. - * - * @var \Drupal\os2forms_digital_post\Consumer\PrintServiceConsumer - */ - protected $printServiceConsumer; - - /** - * The cpr service. - * - * @var \Drupal\os2forms_cpr_lookup\Service\CprServiceInterface - */ - protected $cprService; - /** * The webform helper. * @@ -95,10 +60,6 @@ public static function create(ContainerInterface $container, array $configuratio $instance->entityTypeManager = $container->get('entity_type.manager'); $instance->conditionsValidator = $container->get('webform_submission.conditions_validator'); $instance->tokenManager = $container->get('webform.token_manager'); - $instance->webformHelper = $container->get('os2forms_digital_post.webform_helper'); - $instance->templateManager = $container->get('os2forms_digital_post.template_manager'); - $instance->printServiceConsumer = $container->get('os2forms_digital_post.print_service_consumer'); - $instance->cprService = $container->get('os2forms_cpr_lookup.service'); $instance->helper = $container->get(WebformHelperSF1601::class); $instance->setConfiguration($configuration); From b4379491d9395e15d1bd08c4a580d63b14c9cba0 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 13:48:12 +0200 Subject: [PATCH 05/26] FORMS-821: Cleaned up --- .../DigitalPostWebformHandler.php | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/src/Plugin/WebformHandler/DigitalPostWebformHandler.php b/src/Plugin/WebformHandler/DigitalPostWebformHandler.php index 4e856b3..543472d 100644 --- a/src/Plugin/WebformHandler/DigitalPostWebformHandler.php +++ b/src/Plugin/WebformHandler/DigitalPostWebformHandler.php @@ -33,20 +33,6 @@ class DigitalPostWebformHandler extends WebformHandlerBase { */ private const DOCUMENT_TITLE_MAX_LENGTH = 32; - /** - * The token manager. - * - * @var \Drupal\webform\WebformTokenManagerInterface - */ - protected $tokenManager; - - /** - * The webform helper. - * - * @var \Drupal\os2forms_digital_post\WebformHelper - */ - protected $webformHelper; - /** * The template manager. * @@ -54,20 +40,6 @@ class DigitalPostWebformHandler extends WebformHandlerBase { */ protected $templateManager; - /** - * The print service consumer. - * - * @var \Drupal\os2forms_digital_post\Consumer\PrintServiceConsumer - */ - protected $printServiceConsumer; - - /** - * The cpr service. - * - * @var \Drupal\os2forms_cpr_lookup\Service\CprServiceInterface - */ - protected $cprService; - /** * {@inheritdoc} */ @@ -79,11 +51,7 @@ public static function create(ContainerInterface $container, array $configuratio $instance->renderer = $container->get('renderer'); $instance->entityTypeManager = $container->get('entity_type.manager'); $instance->conditionsValidator = $container->get('webform_submission.conditions_validator'); - $instance->tokenManager = $container->get('webform.token_manager'); - $instance->webformHelper = $container->get('os2forms_digital_post.webform_helper'); $instance->templateManager = $container->get('os2forms_digital_post.template_manager'); - $instance->printServiceConsumer = $container->get('os2forms_digital_post.print_service_consumer'); - $instance->cprService = $container->get('os2forms_cpr_lookup.service'); $instance->setConfiguration($configuration); From 058637e4ec3eedb2c16b373d307a7a06dedd1b30 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 13:49:03 +0200 Subject: [PATCH 06/26] FORMS-821: Used OS2Web datalookup for CPR and CVR data --- src/Commands/CreatePdf.php | 29 ++++++++++------------------- src/Helper/WebformHelper.php | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/src/Commands/CreatePdf.php b/src/Commands/CreatePdf.php index 0b26b05..7af9b07 100644 --- a/src/Commands/CreatePdf.php +++ b/src/Commands/CreatePdf.php @@ -3,9 +3,9 @@ namespace Drupal\os2forms_digital_post\Commands; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\os2forms_cpr_lookup\CPR\CprServiceResult; use Drupal\os2forms_digital_post\Helper\WebformHelper; use Drupal\os2forms_digital_post\Manager\TemplateManager; +use Drupal\os2web_datalookup\LookupResult\CprLookupResult; use Drush\Commands\DrushCommands; /** @@ -74,24 +74,15 @@ public function create($template, array $options = [ return; } - $cprServiceResult = new CprServiceResult(json_decode(json_encode([ - 'persondata' => [ - 'navn' => [ - 'fornavn' => 'Test', - 'efternavn' => 'Testersen', - ], - ], - 'adresse' => [ - 'aktuelAdresse' => [ - 'vejnavn' => 'Testervej', - 'husnummer' => '1', - 'etage' => '2', - 'sidedoer' => 'tv', - 'postnummer' => '8000', - 'postdistrikt' => 'Aarhus C', - ], - ], - ]))); + $cprServiceResult = new CprLookupResult(); + $cprServiceResult->setSuccessful(); + $cprServiceResult->setName('Test Testersen'); + $cprServiceResult->setStreet('Testervej'); + $cprServiceResult->setHouseNr('1'); + $cprServiceResult->setFloor('2'); + $cprServiceResult->setApartmentNr('tv'); + $cprServiceResult->setPostalCode('8000'); + $cprServiceResult->setCity('Aarhus C'); $context = $this->webformHelper->getTemplateContext($webform_submission, $cprServiceResult, []); diff --git a/src/Helper/WebformHelper.php b/src/Helper/WebformHelper.php index b8fd049..ec5f3f4 100644 --- a/src/Helper/WebformHelper.php +++ b/src/Helper/WebformHelper.php @@ -11,6 +11,7 @@ use Drupal\os2forms_digital_post\Exception\CprElementNotFoundInSubmissionException; use Drupal\os2forms_digital_post\Exception\SubmissionNotFoundException; use Drupal\os2forms_digital_post\Manager\TemplateManager; +use Drupal\os2web_datalookup\LookupResult\CprLookupResult; use Drupal\webform\WebformSubmissionInterface; /** @@ -75,7 +76,7 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Ren /** * Get template context. */ - public function getTemplateContext(WebformSubmissionInterface $webformSubmission, CprServiceResult $cprServiceResult, array $configuration = []) { + public function getTemplateContext(WebformSubmissionInterface $webformSubmission, CprLookupResult $cprLookupResult, array $configuration = []) { $webform = $webformSubmission->getWebform(); $view_builder = $this->entityTypeManager->getViewBuilder('webform_submission'); @@ -84,19 +85,19 @@ public function getTemplateContext(WebformSubmissionInterface $webformSubmission // We cannot use “side” (from address lookup via cpr) as “suiteIdentifier” // when sending digital port. Therefore we append it to “floor” instead. - $floor = $cprServiceResult->getFloor(); - if (!empty($cprServiceResult->getSide())) { - $floor .= ' ' . $cprServiceResult->getSide(); + $floor = $cprLookupResult->getFloor(); + if (!empty($cprLookupResult->getApartmentNr())) { + $floor .= ' ' . $cprLookupResult->getApartmentNr(); } $recipient = [ - 'name' => $cprServiceResult->getName(), - 'streetName' => $cprServiceResult->getStreetName(), - 'streetNumber' => $cprServiceResult->getHouseNumber(), + 'name' => $cprLookupResult->getName(), + 'streetName' => $cprLookupResult->getStreet(), + 'streetNumber' => $cprLookupResult->getHouseNr(), 'floor' => $floor, 'side' => NULL, - 'postalCode' => $cprServiceResult->getPostalCode(), - 'city' => $cprServiceResult->getCity(), + 'postalCode' => $cprLookupResult->getPostalCode(), + 'city' => $cprLookupResult->getCity(), ]; return [ From aa70a99d1564c34ed2e3eab503496002d7ef0b9c Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 14:11:09 +0200 Subject: [PATCH 07/26] FORMS-821: Used OS2Web datalookup for CPR and CVR data --- os2forms_digital_post.services.yml | 2 +- src/Helper/WebformHelper.php | 32 +++++++++++++++++------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/os2forms_digital_post.services.yml b/os2forms_digital_post.services.yml index 3042cd2..e18adb2 100644 --- a/os2forms_digital_post.services.yml +++ b/os2forms_digital_post.services.yml @@ -16,7 +16,7 @@ services: arguments: - "@entity_type.manager" - "@renderer" - - "@os2forms_cpr_lookup.service" + - "@plugin.manager.os2web_datalookup" - "@os2forms_digital_post.print_service_consumer" - "@os2forms_digital_post.template_manager" - "@logger.factory" diff --git a/src/Helper/WebformHelper.php b/src/Helper/WebformHelper.php index ec5f3f4..1d9096c 100644 --- a/src/Helper/WebformHelper.php +++ b/src/Helper/WebformHelper.php @@ -5,13 +5,14 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Render\Renderer; -use Drupal\os2forms_cpr_lookup\CPR\CprServiceResult; -use Drupal\os2forms_cpr_lookup\Service\CprServiceInterface; use Drupal\os2forms_digital_post\Consumer\PrintServiceConsumer; use Drupal\os2forms_digital_post\Exception\CprElementNotFoundInSubmissionException; +use Drupal\os2forms_digital_post\Exception\RuntimeException; use Drupal\os2forms_digital_post\Exception\SubmissionNotFoundException; use Drupal\os2forms_digital_post\Manager\TemplateManager; use Drupal\os2web_datalookup\LookupResult\CprLookupResult; +use Drupal\os2web_datalookup\Plugin\DataLookupManager; +use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr; use Drupal\webform\WebformSubmissionInterface; /** @@ -34,11 +35,11 @@ final class WebformHelper { protected $renderer; /** - * The cpr service. + * The data lookup manager. * - * @var \Drupal\os2forms_cpr_lookup\Service\CprServiceInterface + * @var \Drupal\os2web_datalookup\Plugin\DataLookupManager */ - protected $cprService; + protected $dataLookupManager; /** * The print service consumer. @@ -64,10 +65,10 @@ final class WebformHelper { /** * Constructor. */ - public function __construct(EntityTypeManagerInterface $entity_type_manager, Renderer $renderer, CprServiceInterface $cprService, PrintServiceConsumer $printServiceConsumer, TemplateManager $templateManager, LoggerChannelFactoryInterface $loggerChannelFactory) { + public function __construct(EntityTypeManagerInterface $entity_type_manager, Renderer $renderer, DataLookupManager $dataLookupManager, PrintServiceConsumer $printServiceConsumer, TemplateManager $templateManager, LoggerChannelFactoryInterface $loggerChannelFactory) { $this->entityTypeManager = $entity_type_manager; $this->renderer = $renderer; - $this->cprService = $cprService; + $this->dataLookupManager = $dataLookupManager; $this->printServiceConsumer = $printServiceConsumer; $this->templateManager = $templateManager; $this->logger = $loggerChannelFactory->get('os2forms_digital_post'); @@ -148,9 +149,12 @@ public function sendDigitalPost(string $submissionId, array $handlerConfiguratio throw new CprElementNotFoundInSubmissionException(); } - /** @var \Drupal\os2forms_cpr_lookup\CPR\CprServiceResult $cprSearchResult */ - $cprSearchResult = $this->cprService->search($submissionData[$handlerConfiguration['cpr_element']]); - $context = $this->getTemplateContext($webform_submission, $cprSearchResult, $handlerConfiguration); + $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cpr_lookup'); + if (!($instance instanceof DataLookupInterfaceCpr)) { + throw new RuntimeException('Cannot get CPR data lookup instance'); + } + $cprLookupResult = $instance->lookup($submissionData[$handlerConfiguration['cpr_element']]); + $context = $this->getTemplateContext($webform_submission, $cprLookupResult, $handlerConfiguration); $result = FALSE; switch ($handlerConfiguration['channel']) { @@ -159,14 +163,14 @@ public function sendDigitalPost(string $submissionId, array $handlerConfiguratio $handlerConfiguration['channel'], $handlerConfiguration['priority'], $submissionData[$handlerConfiguration['cpr_element']], - $cprSearchResult->getName(), + $cprLookupResult->getName(), NULL, - $cprSearchResult->getStreetName(), - $cprSearchResult->getHouseNumber(), + $cprLookupResult->getStreet(), + $cprLookupResult->getHouseNr(), $floor, NULL, NULL, - $cprSearchResult->getPostalCode(), + $cprLookupResult->getPostalCode(), NULL, NULL, 'DK', From 1d7f27a7e79a340d79f11380d1c465a9bef78ffd Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 14:42:54 +0200 Subject: [PATCH 08/26] FORMS-821: Cleaned up --- .github/workflows/pr.yaml | 1 + composer.json | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 321097d..bd5c775 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -127,6 +127,7 @@ jobs: # # Allow plugins # composer --working-dir=drupal config --no-plugins allow-plugins.vaimo/composer-patches true + # composer --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true # # Add our module as a composer repository. # composer --working-dir=drupal --no-interaction config --append repositories.itk-dev/os2forms_digital_post path web/modules/contrib/os2forms_digital_post diff --git a/composer.json b/composer.json index a7f1a61..a5f53f2 100644 --- a/composer.json +++ b/composer.json @@ -13,22 +13,6 @@ } ], "repositories": { - "drupal/webform_embed": { - "// ": "Lifted from https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/composer.json, which see", - "//": "https://git.drupalcode.org/issue/webform_embed-3149360/-/tree/3149360-automated-drupal-9", - "type": "package", - "package": { - "name": "drupal/webform_embed", - "//": "@see https://github.com/OS2Forms/os2forms/blob/master/composer.json#L27", - "version": "1.x-dev", - "type": "drupal-module", - "source": { - "url": "https://git.drupalcode.org/issue/webform_embed-3149360.git", - "type": "git", - "reference": "3149360-automated-drupal-9" - } - } - }, "drupal": { "type": "composer", "url": "https://packages.drupal.org/8" From 98fe6fccd6ed00aa934c8b3a5afff07054cf963c Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 17:09:21 +0200 Subject: [PATCH 09/26] =?UTF-8?q?FORMS-821:=20Handled=20=E2=80=9Cforsendel?= =?UTF-8?q?se=E2=80=9D=20(physical=20post)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drush.services.yml | 1 + os2forms_digital_post.services.yml | 6 ++ src/Commands/CommandsSF1601.php | 127 +++++++++++++++++------- src/Consumer/PrintServiceConsumer.php | 2 +- src/Form/SettingsForm.php | 8 ++ src/Helper/AbstractMessageHelper.php | 88 ++++++++++++++++ src/Helper/CertificateLocatorHelper.php | 2 +- src/Helper/ForsendelseHelper.php | 119 ++++++++++++++++++++++ src/Helper/MeMoHelper.php | 103 +------------------ src/Helper/WebformHelperSF1601.php | 29 ++++-- 10 files changed, 338 insertions(+), 147 deletions(-) create mode 100644 src/Helper/AbstractMessageHelper.php create mode 100644 src/Helper/ForsendelseHelper.php diff --git a/drush.services.yml b/drush.services.yml index 4fe06e9..a9a87c8 100644 --- a/drush.services.yml +++ b/drush.services.yml @@ -9,5 +9,6 @@ services: arguments: - '@Drupal\os2forms_digital_post\Helper\WebformHelperSF1601' - '@Drupal\os2forms_digital_post\Helper\MeMoHelper' + - '@Drupal\os2forms_digital_post\Helper\ForsendelseHelper' tags: - { name: drush.command } diff --git a/os2forms_digital_post.services.yml b/os2forms_digital_post.services.yml index e18adb2..2f83153 100644 --- a/os2forms_digital_post.services.yml +++ b/os2forms_digital_post.services.yml @@ -34,6 +34,11 @@ services: - "@plugin.manager.element_info" - "@webform.token_manager" + Drupal\os2forms_digital_post\Helper\ForsendelseHelper: + arguments: + - "@plugin.manager.element_info" + - "@webform.token_manager" + Drupal\os2forms_digital_post\Helper\WebformHelperSF1601: arguments: - "@Drupal\\os2forms_digital_post\\Helper\\Settings" @@ -41,6 +46,7 @@ services: - "@entity_type.manager" - "@plugin.manager.os2web_datalookup" - "@Drupal\\os2forms_digital_post\\Helper\\MeMoHelper" + - "@Drupal\\os2forms_digital_post\\Helper\\ForsendelseHelper" - "@Drupal\\os2forms_digital_post\\Helper\\BeskedfordelerHelper" - "@logger.factory" diff --git a/src/Commands/CommandsSF1601.php b/src/Commands/CommandsSF1601.php index edcaf34..e2768d5 100644 --- a/src/Commands/CommandsSF1601.php +++ b/src/Commands/CommandsSF1601.php @@ -3,10 +3,13 @@ namespace Drupal\os2forms_digital_post\Commands; use DigitalPost\MeMo\Message; +use Drupal\os2forms_digital_post\Form\SettingsForm; +use Drupal\os2forms_digital_post\Helper\ForsendelseHelper; use Drupal\os2forms_digital_post\Helper\MeMoHelper; use Drupal\os2forms_digital_post\Helper\WebformHelperSF1601; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drush\Commands\DrushCommands; +use Oio\Fjernprint\ForsendelseI; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Exception\InvalidOptionException; use Symfony\Component\Yaml\Yaml; @@ -16,32 +19,21 @@ */ final class CommandsSF1601 extends DrushCommands { private const HIDDEN_CONTENT = '👻'; - private const DUMP_OPTION_VALUES = [ + private const MEMO_DUMP_OPTION_VALUES = [ 'main-document-file-info', 'main-document-file-content', ]; - - /** - * The webform helper. - * - * @var \Drupal\os2forms_digital_post\WebformHelperSF1601 - */ - private WebformHelperSF1601 $webformHelper; - - /** - * The MeMo helper. - * - * @var \Drupal\os2forms_digital_post\Helper\MeMoHelper - */ - private MeMoHelper $meMoHelper; + private const FORSENDELSE_DUMP_OPTION_VALUES = []; /** * Constructor. */ - public function __construct(WebformHelperSF1601 $webformHelper, MeMoHelper $meMoHelper) { + public function __construct( + readonly private WebformHelperSF1601 $webformHelper, + readonly private MeMoHelper $meMoHelper, + readonly private ForsendelseHelper $forsendelseHelper, + ) { parent::__construct(); - $this->webformHelper = $webformHelper; - $this->meMoHelper = $meMoHelper; } /** @@ -110,6 +102,12 @@ public function meMoShow(int $submissionId, string $handlerId, array $options = $handlerMessageSettings = $handlerSettings[WebformHandlerSF1601::MEMO_MESSAGE]; $messageOptions = [ + WebformHelperSF1601::RECIPIENT_IDENTIFIER_TYPE => 'test', + WebformHelperSF1601::RECIPIENT_IDENTIFIER => 'test', + + SettingsForm::SENDER_IDENTIFIER_TYPE => 'test', + SettingsForm::SENDER_IDENTIFIER => 'test', + WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], ]; @@ -119,7 +117,7 @@ public function meMoShow(int $submissionId, string $handlerId, array $options = if (TRUE === $options['dump']) { throw new InvalidOptionException('Missing dump option value'); } - $this->dump((string) $options['dump'], $message); + $this->meMoDump((string) $options['dump'], $message); return; } @@ -129,9 +127,61 @@ public function meMoShow(int $submissionId, string $handlerId, array $options = } /** - * Dump stuff. + * Show forsendelse for a submission. + * + * @param int $submissionId + * The submission id. + * @param string $handlerId + * The handler id. + * @param array $options + * The command options. + * + * @option array handler-settings + * The handler settings (JSON). + * @option string recipient-element + * The recipient element key. + * @option string attachment-element + * The attachment element key. + * @option string dump + * Dump content to stdout. + * + * @command os2forms_digital_post:digital-post:forsendelse-show + * @usage os2forms_digital_post:digital-post:forsendelse-show --help + */ + public function forsendelseShow(int $submissionId, string $handlerId, array $options = [ + 'handler-settings' => NULL, + 'recipient-element' => NULL, + 'attachment-element' => NULL, + 'submission-data' => NULL, + 'dump' => NULL, + ]) { + [$submission, $handlerSettings] = $this->getData($submissionId, $handlerId, $options); + + $handlerMessageSettings = $handlerSettings[WebformHandlerSF1601::MEMO_MESSAGE]; + $messageOptions = [ + WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], + WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], + ForsendelseHelper::FORSENDELSES_TYPE_IDENTIFIKATOR => 'test', + ]; + $message = $this->forsendelseHelper->buildForsendelse($submission, $messageOptions, $handlerSettings); + + if (isset($options['dump'])) { + if (TRUE === $options['dump']) { + throw new InvalidOptionException('Missing dump option value'); + } + $this->forsendelseDump((string) $options['dump'], $message); + return; + } + + $document = $this->forsendelseHelper->message2dom($message); + + $this->output()->writeln($document->saveXML()); + } + + /** + * Dump MeMo message stuff. */ - private function dump(string $dump, Message $message) { + private function meMoDump(string $dump, Message $message) { switch ($dump) { case 'main-document-file-info': foreach ($message->getMessageBody()->getMainDocument()->getFile() as $file) { @@ -155,7 +205,24 @@ private function dump(string $dump, Message $message) { throw new InvalidOptionException(sprintf( 'Invalid dump option %s. Must be one of %s', json_encode($dump), - implode(', ', array_map('json_encode', self::DUMP_OPTION_VALUES)) + implode(', ', array_map('json_encode', self::MEMO_DUMP_OPTION_VALUES)) + )); + } + } + + /** + * Dump forsendelse stuff. + */ + private function forsendelseDump(string $dump, ForsendelseI $forsendelse) { + switch ($dump) { + case self::HIDDEN_CONTENT: + break; + + default: + throw new InvalidOptionException(sprintf( + 'Invalid dump option %s. Must be one of %s', + json_encode($dump), + implode(', ', array_map('json_encode', self::MEMO_DUMP_OPTION_VALUES)) )); } } @@ -177,7 +244,7 @@ private function getData(int $submissionId, string $handlerId, array $options) { catch (\JsonException $exception) { throw new InvalidArgumentException(sprintf('Submission data must be valid JSON.')); } - if (!is_array($submissionData) || !$this->isAssoc($submissionData)) { + if (!is_array($submissionData) || array_is_list($submissionData)) { throw new InvalidArgumentException(sprintf('Submission data must be an associative array.')); } } @@ -191,7 +258,7 @@ private function getData(int $submissionId, string $handlerId, array $options) { catch (\JsonException $exception) { throw new InvalidArgumentException(sprintf('Handler configuration must be valid JSON.')); } - if (!is_array($settings) || !$this->isAssoc($settings)) { + if (!is_array($settings) || array_is_list($settings)) { throw new InvalidArgumentException(sprintf('Handler configuration must be an associative array.')); } $handlerSettings = array_merge($handlerSettings, $settings); @@ -207,16 +274,4 @@ private function getData(int $submissionId, string $handlerId, array $options) { return [$submission, $handlerSettings, $submissionData]; } - /** - * Check if an array is an associative array. - * - * @see https://stackoverflow.com/a/173479/2502647 - */ - private function isAssoc(array $arr) { - if ([] === $arr) { - return FALSE; - } - return array_keys($arr) !== range(0, count($arr) - 1); - } - } diff --git a/src/Consumer/PrintServiceConsumer.php b/src/Consumer/PrintServiceConsumer.php index fa7d69e..2908c8c 100644 --- a/src/Consumer/PrintServiceConsumer.php +++ b/src/Consumer/PrintServiceConsumer.php @@ -29,7 +29,7 @@ use GuzzleHttp\Client; use Http\Factory\Guzzle\RequestFactory; use ItkDev\AzureKeyVault\Authorisation\VaultToken; -use Http\Adapter\Guzzle7\Client as GuzzleAdapter; +use Http\Adapter\Guzzle6\Client as GuzzleAdapter; use ItkDev\AzureKeyVault\KeyVault\VaultSecret; /** diff --git a/src/Form/SettingsForm.php b/src/Form/SettingsForm.php index 3ddedc4..a2b056f 100644 --- a/src/Form/SettingsForm.php +++ b/src/Form/SettingsForm.php @@ -21,6 +21,7 @@ final class SettingsForm extends FormBase { public const SENDER_IDENTIFIER_TYPE = 'sender_identifier_type'; public const SENDER_IDENTIFIER = 'sender_identifier'; + public const FORSENDELSES_TYPE_IDENTIFIKATOR = 'forsendelses_type_identifikator'; /** * The settings. @@ -103,6 +104,13 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#default_value' => $sender[self::SENDER_IDENTIFIER] ?? NULL, '#required' => TRUE, ], + + self::FORSENDELSES_TYPE_IDENTIFIKATOR => [ + '#type' => 'textfield', + '#title' => $this->t('Forsendelsestypeidentifikator'), + '#default_value' => $sender[self::FORSENDELSES_TYPE_IDENTIFIKATOR] ?? NULL, + '#required' => TRUE, + ], ]; $certificate = $this->settings->getCertificate(); diff --git a/src/Helper/AbstractMessageHelper.php b/src/Helper/AbstractMessageHelper.php new file mode 100644 index 0000000..34f71f0 --- /dev/null +++ b/src/Helper/AbstractMessageHelper.php @@ -0,0 +1,88 @@ +getWebform()->getElement($element) ?: []; + [$type] = explode(':', $element['#type']); + $instance = $this->elementInfoManager->createInstance($type); + if (!$instance instanceof WebformAttachmentBase) { + throw new InvalidAttachmentElementException(sprintf('Attachment element must be an instance of %s. Found %s.', WebformAttachmentBase::class, get_class($instance))); + } + + $fileName = $instance::getFileName($element, $submission); + $mimeType = $instance::getFileMimeType($element, $submission); + $content = $instance::getFileContent($element, $submission); + + return [ + self::DOCUMENT_CONTENT => $content, + self::DOCUMENT_SIZE => strlen($content), + self::DOCUMENT_MIME_TYPE => $mimeType, + self::DOCUMENT_FILENAME => $fileName, + self::DOCUMENT_LANGUAGE => self::DOCUMENT_LANGUAGE_DEFAULT, + ]; + } + + /** + * Replace tokens. + */ + protected function replaceTokens(string $text, WebformSubmissionInterface $submission): string { + return $this->webformTokenManager->replace($text, $submission); + } + + /** + * Check if a document is a PDF document. + */ + protected function isPdf(array $document): bool { + return self::MIME_TYPE_PDF === $document[self::DOCUMENT_MIME_TYPE]; + } + + /** + * Convert MeMo message to DOM document. + */ + public function message2dom(Message|ForsendelseI $message): \DOMDocument { + $document = new \DOMDocument(); + $document->loadXML((new Serializer())->serialize($message)); + + return $document; + } + +} diff --git a/src/Helper/CertificateLocatorHelper.php b/src/Helper/CertificateLocatorHelper.php index ffc816d..6d74cc9 100644 --- a/src/Helper/CertificateLocatorHelper.php +++ b/src/Helper/CertificateLocatorHelper.php @@ -4,7 +4,7 @@ use Drupal\os2forms_digital_post\Exception\CertificateLocatorException; use GuzzleHttp\Client; -use Http\Adapter\Guzzle7\Client as GuzzleAdapter; +use Http\Adapter\Guzzle6\Client as GuzzleAdapter; use Http\Factory\Guzzle\RequestFactory; use ItkDev\AzureKeyVault\Authorisation\VaultToken; use ItkDev\AzureKeyVault\KeyVault\VaultSecret; diff --git a/src/Helper/ForsendelseHelper.php b/src/Helper/ForsendelseHelper.php new file mode 100644 index 0000000..dbd28dd --- /dev/null +++ b/src/Helper/ForsendelseHelper.php @@ -0,0 +1,119 @@ +replaceTokens($options[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], $submission); + $forsendelse + ->setPostParametre((new PostParametre()) + ->setPostKategoriKode(self::POST_KATEGORI_KODE_PRIORITAIRE)) + ->setForsendelseModtager($this->createModtager($recipientData)) + ->setForsendelseTypeIdentifikator($options[self::FORSENDELSES_TYPE_IDENTIFIKATOR]) + ->setAfsendelseIdentifikator(Serializer::createUuid()) + ->setTransaktionsParametreI() + ->setDokumentParametre((new DokumentParametre()) + ->setTitelTekst($label)); + + $document = $this->getMainDocument($submission, $handlerSettings); + if (!$this->isPdf($document)) { + // This should never happen. + // @todo We cannot to handle non-PDF content. + } + + $forsendelse + ->setFilformatNavn('PDF') + ->setMeddelelseIndholdData($document[self::DOCUMENT_CONTENT]); + + return $forsendelse; + } + + /** + * Remove document content. + */ + public function removeDocumentContent(ForsendelseI $forsendelse): ForsendelseI { + $forsendelse->setMeddelelseIndholdData(''); + $forsendelse->setBilagSamling([]); + + return $forsendelse; + } + + /** + * Create modtager. + */ + private function createModtager($recipient): ForsendelseModtager { + $afsendelseModtager = new AfsendelseModtager(); + $modtagerAdresse = (new ModtagerAdresse()); + + if ($recipient instanceof CprLookupResult) { + // @see https://digitaliseringskataloget.srvitkhulk.itkdev.dk/digitaliseringskataloget.dk/sf1601/SF1601%20Bilag%2020211025/SF1601%20Postkomponent%20-%20KombiPostAfsend%20-%20Feltbeskrivelse.pdf#page=7 + $afsendelseModtager->setCPRnummerIdentifikator('0000000000'); + + $modtagerAdresse + ->setPersonName($recipient->getName()) + ->setStreetName($recipient->getStreet()) + ->setStreetBuildingIdentifier($recipient->getHouseNr()) + ->setPostCodeIdentifier($recipient->getPostalCode()) + ->setCountryIdentificationCode((new CountryIdentificationCode('DK')) + ->setScheme('iso3166-alpha2') + ); + + if ($floor = trim($recipient->getFloor() ?? '')) { + $modtagerAdresse->setFloorIdentifier($floor); + } + if ($suite = trim($recipient->getApartmentNr() ?? '')) { + $modtagerAdresse->setSuiteIdentifier($suite); + } + } + elseif ($recipient instanceof CompanyLookupResult) { + $afsendelseModtager->setCVRnummerIdentifikator($recipient->getCvr()); + + $modtagerAdresse + ->setPersonName($recipient->getName()) + ->setStreetName($recipient->getStreet()) + ->setStreetBuildingIdentifier($recipient->getHouseNr()) + ->setPostCodeIdentifier($recipient->getPostalCode()) + ->setCountryIdentificationCode((new CountryIdentificationCode('DK')) + ->setScheme('iso3166-alpha2') + ); + + if ($floor = trim($recipient->getFloor() ?? '')) { + $modtagerAdresse->setFloorIdentifier($floor); + } + if ($suite = trim($recipient->getApartmentNr() ?? '')) { + $modtagerAdresse->setSuiteIdentifier($suite); + } + } + + return (new ForsendelseModtager()) + ->setAfsendelseModtager($afsendelseModtager) + ->setModtagerAdresse($modtagerAdresse); + } + +} diff --git a/src/Helper/MeMoHelper.php b/src/Helper/MeMoHelper.php index cac4549..b044e26 100644 --- a/src/Helper/MeMoHelper.php +++ b/src/Helper/MeMoHelper.php @@ -4,7 +4,6 @@ use DataGovDk\Model\Core\Address; use DigitalPost\MeMo\Action; -use DigitalPost\MeMo\AdditionalDocument; use DigitalPost\MeMo\AttentionData; use DigitalPost\MeMo\AttentionPerson; use DigitalPost\MeMo\EntryPoint; @@ -15,56 +14,24 @@ use DigitalPost\MeMo\MessageHeader; use DigitalPost\MeMo\Recipient; use DigitalPost\MeMo\Sender; -use Drupal\Core\Render\ElementInfoManagerInterface; -use Drupal\os2forms_digital_post\Exception\InvalidAttachmentElementException; use Drupal\os2forms_digital_post\Exception\InvalidRecipientDataException; use Drupal\os2forms_digital_post\Form\SettingsForm; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drupal\os2web_datalookup\LookupResult\CompanyLookupResult; use Drupal\os2web_datalookup\LookupResult\CprLookupResult; use Drupal\webform\WebformSubmissionInterface; -use Drupal\webform\WebformTokenManagerInterface; -use Drupal\webform_attachment\Element\WebformAttachmentBase; use ItkDev\Serviceplatformen\Service\SF1601\Serializer; use ItkDev\Serviceplatformen\Service\SF1601\SF1601; /** * MeMo helper. */ -class MeMoHelper { - public const DOCUMENT_CONTENT = 'content'; - public const DOCUMENT_SIZE = 'size'; - public const DOCUMENT_MIME_TYPE = 'mime-type'; - public const DOCUMENT_FILENAME = 'filename'; - public const DOCUMENT_LANGUAGE = 'language'; - public const DOCUMENT_LANGUAGE_DEFAULT = 'da'; - - /** - * Element info. - * - * @var \Drupal\Core\Render\ElementInfoManagerInterface - */ - protected $elementInfoManager; - - /** - * The webform token manager. - * - * @var \Drupal\webform\WebformTokenManagerInterface - */ - protected $webformTokenManager; - - /** - * Constructor. - */ - public function __construct(ElementInfoManagerInterface $elementInfoManager, WebformTokenManagerInterface $webformTokenManager) { - $this->elementInfoManager = $elementInfoManager; - $this->webformTokenManager = $webformTokenManager; - } +class MeMoHelper extends AbstractMessageHelper { /** * Build MeMo message. */ - public function buildMessage(WebformSubmissionInterface $submission, array $options, array $handlerSettings, array $submissionData = [], $recipientData = NULL): Message { + public function buildMessage(WebformSubmissionInterface $submission, array $options, array $handlerSettings, array $submissionData = [], CprLookupResult|CompanyLookupResult|null $recipientData = NULL): Message { $messageUUID = Serializer::createUuid(); $messageID = Serializer::createUuid(); @@ -99,7 +66,6 @@ public function buildMessage(WebformSubmissionInterface $submission, array $opti ->setCreatedDateTime(new \DateTime()); $document = $this->getMainDocument($submission, $handlerSettings); - $attachments = $this->getAttachments($submission, $handlerSettings); $mainDocument = (new MainDocument()) ->setFile([ @@ -118,19 +84,6 @@ public function buildMessage(WebformSubmissionInterface $submission, array $opti $body->setMainDocument($mainDocument); - foreach ($attachments as $attachment) { - $additionalDocument = (new AdditionalDocument()) - ->setLabel($attachment['label'] ?? $attachment['filename']) - ->setFile([ - (new File()) - ->setEncodingFormat($attachment[self::DOCUMENT_MIME_TYPE]) - ->setLanguage($attachment[self::DOCUMENT_LANGUAGE]) - ->setFilename($attachment[self::DOCUMENT_FILENAME]) - ->setContent($attachment[self::DOCUMENT_CONTENT]), - ]); - $body->addToAdditionalDocument($additionalDocument); - } - $message->setMessageBody($body); return $message; @@ -190,16 +143,6 @@ private function enrichRecipient(Recipient $recipient, $recipientData = NULL): R return $recipient; } - /** - * Convert MeMo message to DOM document. - */ - public function message2dom(Message $message): \DOMDocument { - $document = new \DOMDocument(); - $document->loadXML((new Serializer())->serialize($message)); - - return $document; - } - /** * Build action. */ @@ -222,46 +165,4 @@ private function buildAction(array $options, WebformSubmissionInterface $submiss return $action; } - /** - * Get main document. - * - * @see WebformAttachmentController::download() - */ - private function getMainDocument(WebformSubmissionInterface $submission, array $handlerSettings): array { - // Lifted from Drupal\webform_attachment\Controller\WebformAttachmentController::download. - $element = $handlerSettings[WebformHandlerSF1601::MEMO_MESSAGE][WebformHandlerSF1601::ATTACHMENT_ELEMENT]; - $element = $submission->getWebform()->getElement($element) ?: []; - [$type] = explode(':', $element['#type']); - $instance = $this->elementInfoManager->createInstance($type); - if (!$instance instanceof WebformAttachmentBase) { - throw new InvalidAttachmentElementException(sprintf('Attachment element must be an instance of %s. Found %s.', WebformAttachmentBase::class, get_class($instance))); - } - - $fileName = $instance::getFileName($element, $submission); - $mimeType = $instance::getFileMimeType($element, $submission); - $content = $instance::getFileContent($element, $submission); - - return [ - self::DOCUMENT_CONTENT => $content, - self::DOCUMENT_SIZE => strlen($content), - self::DOCUMENT_MIME_TYPE => $mimeType, - self::DOCUMENT_FILENAME => $fileName, - self::DOCUMENT_LANGUAGE => self::DOCUMENT_LANGUAGE_DEFAULT, - ]; - } - - /** - * Get attachments. - */ - private function getAttachments(WebformSubmissionInterface $submission, array $handlerSettings): array { - return []; - } - - /** - * Replace tokens. - */ - private function replaceTokens(string $text, WebformSubmissionInterface $submission): string { - return $this->webformTokenManager->replace($text, $submission); - } - } diff --git a/src/Helper/WebformHelperSF1601.php b/src/Helper/WebformHelperSF1601.php index cd839b4..c898526 100644 --- a/src/Helper/WebformHelperSF1601.php +++ b/src/Helper/WebformHelperSF1601.php @@ -71,6 +71,7 @@ public function __construct( EntityTypeManagerInterface $entityTypeManager, readonly private DataLookupManager $dataLookupManager, readonly private MeMoHelper $meMoHelper, + readonly private ForsendelseHelper $forsendelseHelper, readonly private BeskedfordelerHelper $beskedfordelerHelper, LoggerChannelFactoryInterface $loggerChannelFactory ) { @@ -135,16 +136,16 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h // Remove all non-digits from recipient identifier. $recipientIdentifier = preg_replace('/[^\d]+/', '', $recipientIdentifier); - $cprServiceResult = NULL; - $cvrServiceResult = NULL; + /** @var \Drupal\os2web_datalookup\LookupResult\CprLookupResult|CompanyLookupResult|null $lookupResult */ + $lookupResult = NULL; if (preg_match('/^\d{8}$/', $recipientIdentifier)) { $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cvr_lookup'); if (!($instance instanceof DataLookupInterfaceCompany)) { throw new RuntimeException('Cannot get CVR data lookup instance'); } - $cvrServiceResult = $instance->lookup($recipientIdentifier); - if (!$cvrServiceResult->isSuccessful()) { + $lookupResult = $instance->lookup($recipientIdentifier); + if (!$lookupResult->isSuccessful()) { throw new RuntimeException('Cannot validate recipient CVR'); } $recipientIdentifierType = 'CVR'; @@ -154,8 +155,8 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h if (!($instance instanceof DataLookupInterfaceCpr)) { throw new RuntimeException('Cannot get CPR data lookup instance'); } - $cprServiceResult = $instance->lookup($recipientIdentifier); - if (!$cprServiceResult->isSuccessful()) { + $lookupResult = $instance->lookup($recipientIdentifier); + if (!$lookupResult->isSuccessful()) { throw new RuntimeException('Cannot validate recipient CPR'); } $recipientIdentifierType = 'CPR'; @@ -172,7 +173,19 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], ]; - $message = $this->meMoHelper->buildMessage($submission, $messageOptions, $handlerSettings, $submissionData, $cprServiceResult ?? $cvrServiceResult); + $message = $this->meMoHelper->buildMessage($submission, $messageOptions, $handlerSettings, $submissionData, $lookupResult); + $forsendelseOptions = [ + self::RECIPIENT_IDENTIFIER_TYPE => $recipientIdentifierType, + self::RECIPIENT_IDENTIFIER => $recipientIdentifier, + + SettingsForm::SENDER_IDENTIFIER_TYPE => $senderSettings[SettingsForm::SENDER_IDENTIFIER_TYPE], + SettingsForm::SENDER_IDENTIFIER => $senderSettings[SettingsForm::SENDER_IDENTIFIER], + SettingsForm::FORSENDELSES_TYPE_IDENTIFIKATOR => $senderSettings[SettingsForm::FORSENDELSES_TYPE_IDENTIFIKATOR], + + WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], + WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], + ]; + $forsendelse = $this->forsendelseHelper->buildForsendelse($submission, $forsendelseOptions, $handlerSettings, $submissionData, $lookupResult); $options = [ 'test_mode' => (bool) $this->settings->getTestMode(), @@ -182,7 +195,7 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h $service = new SF1601($options); $transactionId = Serializer::createUuid(); $type = $handlerMessageSettings[WebformHandlerSF1601::TYPE] ?? SF1601::TYPE_DIGITAL_POST; - $response = $service->kombiPostAfsend($transactionId, $type, $message); + $response = $service->kombiPostAfsend($transactionId, $type, $message, $forsendelse); $this->beskedfordelerHelper->createMessage($submission->id(), $message, (string) $response->getContent()); From 9ed71ecbb593d5b4eaab17e449ad09c5edf9ab26 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 9 May 2023 12:52:57 +0200 Subject: [PATCH 10/26] FORMS-821: Cleaned up (after code analysis) --- composer.json | 20 +++-- os2forms_digital_post.install | 4 +- os2forms_digital_post.routing.yml | 8 -- phpstan.neon | 23 +++++ src/Commands/CommandsSF1601.php | 27 ++++-- src/Commands/CreatePdf.php | 8 +- src/Consumer/PrintServiceConsumer.php | 20 ++--- src/Controller/SF1601Controller.php | 72 ---------------- src/Form/SettingsForm.php | 32 ++++--- src/Helper/AbstractMessageHelper.php | 10 ++- src/Helper/BeskedfordelerHelper.php | 7 +- src/Helper/CertificateLocatorHelper.php | 12 +-- src/Helper/ForsendelseHelper.php | 15 ++-- src/Helper/MeMoHelper.php | 13 +-- src/Helper/Settings.php | 6 ++ src/Helper/WebformHelper.php | 21 +++-- src/Helper/WebformHelperSF1601.php | 40 +++++---- src/Manager/TemplateManager.php | 6 +- src/Manager/TemplateManagerInterface.php | 2 + src/Model/Message.php | 2 +- .../AdvancedQueue/JobType/SendDigitalPost.php | 6 +- .../JobType/SendDigitalPostSF1601.php | 4 + .../DigitalPostWebformHandler.php | 83 +++++++++++++------ .../WebformHandler/WebformHandlerSF1601.php | 63 +++++++------- 24 files changed, 273 insertions(+), 231 deletions(-) create mode 100644 phpstan.neon delete mode 100644 src/Controller/SF1601Controller.php diff --git a/composer.json b/composer.json index a5f53f2..d83dd7e 100644 --- a/composer.json +++ b/composer.json @@ -41,19 +41,20 @@ } }, "require-dev": { - "wsdltophp/packagegenerator": "^4.0", - "drupal/coder": "^8.3", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", - "mglaman/drupal-check": "^1.4", - "phpunit/phpunit": "^9.5" + "drupal/coder": "^8.3", + "mglaman/phpstan-drupal": "^1.1", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpunit/phpunit": "^9.5", + "wsdltophp/packagegenerator": "^4.0" }, "scripts": { - "code-analysis/drupal-check": [ - "# @see https://github.com/mglaman/drupal-check/issues/261#issuecomment-1030141772 for details on exclude-dir value", - "drupal-check --deprecations --analysis --exclude-dir='vendor,*/Client/*' *.* src" + "code-analysis/phpstan": [ + "phpstan analyse" ], "code-analysis": [ - "@code-analysis/drupal-check" + "@code-analysis/phpstan" ], "coding-standards-check/phpcs": [ "phpcs --standard=phpcs.xml.dist" @@ -75,7 +76,8 @@ "vaimo/composer-patches": true, "cweagans/composer-patches": true, "zaporylie/composer-drupal-optimizations": true, - "simplesamlphp/composer-module-installer": true + "simplesamlphp/composer-module-installer": true, + "phpstan/extension-installer": true } } } diff --git a/os2forms_digital_post.install b/os2forms_digital_post.install index 9ea8c7d..ce48380 100644 --- a/os2forms_digital_post.install +++ b/os2forms_digital_post.install @@ -21,13 +21,13 @@ function os2forms_digital_post_schema() { /** * Enable Beskedfordeler module. */ -function os2forms_digital_post_update_9001() { +function os2forms_digital_post_update_9001(): void { Drupal::service('module_installer')->install(['beskedfordeler']); } /** * Create beskedfordeler table. */ -function os2forms_digital_post_update_9002() { +function os2forms_digital_post_update_9002(): void { Drupal::service(BeskedfordelerHelper::class)->update9002(); } diff --git a/os2forms_digital_post.routing.yml b/os2forms_digital_post.routing.yml index 7822857..7220baf 100644 --- a/os2forms_digital_post.routing.yml +++ b/os2forms_digital_post.routing.yml @@ -5,11 +5,3 @@ os2forms_digital_post.admin.settings: _title: 'Digital post settings' requirements: _permission: 'administer site configuration' - -os2forms_digital_post.sf1601.PostStatusBeskedModtag: - path: '/os2forms_digital_post/PostStatusBeskedModtag' - defaults: - _controller: '\Drupal\os2forms_digital_post\Controller\SF1601Controller::postStatusBeskedModtag' - requirements: - # Access check performed in controller. - _access: 'TRUE' diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..46acb27 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,23 @@ +parameters: + level: 6 + paths: + - . + excludePaths: + # @see https://github.com/mglaman/drupal-check/issues/261#issuecomment-1030141772/ + - vendor + - '*/node_modules/*' + # Auto-generated code + - generated-sources + - '*/Client/*' + ignoreErrors: + - + # Ignore some weird errors reported by PHPStan + # @todo Investigate further + messages: + # These errors may be related to classes that don't add anything to their base class (e.g. `class BrugerFlerRelationType extends FlerRelationType {}`) + - '#expects (DataGovDk\\Model\\Core\\)(.+)(\|null)?, \1\2\\\2AType given.#' + - '#expects (DigitalPost\\MeMo\\)(.+)(\|null)?, \1\2\\\2AType given.#' + - '#expects (Oio\\(?:.+\\)*)(.+)(\|null)?, \1\2Type given.#' + - '#expects array<(DigitalPost\\MeMo\\)(.+)>(\|null)?, array given.#' + - '#should return (DigitalPost\\MeMo\\)(.+) but returns \1\2\\\2AType.#' + - '#should return (Oio\\Fjernprint\\)(.+) but returns \1\2Type.#' diff --git a/src/Commands/CommandsSF1601.php b/src/Commands/CommandsSF1601.php index e2768d5..976a74b 100644 --- a/src/Commands/CommandsSF1601.php +++ b/src/Commands/CommandsSF1601.php @@ -57,13 +57,15 @@ public function __construct( * * @command os2forms_digital_post:digital-post:send * @usage os2forms_digital_post:digital-post:send --help + * + * @phpstan-param array $options */ public function send(int $submissionId, string $handlerId, array $options = [ 'handler-settings' => NULL, 'recipient-element' => NULL, 'attachment-element' => NULL, 'submission-data' => NULL, - ]) { + ]): void { [$submission, $handlerSettings, $submissionData] = $this->getData($submissionId, $handlerId, $options); $this->webformHelper->sendDigitalPost($submission, $handlerSettings, $submissionData); @@ -90,6 +92,8 @@ public function send(int $submissionId, string $handlerId, array $options = [ * * @command os2forms_digital_post:digital-post:memo-show * @usage os2forms_digital_post:digital-post:memo-show --help + * + * @phpstan-param array $options */ public function meMoShow(int $submissionId, string $handlerId, array $options = [ 'handler-settings' => NULL, @@ -97,7 +101,7 @@ public function meMoShow(int $submissionId, string $handlerId, array $options = 'attachment-element' => NULL, 'submission-data' => NULL, 'dump' => NULL, - ]) { + ]): void { [$submission, $handlerSettings] = $this->getData($submissionId, $handlerId, $options); $handlerMessageSettings = $handlerSettings[WebformHandlerSF1601::MEMO_MESSAGE]; @@ -147,6 +151,8 @@ public function meMoShow(int $submissionId, string $handlerId, array $options = * * @command os2forms_digital_post:digital-post:forsendelse-show * @usage os2forms_digital_post:digital-post:forsendelse-show --help + * + * @phpstan-param array $options */ public function forsendelseShow(int $submissionId, string $handlerId, array $options = [ 'handler-settings' => NULL, @@ -154,7 +160,7 @@ public function forsendelseShow(int $submissionId, string $handlerId, array $opt 'attachment-element' => NULL, 'submission-data' => NULL, 'dump' => NULL, - ]) { + ]): void { [$submission, $handlerSettings] = $this->getData($submissionId, $handlerId, $options); $handlerMessageSettings = $handlerSettings[WebformHandlerSF1601::MEMO_MESSAGE]; @@ -181,7 +187,7 @@ public function forsendelseShow(int $submissionId, string $handlerId, array $opt /** * Dump MeMo message stuff. */ - private function meMoDump(string $dump, Message $message) { + private function meMoDump(string $dump, Message $message): void { switch ($dump) { case 'main-document-file-info': foreach ($message->getMessageBody()->getMainDocument()->getFile() as $file) { @@ -213,24 +219,31 @@ private function meMoDump(string $dump, Message $message) { /** * Dump forsendelse stuff. */ - private function forsendelseDump(string $dump, ForsendelseI $forsendelse) { + private function forsendelseDump(string $dump, ForsendelseI $forsendelse): void { switch ($dump) { case self::HIDDEN_CONTENT: + // @todo What does really make sense to dump? break; default: throw new InvalidOptionException(sprintf( 'Invalid dump option %s. Must be one of %s', json_encode($dump), - implode(', ', array_map('json_encode', self::MEMO_DUMP_OPTION_VALUES)) + implode(', ', array_map('json_encode', self::FORSENDELSE_DUMP_OPTION_VALUES)) )); } } /** * Get data. + * + * @return array + * [submission, handlerSettings, submissionData] + * + * @phpstan-param array $options + * @phpstan-return array */ - private function getData(int $submissionId, string $handlerId, array $options) { + private function getData(int $submissionId, string $handlerId, array $options): array { $submission = $this->webformHelper->loadSubmission($submissionId); if (NULL === $submission) { throw new InvalidArgumentException(sprintf('Cannot load submission %d', $submissionId)); diff --git a/src/Commands/CreatePdf.php b/src/Commands/CreatePdf.php index 7af9b07..d801b11 100644 --- a/src/Commands/CreatePdf.php +++ b/src/Commands/CreatePdf.php @@ -18,7 +18,7 @@ class CreatePdf extends DrushCommands { /** * The os2forms_digital_post webform helper. * - * @var \Drupal\os2forms_digital_post\WebformHelper + * @var \Drupal\os2forms_digital_post\Helper\WebformHelper */ protected WebformHelper $webformHelper; @@ -61,12 +61,14 @@ public function __construct(WebformHelper $webformHelper, TemplateManager $templ * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException + * + * @phpstan-param array $options */ public function create($template, array $options = [ 'submission_id' => 0, 'file_location' => '', 'file_name' => 'test.pdf', - ]) { + ]): void { $webform_submission = $this->entityTypeManager->getStorage('webform_submission')->load($options['submission_id']); if (!$webform_submission) { @@ -84,7 +86,7 @@ public function create($template, array $options = [ $cprServiceResult->setPostalCode('8000'); $cprServiceResult->setCity('Aarhus C'); - $context = $this->webformHelper->getTemplateContext($webform_submission, $cprServiceResult, []); + $context = $this->webformHelper->getTemplateContext($webform_submission, $cprServiceResult); $pdf = $this->templateManager->renderPdf($template, $context); $filePath = dirname(DRUPAL_ROOT) . $options['file_location'] . '/' . $options['file_name']; diff --git a/src/Consumer/PrintServiceConsumer.php b/src/Consumer/PrintServiceConsumer.php index 2908c8c..0940af5 100644 --- a/src/Consumer/PrintServiceConsumer.php +++ b/src/Consumer/PrintServiceConsumer.php @@ -26,11 +26,6 @@ use ItkDev\Serviceplatformen\Certificate\AzureKeyVaultCertificateLocator; use ItkDev\Serviceplatformen\Certificate\CertificateLocatorInterface; use WsdlToPhp\PackageBase\AbstractSoapClientBase; -use GuzzleHttp\Client; -use Http\Factory\Guzzle\RequestFactory; -use ItkDev\AzureKeyVault\Authorisation\VaultToken; -use Http\Adapter\Guzzle6\Client as GuzzleAdapter; -use ItkDev\AzureKeyVault\KeyVault\VaultSecret; /** * Print service consumer. @@ -67,7 +62,7 @@ class PrintServiceConsumer { /** * The UUID generator. * - * @var UuidInterface + * @var \Drupal\Component\Uuid\UuidInterface */ private $uuid; @@ -87,6 +82,7 @@ public function __construct(ConfigFactoryInterface $configFactory, Client $guzzl $this->guzzleClient = $guzzleClient; $this->lock = $lock; $this->state = $state; + // @phpstan-ignore-next-line $this->uuid = \Drupal::service('uuid'); } @@ -106,13 +102,13 @@ public function afsendBrevPerson( string $mailDeliverySublocationIdentifier = NULL, string $postCodeIdentifier = NULL, string $districtSubdivisionIdentifier = NULL, - string $postOfficeBoxIdentifier = NULL, + int $postOfficeBoxIdentifier = NULL, string $countryIdentificationCode = NULL, string $filFormatNavn = NULL, string $meddelelseIndholdData = NULL, string $titelTekst = NULL, string $brevDato = NULL - ) { + ): bool { if (!$this->acquireLock()) { $this->waitLock(); @@ -182,6 +178,7 @@ public function afsendBrevPerson( $client = new Afsend([ AbstractSoapClientBase::WSDL_URL => $this->config->get('service_contract'), AbstractSoapClientBase::WSDL_CLASSMAP => ClassMap::get(), + // @phpstan-ignore-next-line AbstractSoapClientBase::WSDL_LOCAL_CERT => $certificateLocator->getAbsolutePathToCertificate(), AbstractSoapClientBase::WSDL_LOCATION => $this->config->get('service_endpoint'), ]); @@ -192,7 +189,7 @@ public function afsendBrevPerson( if (FALSE === $response) { $lastError = $client->getLastError(); - /** @var SoapFault $soapError */ + /** @var \SoapFault $soapError */ $soapError = $lastError['Drupal\os2forms_digital_post\Client\ServiceType\Afsend::afsendBrev']; // Should maybe log this instead! throw new \Exception($soapError->getMessage(), $soapError->getCode()); @@ -295,6 +292,7 @@ public function afsendDigitalPostPerson( $client = new Afsend([ AbstractSoapClientBase::WSDL_URL => $this->config->get('service_contract'), AbstractSoapClientBase::WSDL_CLASSMAP => ClassMap::get(), + // @phpstan-ignore-next-line AbstractSoapClientBase::WSDL_LOCAL_CERT => $certificateLocator->getAbsolutePathToCertificate(), AbstractSoapClientBase::WSDL_LOCATION => $this->config->get('service_endpoint'), ]); @@ -305,7 +303,7 @@ public function afsendDigitalPostPerson( if (FALSE === $response) { $lastError = $client->getLastError(); - /** @var SoapFault $soapError */ + /** @var \SoapFault $soapError */ $soapError = $lastError['Drupal\os2forms_digital_post\Client\ServiceType\Afsend::afsendBrev']; // Should maybe log this instead! throw new \Exception($soapError->getMessage(), $soapError->getCode()); @@ -344,7 +342,7 @@ protected function acquireLock(): bool { /** * Release lock. */ - protected function releaseLock() { + protected function releaseLock(): void { $this->lock->release($this->lockName); } diff --git a/src/Controller/SF1601Controller.php b/src/Controller/SF1601Controller.php deleted file mode 100644 index 9c783c2..0000000 --- a/src/Controller/SF1601Controller.php +++ /dev/null @@ -1,72 +0,0 @@ -requestStack = $requestStack; - $this->sf1461 = $sf1461; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('request_stack'), - $container->get(SF1461Helper::class), - ); - } - - /** - * Handle PostStatusBeskedModtag. - * - * @see https://digitaliseringskataloget.dk/integration/sf1601 - */ - public function postStatusBeskedModtag() { - // Write the payload to a local file. - $request = $this->requestStack->getCurrentRequest(); - $payload = [ - 'now' => (new \DateTimeImmutable())->format(\DateTimeImmutable::ATOM), - 'method' => $request->getMethod(), - 'headers' => $request->headers->all(), - 'query' => $request->query->all(), - 'content' => $request->getContent(), - ]; - file_put_contents(__FILE__ . '.log', var_export($payload, TRUE), FILE_APPEND); - - $statusCode = 20; - $errorMessage = NULL; - - $document = $this->sf1461->buildResponseDocument($statusCode, $errorMessage); - - return new Response($document->saveXML(), Response::HTTP_OK, ['content-type' => 'application/xml']); - } - -} diff --git a/src/Form/SettingsForm.php b/src/Form/SettingsForm.php index a2b056f..b524b72 100644 --- a/src/Form/SettingsForm.php +++ b/src/Form/SettingsForm.php @@ -2,8 +2,8 @@ namespace Drupal\os2forms_digital_post\Form; -use Drupal\advancedqueue\Entity\QueueInterface; -use Drupal\Core\Config\Entity\ConfigEntityStorage; +use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; @@ -33,9 +33,9 @@ final class SettingsForm extends FormBase { /** * The queue storage. * - * @var \Drupal\Core\Config\Entity\ConfigEntityStorage|\Drupal\Core\Entity\EntityStorageInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected ConfigEntityStorage $queueStorage; + protected EntityStorageInterface $queueStorage; /** * The certificate locator helper. @@ -50,12 +50,13 @@ final class SettingsForm extends FormBase { public function __construct(Settings $settings, EntityTypeManagerInterface $entityTypeManager, CertificateLocatorHelper $certificateLocatorHelper) { $this->settings = $settings; $this->queueStorage = $entityTypeManager->getStorage('advancedqueue_queue'); - $this->certificateLocatorHelper = $certificateLocatorHelper; } /** * {@inheritdoc} + * + * @phpstan-return self */ public static function create(ContainerInterface $container) { return new static( @@ -74,6 +75,9 @@ public function getFormId() { /** * {@inheritdoc} + * + * @phpstan-param array $form + * @phpstan-return array */ public function buildForm(array $form, FormStateInterface $form_state) { $form['test_mode'] = [ @@ -151,7 +155,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['certificate'][CertificateLocatorHelper::LOCATOR_TYPE_AZURE_KEY_VAULT][$key] = [ '#type' => 'textfield', '#title' => $info['title'], - '#description' => $info['description'] ?? NULL, '#default_value' => $certificate[CertificateLocatorHelper::LOCATOR_TYPE_AZURE_KEY_VAULT][$key] ?? NULL, '#states' => [ 'required' => [':input[name="certificate[locator_type]"]' => ['value' => CertificateLocatorHelper::LOCATOR_TYPE_AZURE_KEY_VAULT]], @@ -193,9 +196,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['processing']['queue'] = [ '#type' => 'select', '#title' => $this->t('Queue'), - '#options' => array_map(static function (QueueInterface $queue) { - return $queue->label(); - }, $this->queueStorage->loadMultiple() + '#options' => array_map( + static fn(EntityInterface $queue) => $queue->label(), + $this->queueStorage->loadMultiple() ), '#default_value' => $defaultValue, '#description' => $this->t("Queue for digital post jobs. The queue must be run via Drupal's cron or via drush advancedqueue:queue:process @queue(in a cron job).", [ @@ -222,8 +225,10 @@ public function buildForm(array $form, FormStateInterface $form_state) { /** * {@inheritdoc} + * + * @phpstan-param array $form */ - public function validateForm(array &$form, FormStateInterface $formState) { + public function validateForm(array &$form, FormStateInterface $formState): void { $triggeringElement = $formState->getTriggeringElement(); if ('testCertificate' === ($triggeringElement['#name'] ?? NULL)) { return; @@ -240,8 +245,10 @@ public function validateForm(array &$form, FormStateInterface $formState) { /** * {@inheritdoc} + * + * @phpstan-param array $form */ - public function submitForm(array &$form, FormStateInterface $formState) { + public function submitForm(array &$form, FormStateInterface $formState): void { $triggeringElement = $formState->getTriggeringElement(); if ('testCertificate' === ($triggeringElement['#name'] ?? NULL)) { $this->testCertificate(); @@ -264,11 +271,10 @@ public function submitForm(array &$form, FormStateInterface $formState) { /** * Test certificate. */ - private function testCertificate() { + private function testCertificate(): void { try { $certificateLocator = $this->certificateLocatorHelper->getCertificateLocator(); $certificateLocator->getCertificates(); - $certificateLocator->getAbsolutePathToCertificate(); $this->messenger()->addStatus($this->t('Certificate succesfully tested')); } catch (\Throwable $throwable) { diff --git a/src/Helper/AbstractMessageHelper.php b/src/Helper/AbstractMessageHelper.php index 34f71f0..0de0ada 100644 --- a/src/Helper/AbstractMessageHelper.php +++ b/src/Helper/AbstractMessageHelper.php @@ -2,9 +2,10 @@ namespace Drupal\os2forms_digital_post\Helper; -use Drupal\Core\Render\ElementInfoManagerInterface; +use DigitalPost\MeMo\Message; use Drupal\os2forms_digital_post\Exception\InvalidAttachmentElementException; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; +use Drupal\webform\Plugin\WebformElementManagerInterface; use Drupal\webform\WebformSubmissionInterface; use Drupal\webform\WebformTokenManagerInterface; use Drupal\webform_attachment\Element\WebformAttachmentBase; @@ -28,7 +29,7 @@ abstract class AbstractMessageHelper { * Constructor. */ public function __construct( - readonly protected ElementInfoManagerInterface $elementInfoManager, + readonly protected WebformElementManagerInterface $elementInfoManager, readonly protected WebformTokenManagerInterface $webformTokenManager ) { } @@ -37,6 +38,9 @@ public function __construct( * Get main document. * * @see WebformAttachmentController::download() + * + * @phpstan-param array $handlerSettings + * @phpstan-return array */ protected function getMainDocument(WebformSubmissionInterface $submission, array $handlerSettings): array { // Lifted from Drupal\webform_attachment\Controller\WebformAttachmentController::download. @@ -70,6 +74,8 @@ protected function replaceTokens(string $text, WebformSubmissionInterface $submi /** * Check if a document is a PDF document. + * + * @phpstan-param array $document */ protected function isPdf(array $document): bool { return self::MIME_TYPE_PDF === $document[self::DOCUMENT_MIME_TYPE]; diff --git a/src/Helper/BeskedfordelerHelper.php b/src/Helper/BeskedfordelerHelper.php index 103df21..ab3c249 100644 --- a/src/Helper/BeskedfordelerHelper.php +++ b/src/Helper/BeskedfordelerHelper.php @@ -44,7 +44,7 @@ public function __construct(Connection $database, MeMoHelper $meMoHelper, Logger /** * Save MeMo message in database. */ - public function createMessage(int $submissionId, MeMoMessage $message, string $receipt) { + public function createMessage(int $submissionId, MeMoMessage $message, string $receipt): int { $messageUUID = $message->getMessageHeader()->getMessageUUID(); $message = $this->meMoHelper->message2dom($message)->saveXML(); @@ -69,6 +69,7 @@ public function createMessage(int $submissionId, MeMoMessage $message, string $r * The message. */ public function loadMessage(string $messageUUID): ?Message { + // @phpstan-ignore-next-line (fetchObject invoked with 2 parameters) return $this->database ->select(self::TABLE_NAME, 'm') ->fields('m') @@ -102,7 +103,7 @@ public function addBeskedfordelerMessage(string $messageUUID, string $beskedford * @param array|WebformSubmissionInterface[] $submissions * The submissions. */ - public function deleteMessages(array $submissions) { + public function deleteMessages(array $submissions): void { $submissionIds = array_map(static function (WebformSubmissionInterface $submission) { return $submission->id(); }, $submissions); @@ -166,7 +167,7 @@ public function schema(): array { * * Creates beskedfordeler table. */ - public function update9002() { + public function update9002(): void { $spec = [ 'description' => 'OSForms digital post beskedfordeler', 'fields' => [ diff --git a/src/Helper/CertificateLocatorHelper.php b/src/Helper/CertificateLocatorHelper.php index 6d74cc9..c14be13 100644 --- a/src/Helper/CertificateLocatorHelper.php +++ b/src/Helper/CertificateLocatorHelper.php @@ -19,18 +19,12 @@ class CertificateLocatorHelper { public const LOCATOR_TYPE_AZURE_KEY_VAULT = 'azure_key_vault'; public const LOCATOR_TYPE_FILE_SYSTEM = 'file_system'; - /** - * The settings. - * - * @var \Drupal\os2forms_digital_post\SettingsInterface|Settings - */ - private Settings $settings; - /** * {@inheritdoc} */ - public function __construct(Settings $settings) { - $this->settings = $settings; + public function __construct( + readonly private Settings $settings + ) { } /** diff --git a/src/Helper/ForsendelseHelper.php b/src/Helper/ForsendelseHelper.php index dbd28dd..743c138 100644 --- a/src/Helper/ForsendelseHelper.php +++ b/src/Helper/ForsendelseHelper.php @@ -26,8 +26,11 @@ class ForsendelseHelper extends AbstractMessageHelper { /** * Build forsendelse. + * + * @phpstan-param array $options + * @phpstan-param array $handlerSettings */ - public function buildForsendelse(WebformSubmissionInterface $submission, array $options, array $handlerSettings, array $submissionData = [], CprLookupResult|CompanyLookupResult|null $recipientData = NULL): ForsendelseI { + public function buildForsendelse(WebformSubmissionInterface $submission, array $options, array $handlerSettings, CprLookupResult|CompanyLookupResult|null $recipientData = NULL): ForsendelseI { $forsendelse = new ForsendelseI(); $label = $this->replaceTokens($options[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], $submission); @@ -67,7 +70,7 @@ public function removeDocumentContent(ForsendelseI $forsendelse): ForsendelseI { /** * Create modtager. */ - private function createModtager($recipient): ForsendelseModtager { + private function createModtager(CprLookupResult|CompanyLookupResult|null $recipient): ForsendelseModtager { $afsendelseModtager = new AfsendelseModtager(); $modtagerAdresse = (new ModtagerAdresse()); @@ -84,10 +87,10 @@ private function createModtager($recipient): ForsendelseModtager { ->setScheme('iso3166-alpha2') ); - if ($floor = trim($recipient->getFloor() ?? '')) { + if ($floor = trim($recipient->getFloor())) { $modtagerAdresse->setFloorIdentifier($floor); } - if ($suite = trim($recipient->getApartmentNr() ?? '')) { + if ($suite = trim($recipient->getApartmentNr())) { $modtagerAdresse->setSuiteIdentifier($suite); } } @@ -103,10 +106,10 @@ private function createModtager($recipient): ForsendelseModtager { ->setScheme('iso3166-alpha2') ); - if ($floor = trim($recipient->getFloor() ?? '')) { + if ($floor = trim($recipient->getFloor())) { $modtagerAdresse->setFloorIdentifier($floor); } - if ($suite = trim($recipient->getApartmentNr() ?? '')) { + if ($suite = trim($recipient->getApartmentNr())) { $modtagerAdresse->setSuiteIdentifier($suite); } } diff --git a/src/Helper/MeMoHelper.php b/src/Helper/MeMoHelper.php index b044e26..38ec89e 100644 --- a/src/Helper/MeMoHelper.php +++ b/src/Helper/MeMoHelper.php @@ -14,7 +14,6 @@ use DigitalPost\MeMo\MessageHeader; use DigitalPost\MeMo\Recipient; use DigitalPost\MeMo\Sender; -use Drupal\os2forms_digital_post\Exception\InvalidRecipientDataException; use Drupal\os2forms_digital_post\Form\SettingsForm; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drupal\os2web_datalookup\LookupResult\CompanyLookupResult; @@ -30,8 +29,11 @@ class MeMoHelper extends AbstractMessageHelper { /** * Build MeMo message. + * + * @phpstan-param array $options + * @phpstan-param array $handlerSettings */ - public function buildMessage(WebformSubmissionInterface $submission, array $options, array $handlerSettings, array $submissionData = [], CprLookupResult|CompanyLookupResult|null $recipientData = NULL): Message { + public function buildMessage(WebformSubmissionInterface $submission, array $options, array $handlerSettings, CprLookupResult|CompanyLookupResult|null $recipientData = NULL): Message { $messageUUID = Serializer::createUuid(); $messageID = Serializer::createUuid(); @@ -92,7 +94,7 @@ public function buildMessage(WebformSubmissionInterface $submission, array $opti /** * Enrich recipient with additional data from a lookup. */ - private function enrichRecipient(Recipient $recipient, $recipientData = NULL): Recipient { + private function enrichRecipient(Recipient $recipient, CprLookupResult|CompanyLookupResult|null $recipientData): Recipient { if ($recipientData instanceof CprLookupResult) { $name = $recipientData->getName(); $recipient->setLabel($name); @@ -136,15 +138,14 @@ private function enrichRecipient(Recipient $recipient, $recipientData = NULL): R $recipient->setAttentionData($attentionData); } - elseif (NULL !== $recipientData) { - throw new InvalidRecipientDataException(sprintf('Cannot handle recipient data of type %s', is_scalar($recipientData) ? gettype($recipientData) : get_class($recipientData))); - } return $recipient; } /** * Build action. + * + * @phpstan-param array $options */ private function buildAction(array $options, WebformSubmissionInterface $submission): Action { $label = $this->replaceTokens($options['label'], $submission); diff --git a/src/Helper/Settings.php b/src/Helper/Settings.php index ab94b3c..7f65e3b 100644 --- a/src/Helper/Settings.php +++ b/src/Helper/Settings.php @@ -41,6 +41,8 @@ public function getTestMode(): bool { /** * Get sender. + * + * @phpstan-return array */ public function getSender(): array { $value = $this->get('sender'); @@ -49,6 +51,8 @@ public function getSender(): array { /** * Get certificate. + * + * @phpstan-return array */ public function getCertificate(): array { $value = $this->get('certificate'); @@ -57,6 +61,8 @@ public function getCertificate(): array { /** * Get processing. + * + * @phpstan-return array */ public function getProcessing(): array { $value = $this->get('processing'); diff --git a/src/Helper/WebformHelper.php b/src/Helper/WebformHelper.php index 1d9096c..4eea296 100644 --- a/src/Helper/WebformHelper.php +++ b/src/Helper/WebformHelper.php @@ -4,7 +4,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Logger\LoggerChannelFactoryInterface; -use Drupal\Core\Render\Renderer; +use Drupal\Core\Render\RendererInterface; use Drupal\os2forms_digital_post\Consumer\PrintServiceConsumer; use Drupal\os2forms_digital_post\Exception\CprElementNotFoundInSubmissionException; use Drupal\os2forms_digital_post\Exception\RuntimeException; @@ -30,7 +30,7 @@ final class WebformHelper { /** * The drupal renderer. * - * @var Drupal\Core\Render\Renderer + * @var \Drupal\Core\Render\RendererInterface */ protected $renderer; @@ -65,7 +65,7 @@ final class WebformHelper { /** * Constructor. */ - public function __construct(EntityTypeManagerInterface $entity_type_manager, Renderer $renderer, DataLookupManager $dataLookupManager, PrintServiceConsumer $printServiceConsumer, TemplateManager $templateManager, LoggerChannelFactoryInterface $loggerChannelFactory) { + public function __construct(EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, DataLookupManager $dataLookupManager, PrintServiceConsumer $printServiceConsumer, TemplateManager $templateManager, LoggerChannelFactoryInterface $loggerChannelFactory) { $this->entityTypeManager = $entity_type_manager; $this->renderer = $renderer; $this->dataLookupManager = $dataLookupManager; @@ -76,8 +76,10 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Ren /** * Get template context. + * + * @phpstan-return array */ - public function getTemplateContext(WebformSubmissionInterface $webformSubmission, CprLookupResult $cprLookupResult, array $configuration = []) { + public function getTemplateContext(WebformSubmissionInterface $webformSubmission, CprLookupResult $cprLookupResult): array { $webform = $webformSubmission->getWebform(); $view_builder = $this->entityTypeManager->getViewBuilder('webform_submission'); @@ -126,9 +128,10 @@ public function getTemplateContext(WebformSubmissionInterface $webformSubmission * A PluginNotFoundException. * @throws \ItkDev\Serviceplatformen\Service\Exception\ServiceException * A ServiceException. + * + * @phpstan-param array $handlerConfiguration */ - public function sendDigitalPost(string $submissionId, array $handlerConfiguration) { - /** @var \Drupal\webform\Entity\WebformSubmission $submission */ + public function sendDigitalPost(string $submissionId, array $handlerConfiguration): void { $webform_submission = $this->getSubmission($submissionId); if (empty($webform_submission)) { $this->logger->error( @@ -154,7 +157,7 @@ public function sendDigitalPost(string $submissionId, array $handlerConfiguratio throw new RuntimeException('Cannot get CPR data lookup instance'); } $cprLookupResult = $instance->lookup($submissionData[$handlerConfiguration['cpr_element']]); - $context = $this->getTemplateContext($webform_submission, $cprLookupResult, $handlerConfiguration); + $context = $this->getTemplateContext($webform_submission, $cprLookupResult); $result = FALSE; switch ($handlerConfiguration['channel']) { @@ -167,7 +170,7 @@ public function sendDigitalPost(string $submissionId, array $handlerConfiguratio NULL, $cprLookupResult->getStreet(), $cprLookupResult->getHouseNr(), - $floor, + $cprLookupResult->getFloor(), NULL, NULL, $cprLookupResult->getPostalCode(), @@ -203,7 +206,7 @@ public function sendDigitalPost(string $submissionId, array $handlerConfiguratio * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ - private function getSubmission(string $submissionId) { + private function getSubmission(string $submissionId): ?WebformSubmissionInterface { $storage = $this->entityTypeManager->getStorage('webform_submission'); return $storage->load($submissionId); } diff --git a/src/Helper/WebformHelperSF1601.php b/src/Helper/WebformHelperSF1601.php index c898526..4dcbc5e 100644 --- a/src/Helper/WebformHelperSF1601.php +++ b/src/Helper/WebformHelperSF1601.php @@ -5,7 +5,7 @@ use Drupal\advancedqueue\Entity\QueueInterface; use Drupal\advancedqueue\Job; use Drupal\advancedqueue\JobResult; -use Drupal\Core\Config\Entity\ConfigEntityStorage; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Logger\LoggerChannelInterface; @@ -44,9 +44,9 @@ final class WebformHelperSF1601 implements LoggerInterface { /** * The queue storage. * - * @var \Drupal\Core\Config\Entity\ConfigEntityStorage|\Drupal\Core\Entity\EntityStorageInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected ConfigEntityStorage $queueStorage; + protected EntityStorageInterface $queueStorage; /** * The logger. @@ -92,7 +92,11 @@ public function __construct( * Submission data. Only for overriding during testing and development. * * @return array - * [The response, The MeMo message]. + * [The response, The kombi post message]. + * + * @phpstan-param array $handlerSettings + * @phpstan-param array $submissionData + * @phpstan-return array */ public function sendDigitalPost(WebformSubmissionInterface $submission, array $handlerSettings, array $submissionData = []): array { $submissionData = $submissionData + $submission->getData(); @@ -136,7 +140,7 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h // Remove all non-digits from recipient identifier. $recipientIdentifier = preg_replace('/[^\d]+/', '', $recipientIdentifier); - /** @var \Drupal\os2web_datalookup\LookupResult\CprLookupResult|CompanyLookupResult|null $lookupResult */ + /** @var \Drupal\os2web_datalookup\LookupResult\CprLookupResult|\Drupal\os2web_datalookup\LookupResult\CompanyLookupResult|null $lookupResult */ $lookupResult = NULL; if (preg_match('/^\d{8}$/', $recipientIdentifier)) { @@ -173,7 +177,7 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], ]; - $message = $this->meMoHelper->buildMessage($submission, $messageOptions, $handlerSettings, $submissionData, $lookupResult); + $message = $this->meMoHelper->buildMessage($submission, $messageOptions, $handlerSettings, $lookupResult); $forsendelseOptions = [ self::RECIPIENT_IDENTIFIER_TYPE => $recipientIdentifierType, self::RECIPIENT_IDENTIFIER => $recipientIdentifier, @@ -185,7 +189,7 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], ]; - $forsendelse = $this->forsendelseHelper->buildForsendelse($submission, $forsendelseOptions, $handlerSettings, $submissionData, $lookupResult); + $forsendelse = $this->forsendelseHelper->buildForsendelse($submission, $forsendelseOptions, $handlerSettings, $lookupResult); $options = [ 'test_mode' => (bool) $this->settings->getTestMode(), @@ -212,16 +216,19 @@ public function loadSubmission(int $id): ?WebformSubmissionInterface { /** * Load queue. */ - private function loadQueue():QueueInterface { + private function loadQueue(): QueueInterface { $processingSettings = $this->settings->getProcessing(); - return $this->queueStorage->load($processingSettings['queue'] ?? 'os2forms_digital_post'); + /** @var \Drupal\advancedqueue\Entity\QueueInterface $queue */ + $queue = $this->queueStorage->load($processingSettings['queue'] ?? 'os2forms_digital_post'); + + return $queue; } /** * {@inheritdoc} */ - public function log($level, $message, array $context = []) { + public function log($level, $message, array $context = []): void { $this->logger->log($level, $message, $context); // @see https://www.drupal.org/node/3020595 if (isset($context['webform_submission']) && $context['webform_submission'] instanceof WebformSubmissionInterface) { @@ -233,6 +240,8 @@ public function log($level, $message, array $context = []) { * Create a job. * * @see self::processJob() + * + * @phpstan-param array $handlerConfiguration */ public function createJob(WebformSubmissionInterface $webformSubmission, array $handlerConfiguration): ?Job { $context = [ @@ -291,7 +300,7 @@ public function processJob(Job $job): JobResult { $this->notice('Digital post sent', [ 'handler_id' => 'os2forms_digital_post', 'operation' => 'digital post send', - 'webform_submission' => $submission ?? NULL, + 'webform_submission' => $submission, ]); return JobResult::success(); @@ -301,7 +310,6 @@ public function processJob(Job $job): JobResult { '@message' => $e->getMessage(), 'handler_id' => 'os2forms_digital_post', 'operation' => 'digital post send', - 'webform_submission' => $submission ?? NULL, ]); return JobResult::failure($e->getMessage()); @@ -310,8 +318,10 @@ public function processJob(Job $job): JobResult { /** * Process Beskedfordeler data. + * + * @phpstan-param array $data */ - public function processBeskedfordelerData(int $submissionId, array $data) { + public function processBeskedfordelerData(int $submissionId, array $data): void { $webformSubmission = $this->loadSubmission($submissionId); if (NULL !== $webformSubmission) { $context = [ @@ -342,8 +352,10 @@ public function processBeskedfordelerData(int $submissionId, array $data) { * Proxy for BeskedfordelerHelper::deleteMessages(). * * @see BeskedfordelerHelper::deleteMessages() + * + * @phpstan-param array $webformSubmissions */ - public function deleteMessages(array $webformSubmissions) { + public function deleteMessages(array $webformSubmissions): void { $this->beskedfordelerHelper->deleteMessages($webformSubmissions); } diff --git a/src/Manager/TemplateManager.php b/src/Manager/TemplateManager.php index 048a387..06ee062 100644 --- a/src/Manager/TemplateManager.php +++ b/src/Manager/TemplateManager.php @@ -62,6 +62,8 @@ public function getAvailableTemplates(): array { /** * {@inheritDoc} + * + * @phpstan-param array $context */ public function renderHtml(string $template, array $context = []): string { @@ -73,6 +75,8 @@ public function renderHtml(string $template, array $context = []): string { /** * {@inheritDoc} + * + * @phpstan-param array $context */ public function renderPdf(string $template, array $context = [], bool $stream = FALSE): string { @@ -104,7 +108,7 @@ public function renderPdf(string $template, array $context = [], bool $stream = /** * Get path to base64encoded logo. */ - private function getPathToBase64EncodedLogo($template): string { + private function getPathToBase64EncodedLogo(string $template): string { $pathToLogo = $this->getPathToTemplate($template) . '/logo.png'; if (!file_exists($pathToLogo)) { diff --git a/src/Manager/TemplateManagerInterface.php b/src/Manager/TemplateManagerInterface.php index e1ba526..2471fcc 100644 --- a/src/Manager/TemplateManagerInterface.php +++ b/src/Manager/TemplateManagerInterface.php @@ -12,6 +12,8 @@ interface TemplateManagerInterface { * * @return array * List of available templates. + * + * @phpstan-return array */ public function getAvailableTemplates(): array; diff --git a/src/Model/Message.php b/src/Model/Message.php index 6b424fb..86ba422 100644 --- a/src/Model/Message.php +++ b/src/Model/Message.php @@ -46,7 +46,7 @@ class Message { /** * Called when using \PDO::FETCH_CLASS. */ - public function __set($name, $value) { + public function __set(string $name, mixed $value): void { $property = [ 'submission_id' => 'submissionId', 'message_uuid' => 'messageUUID', diff --git a/src/Plugin/AdvancedQueue/JobType/SendDigitalPost.php b/src/Plugin/AdvancedQueue/JobType/SendDigitalPost.php index bb909a3..a8cf919 100644 --- a/src/Plugin/AdvancedQueue/JobType/SendDigitalPost.php +++ b/src/Plugin/AdvancedQueue/JobType/SendDigitalPost.php @@ -17,7 +17,7 @@ * label = @Translation("Send digital post"), * ) */ -class SendDigitalPost extends JobTypeBase implements ContainerFactoryPluginInterface { +final class SendDigitalPost extends JobTypeBase implements ContainerFactoryPluginInterface { /** * The webform helper. * @@ -27,6 +27,8 @@ class SendDigitalPost extends JobTypeBase implements ContainerFactoryPluginInter /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( @@ -39,6 +41,8 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public function __construct( array $configuration, diff --git a/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php b/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php index a4d4589..6e10480 100644 --- a/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php +++ b/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php @@ -29,6 +29,8 @@ final class SendDigitalPostSF1601 extends JobTypeBase implements ContainerFactor /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( @@ -41,6 +43,8 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public function __construct( array $configuration, diff --git a/src/Plugin/WebformHandler/DigitalPostWebformHandler.php b/src/Plugin/WebformHandler/DigitalPostWebformHandler.php index 543472d..cc04d5f 100644 --- a/src/Plugin/WebformHandler/DigitalPostWebformHandler.php +++ b/src/Plugin/WebformHandler/DigitalPostWebformHandler.php @@ -24,7 +24,7 @@ * submission = \Drupal\webform\Plugin\WebformHandlerInterface::SUBMISSION_REQUIRED, * ) */ -class DigitalPostWebformHandler extends WebformHandlerBase { +final class DigitalPostWebformHandler extends WebformHandlerBase { /** * Maximum length of title on digital post document. * @@ -42,6 +42,8 @@ class DigitalPostWebformHandler extends WebformHandlerBase { /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { $instance = new static($configuration, $plugin_id, $plugin_definition); @@ -60,8 +62,10 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} + * + * @phpstan-return array */ - public function defaultConfiguration() { + public function defaultConfiguration(): array { return [ 'message' => 'This is a custom message.', 'debug' => FALSE, @@ -70,8 +74,11 @@ public function defaultConfiguration() { /** * {@inheritdoc} + * + * @phpstan-param array $form + * @phpstan-return array */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { + public function buildConfigurationForm(array $form, FormStateInterface $form_state): array { $this->getLogger()->debug('This was the form: ' . print_r($this->getWebform()->getElementsDecoded(), TRUE)); $availableElements = $this->getAvailableElements($this->getWebform()->getElementsDecoded()); @@ -156,6 +163,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta /** * Get available elements. + * + * @phpstan-param array $elements + * @phpstan-return array */ private function getAvailableElements(array $elements): array { $availableElements = []; @@ -178,8 +188,10 @@ private function getAvailableElements(array $elements): array { /** * {@inheritdoc} + * + * @phpstan-param array $form */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { + public function submitConfigurationForm(array &$form, FormStateInterface $form_state): void { parent::submitConfigurationForm($form, $form_state); $this->configuration['channel'] = $form_state->getValue('channel'); $this->configuration['priority'] = $form_state->getValue('priority'); @@ -192,29 +204,37 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s /** * {@inheritdoc} + * + * @phpstan-param array $elements */ - public function alterElements(array &$elements, WebformInterface $webform) { + public function alterElements(array &$elements, WebformInterface $webform): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} + * + * @phpstan-param array $settings */ - public function overrideSettings(array &$settings, WebformSubmissionInterface $webform_submission) { + public function overrideSettings(array &$settings, WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} + * + * @phpstan-param array $form */ - public function alterForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) { + public function alterForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} + * + * @phpstan-param array $form */ - public function validateForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) { + public function validateForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); if ($value = $form_state->getValue('element')) { $form_state->setErrorByName('element', $this->t('The element must be empty. You entered %value.', ['%value' => $value])); @@ -223,64 +243,68 @@ public function validateForm(array &$form, FormStateInterface $form_state, Webfo /** * {@inheritdoc} + * + * @phpstan-param array $form */ - public function submitForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) { + public function submitForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} + * + * @phpstan-param array $form */ - public function confirmForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) { + public function confirmForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function preCreate(array &$values) { + public function preCreate(array &$values): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function postCreate(WebformSubmissionInterface $webform_submission) { + public function postCreate(WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function postLoad(WebformSubmissionInterface $webform_submission) { + public function postLoad(WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function preDelete(WebformSubmissionInterface $webform_submission) { + public function preDelete(WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function postDelete(WebformSubmissionInterface $webform_submission) { + public function postDelete(WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function preSave(WebformSubmissionInterface $webform_submission) { + public function preSave(WebformSubmissionInterface $webform_submission): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) { + public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE): void { $queueStorage = $this->entityTypeManager->getStorage('advancedqueue_queue'); /** @var \Drupal\advancedqueue\Entity\Queue $queue */ $queue = $queueStorage->load('os2forms_digital_post'); @@ -294,50 +318,59 @@ public function postSave(WebformSubmissionInterface $webform_submission, $update /** * {@inheritdoc} + * + * @phpstan-param array $variables */ - public function preprocessConfirmation(array &$variables) { + public function preprocessConfirmation(array &$variables): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function createHandler() { + public function createHandler(): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function updateHandler() { + public function updateHandler(): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} */ - public function deleteHandler() { + public function deleteHandler(): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} + * + * @phpstan-param array $element */ - public function createElement($key, array $element) { + public function createElement($key, array $element): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} + * + * @phpstan-param array $element + * @phpstan-param array $original_element */ - public function updateElement($key, array $element, array $original_element) { + public function updateElement($key, array $element, array $original_element): void { $this->debug(__FUNCTION__); } /** * {@inheritdoc} + * + * @phpstan-param array $element */ - public function deleteElement($key, array $element) { + public function deleteElement($key, array $element): void { $this->debug(__FUNCTION__); } @@ -349,7 +382,7 @@ public function deleteElement($key, array $element) { * @param string $context1 * Additional parameter passed to the invoked method name. */ - protected function debug($method_name, $context1 = NULL) { + protected function debug($method_name, $context1 = NULL): void { if (!empty($this->configuration['debug'])) { $t_args = [ '@id' => $this->getHandlerId(), diff --git a/src/Plugin/WebformHandler/WebformHandlerSF1601.php b/src/Plugin/WebformHandler/WebformHandlerSF1601.php index 824a27b..667368d 100644 --- a/src/Plugin/WebformHandler/WebformHandlerSF1601.php +++ b/src/Plugin/WebformHandler/WebformHandlerSF1601.php @@ -50,6 +50,8 @@ final class WebformHandlerSF1601 extends WebformHandlerBase { /** * {@inheritdoc} + * + * @phpstan-param array $configuration */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { $instance = new static($configuration, $plugin_id, $plugin_definition); @@ -69,6 +71,8 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} + * + * @phpstan-return array */ public function defaultConfiguration() { return [ @@ -78,6 +82,9 @@ public function defaultConfiguration() { /** * {@inheritdoc} + * + * @phpstan-param array $form + * @phpstan-return array */ public function buildConfigurationForm(array $form, FormStateInterface $formState) { $form[self::MEMO_MESSAGE] = [ @@ -198,6 +205,8 @@ public function buildConfigurationForm(array $form, FormStateInterface $formStat /** * Get recipient elements. + * + * @phpstan-return array */ private function getRecipientElements(): array { $elements = $this->getWebform()->getElementsDecodedAndFlattened(); @@ -228,6 +237,8 @@ static function (array $element) use ($elementTypes) { /** * Get attachment elements. + * + * @phpstan-return array */ private function getAttachmentElements(): array { $elements = $this->getWebform()->getElementsDecodedAndFlattened(); @@ -250,6 +261,9 @@ static function (array $element) use ($elementTypes) { /** * {@inheritdoc} + * + * @phpstan-param array $form + * @phpstan-return void */ public function validateConfigurationForm(array &$form, FormStateInterface $formState) { $actions = $formState->getValue(self::MEMO_ACTIONS)['actions'] ?? []; @@ -281,6 +295,9 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form /** * {@inheritdoc} + * + * @phpstan-param array $form + * @phpstan-return void */ public function submitConfigurationForm(array &$form, FormStateInterface $formState) { parent::submitConfigurationForm($form, $formState); @@ -301,6 +318,8 @@ static function (array $action) { /** * {@inheritdoc} + * + * @phpstan-return void */ public function postSave(WebformSubmissionInterface $webformSubmission, $update = TRUE) { $this->helper->createJob($webformSubmission, $this->configuration); @@ -308,6 +327,8 @@ public function postSave(WebformSubmissionInterface $webformSubmission, $update /** * {@inheritdoc} + * + * @phpstan-return void */ public function postDelete(WebformSubmissionInterface $webformSubmission) { $this->helper->deleteMessages([$webformSubmission]); @@ -315,52 +336,36 @@ public function postDelete(WebformSubmissionInterface $webformSubmission) { /** * {@inheritdoc} + * + * @phpstan-return void */ public function postPurge(array $webformSubmissions) { $this->helper->deleteMessages($webformSubmissions); } - /** - * Display the invoked plugin method to end user. - * - * @param string $method_name - * The invoked method name. - * @param string $context1 - * Additional parameter passed to the invoked method name. - */ - protected function debug($method_name, $context1 = NULL) { - if (!empty($this->configuration['debug'])) { - $t_args = [ - '@id' => $this->getHandlerId(), - '@class_name' => get_class($this), - '@method_name' => $method_name, - '@context1' => $context1, - ]; - $this->messenger()->addWarning($this->t('Invoked @id: @class_name:@method_name @context1', $t_args), TRUE); - } - } - /** * Translated action names. * * @var array|null + * + * @phpstan-var array */ private ?array $translatedActionNames = NULL; /** * Get translated action name. */ - private function getTranslatedActionName(string $action) { + private function getTranslatedActionName(string $action): string { if (NULL === $this->translatedActionNames) { $this->translatedActionNames = [ - SF1601::ACTION_AFTALE => $this->t('Aftale', [], ['context' => 'memo action']), - SF1601::ACTION_BEKRAEFT => $this->t('Bekræft', [], ['context' => 'memo action']), - SF1601::ACTION_BETALING => $this->t('Betaling', [], ['context' => 'memo action']), - SF1601::ACTION_FORBEREDELSE => $this->t('Forberedelse', [], ['context' => 'memo action']), - SF1601::ACTION_INFORMATION => $this->t('Information', [], ['context' => 'memo action']), - SF1601::ACTION_SELVBETJENING => $this->t('Selvbetjening', [], ['context' => 'memo action']), - SF1601::ACTION_TILMELDING => $this->t('Tilmelding', [], ['context' => 'memo action']), - SF1601::ACTION_UNDERSKRIV => $this->t('Underskriv', [], ['context' => 'memo action']), + SF1601::ACTION_AFTALE => (string) $this->t('Aftale', [], ['context' => 'memo action']), + SF1601::ACTION_BEKRAEFT => (string) $this->t('Bekræft', [], ['context' => 'memo action']), + SF1601::ACTION_BETALING => (string) $this->t('Betaling', [], ['context' => 'memo action']), + SF1601::ACTION_FORBEREDELSE => (string) $this->t('Forberedelse', [], ['context' => 'memo action']), + SF1601::ACTION_INFORMATION => (string) $this->t('Information', [], ['context' => 'memo action']), + SF1601::ACTION_SELVBETJENING => (string) $this->t('Selvbetjening', [], ['context' => 'memo action']), + SF1601::ACTION_TILMELDING => (string) $this->t('Tilmelding', [], ['context' => 'memo action']), + SF1601::ACTION_UNDERSKRIV => (string) $this->t('Underskriv', [], ['context' => 'memo action']), ]; } From a80adbe54e63784b0d3c3ba585bd5d47fcb3b3a2 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 9 May 2023 16:26:58 +0200 Subject: [PATCH 11/26] FORMS-821: Fixed service arguments --- os2forms_digital_post.services.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os2forms_digital_post.services.yml b/os2forms_digital_post.services.yml index 2f83153..30e7d93 100644 --- a/os2forms_digital_post.services.yml +++ b/os2forms_digital_post.services.yml @@ -31,12 +31,12 @@ services: Drupal\os2forms_digital_post\Helper\MeMoHelper: arguments: - - "@plugin.manager.element_info" + - "@plugin.manager.webform.element" - "@webform.token_manager" Drupal\os2forms_digital_post\Helper\ForsendelseHelper: arguments: - - "@plugin.manager.element_info" + - "@plugin.manager.webform.element" - "@webform.token_manager" Drupal\os2forms_digital_post\Helper\WebformHelperSF1601: From 491189562763b70788431d54c3924455640846c7 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 9 May 2023 16:27:09 +0200 Subject: [PATCH 12/26] FORMS-821: Updated change log --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 567d070..a4cb7f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Changed composer name to `os2forms/os2forms_digital_post` [PR-47](https://github.com/itk-dev/os2forms_digital_post/pull/47) -- Changed dependency on CPR and CVR lookup modules. +- Changed dependency on CPR and CVR lookup modules. Handled physical post + (“forsendelse”) + [PR-37](https://github.com/itk-dev/os2forms_digital_post/pull/37) ## [2.0.1] From 9aeaf644037d767bf0c7d669cee7c298b42c3da4 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 9 May 2023 14:14:10 +0200 Subject: [PATCH 13/26] FORMS-821: Added code analysis to workflow --- .github/workflows/pr.yaml | 110 ++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 57 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index bd5c775..eab071e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -84,68 +84,64 @@ jobs: composer coding-standards-check/phpcs # @todo Make this work! - # php-code-analysis: - # name: PHP code analysis - # runs-on: ubuntu-latest - # strategy: - # matrix: - # php-versions: [ '8.1' ] - # dependency-version: [ prefer-stable ] - # steps: - # - uses: actions/checkout@master - # - name: Setup PHP, with composer and extensions - # uses: shivammathur/setup-php@v2 - # with: - # php-version: ${{ matrix.php-versions }} - # extensions: json, gd - # coverage: none - # tools: composer:v2 - # # https://github.com/shivammathur/setup-php#cache-composer-dependencies - # - name: Get composer cache directory - # id: composer-cache - # run: echo "::set-output name=dir::$(composer config cache-files-dir)" - # - name: Cache dependencies - # uses: actions/cache@v2 - # with: - # path: ${{ steps.composer-cache.outputs.dir }} - # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - # restore-keys: ${{ runner.os }}-composer- - # - name: drupal-check - # run: | - # # We need a Drupal project to run drupal-check (cf. https://github.com/mglaman/drupal-check#usage) - # # Install Drupal - # composer --no-interaction create-project drupal/recommended-project:^9 drupal - # # Copy our module source code into the Drupal module folder. - # mkdir -p drupal/web/modules/contrib/os2forms_digital_post - # cp -r os2forms_digital_post.* composer.json src drupal/web/modules/contrib/os2forms_digital_post - - # composer --working-dir=drupal --no-interaction config minimum-stability dev + php-code-analysis: + name: PHP code analysis + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [ '8.1' ] + dependency-version: [ prefer-stable ] + steps: + - uses: actions/checkout@master + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: json, gd + coverage: none + tools: composer:v2 + # https://github.com/shivammathur/setup-php#cache-composer-dependencies + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: drupal-check + run: | + # We need a Drupal project to run drupal-check (cf. https://github.com/mglaman/drupal-check#usage) + # Install Drupal + composer --no-interaction create-project drupal/recommended-project:^9 drupal + # Copy our module source code into the Drupal module folder. + mkdir -p drupal/web/modules/contrib/os2forms_digital_post + rsync --archive --compress --cvs-exclude . --exclude drupal drupal/web/modules/contrib/os2forms_digital_post - # # Add repositories from our composer.json (which see). - # # @see https://getcomposer.org/doc/03-cli.md#modifying-repositories - # composer --working-dir=drupal --no-interaction config repositories.drupal/webform_embed "$(composer config repositories.drupal/webform_embed)" + composer --working-dir=drupal --no-interaction config minimum-stability dev - # # Allow plugins - # composer --working-dir=drupal config --no-plugins allow-plugins.vaimo/composer-patches true - # composer --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true + # Allow plugins + composer --working-dir=drupal config --no-plugins allow-plugins.vaimo/composer-patches true + composer --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true - # # Add our module as a composer repository. - # composer --working-dir=drupal --no-interaction config --append repositories.itk-dev/os2forms_digital_post path web/modules/contrib/os2forms_digital_post - # # Restore Drupal composer repository. - # # composer --working-dir=drupal --no-interaction config --append repositories.drupal composer https://packages.drupal.org/8 + # Add our module as a composer repository. + composer --working-dir=drupal --no-interaction config --append repositories.itk-dev/os2forms_digital_post path web/modules/contrib/os2forms_digital_post + # Restore Drupal composer repository. + # composer --working-dir=drupal --no-interaction config --append repositories.drupal composer https://packages.drupal.org/8 - # # Require our module. - # composer --working-dir=drupal --no-interaction require 'itk-dev/os2forms_digital_post:*' + # Require our module. + composer --working-dir=drupal --no-interaction require 'itk-dev/os2forms_digital_post:*' - # # Check code - # composer --working-dir=drupal --no-interaction require --dev drupal/core-dev - # cd drupal/web/modules/contrib/os2forms_digital_post - # # Remove our non-dev dependencies to prevent duplicated Drupal installation - # # PHP Fatal error: Cannot redeclare drupal_get_filename() (previously declared in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/modules/contrib/os2forms_digital_post/vendor/drupal/core/includes/bootstrap.inc:190) in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/core/includes/bootstrap.inc on line 190 - # # Use sed to remove the "require" property in composer.json - # sed -i '/^\s*"require":/,/^\s*}/d' composer.json - # composer --no-interaction install - # composer code-analysis + # Check code + composer --working-dir=drupal --no-interaction require --dev drupal/core-dev + cd drupal/web/modules/contrib/os2forms_digital_post + # Remove our non-dev dependencies to prevent duplicated Drupal installation + # PHP Fatal error: Cannot redeclare drupal_get_filename() (previously declared in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/modules/contrib/os2forms_digital_post/vendor/drupal/core/includes/bootstrap.inc:190) in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/core/includes/bootstrap.inc on line 190 + # Use sed to remove the "require" property in composer.json + sed -i '/^\s*"require":/,/^\s*}/d' composer.json + composer --no-interaction install + composer code-analysis markdown-coding-standards: runs-on: ubuntu-20.04 From 05465933b1d3bb31200a990644821685d061692d Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 9 May 2023 23:22:31 +0200 Subject: [PATCH 14/26] FORMS-821: Added missing requirement --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index d83dd7e..b66ba0d 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "ext-soap": "*", "dompdf/dompdf": "^2.0", "drupal/webform": "^6.0", + "drush/drush": "^10 || ^11", "http-interop/http-factory-guzzle": "^1.0.0", "itk-dev/beskedfordeler-drupal": "^1.0", "itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5", From bd4c08f0e1fa68925394df0dbd8abac12688e267 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 9 May 2023 23:24:27 +0200 Subject: [PATCH 15/26] FORMS-821: Added code analysis to workflow --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index eab071e..532977a 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -117,7 +117,7 @@ jobs: composer --no-interaction create-project drupal/recommended-project:^9 drupal # Copy our module source code into the Drupal module folder. mkdir -p drupal/web/modules/contrib/os2forms_digital_post - rsync --archive --compress --cvs-exclude . --exclude drupal drupal/web/modules/contrib/os2forms_digital_post + rsync --archive --compress . --exclude drupal --exclude .git drupal/web/modules/contrib/os2forms_digital_post composer --working-dir=drupal --no-interaction config minimum-stability dev @@ -134,7 +134,7 @@ jobs: composer --working-dir=drupal --no-interaction require 'itk-dev/os2forms_digital_post:*' # Check code - composer --working-dir=drupal --no-interaction require --dev drupal/core-dev + # composer --working-dir=drupal --no-interaction require --dev drupal/core-dev cd drupal/web/modules/contrib/os2forms_digital_post # Remove our non-dev dependencies to prevent duplicated Drupal installation # PHP Fatal error: Cannot redeclare drupal_get_filename() (previously declared in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/modules/contrib/os2forms_digital_post/vendor/drupal/core/includes/bootstrap.inc:190) in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/core/includes/bootstrap.inc on line 190 From 364103b150dee0e4048c7cc254afffae7bd65098 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 9 May 2023 23:53:27 +0200 Subject: [PATCH 16/26] FORMS-821: Removed code analysis from workflow --- .github/workflows/pr.yaml | 106 +++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 532977a..7bcc048 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -84,64 +84,64 @@ jobs: composer coding-standards-check/phpcs # @todo Make this work! - php-code-analysis: - name: PHP code analysis - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: [ '8.1' ] - dependency-version: [ prefer-stable ] - steps: - - uses: actions/checkout@master - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: json, gd - coverage: none - tools: composer:v2 - # https://github.com/shivammathur/setup-php#cache-composer-dependencies - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - name: drupal-check - run: | - # We need a Drupal project to run drupal-check (cf. https://github.com/mglaman/drupal-check#usage) - # Install Drupal - composer --no-interaction create-project drupal/recommended-project:^9 drupal - # Copy our module source code into the Drupal module folder. - mkdir -p drupal/web/modules/contrib/os2forms_digital_post - rsync --archive --compress . --exclude drupal --exclude .git drupal/web/modules/contrib/os2forms_digital_post + # php-code-analysis: + # name: PHP code analysis + # runs-on: ubuntu-latest + # strategy: + # matrix: + # php-versions: [ '8.1' ] + # dependency-version: [ prefer-stable ] + # steps: + # - uses: actions/checkout@master + # - name: Setup PHP, with composer and extensions + # uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php-versions }} + # extensions: json, gd + # coverage: none + # tools: composer:v2 + # # https://github.com/shivammathur/setup-php#cache-composer-dependencies + # - name: Get composer cache directory + # id: composer-cache + # run: echo "::set-output name=dir::$(composer config cache-files-dir)" + # - name: Cache dependencies + # uses: actions/cache@v2 + # with: + # path: ${{ steps.composer-cache.outputs.dir }} + # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + # restore-keys: ${{ runner.os }}-composer- + # - name: drupal-check + # run: | + # # We need a Drupal project to run drupal-check (cf. https://github.com/mglaman/drupal-check#usage) + # # Install Drupal + # composer --no-interaction create-project drupal/recommended-project:^9 drupal + # # Copy our module source code into the Drupal module folder. + # mkdir -p drupal/web/modules/contrib/os2forms_digital_post + # rsync --archive --compress . --exclude drupal --exclude .git drupal/web/modules/contrib/os2forms_digital_post - composer --working-dir=drupal --no-interaction config minimum-stability dev + # composer --working-dir=drupal --no-interaction config minimum-stability dev - # Allow plugins - composer --working-dir=drupal config --no-plugins allow-plugins.vaimo/composer-patches true - composer --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true + # # Allow plugins + # composer --working-dir=drupal config --no-plugins allow-plugins.vaimo/composer-patches true + # composer --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true - # Add our module as a composer repository. - composer --working-dir=drupal --no-interaction config --append repositories.itk-dev/os2forms_digital_post path web/modules/contrib/os2forms_digital_post - # Restore Drupal composer repository. - # composer --working-dir=drupal --no-interaction config --append repositories.drupal composer https://packages.drupal.org/8 + # # Add our module as a composer repository. + # composer --working-dir=drupal --no-interaction config --append repositories.itk-dev/os2forms_digital_post path web/modules/contrib/os2forms_digital_post + # # Restore Drupal composer repository. + # # composer --working-dir=drupal --no-interaction config --append repositories.drupal composer https://packages.drupal.org/8 - # Require our module. - composer --working-dir=drupal --no-interaction require 'itk-dev/os2forms_digital_post:*' + # # Require our module. + # composer --working-dir=drupal --no-interaction require 'itk-dev/os2forms_digital_post:*' - # Check code - # composer --working-dir=drupal --no-interaction require --dev drupal/core-dev - cd drupal/web/modules/contrib/os2forms_digital_post - # Remove our non-dev dependencies to prevent duplicated Drupal installation - # PHP Fatal error: Cannot redeclare drupal_get_filename() (previously declared in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/modules/contrib/os2forms_digital_post/vendor/drupal/core/includes/bootstrap.inc:190) in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/core/includes/bootstrap.inc on line 190 - # Use sed to remove the "require" property in composer.json - sed -i '/^\s*"require":/,/^\s*}/d' composer.json - composer --no-interaction install - composer code-analysis + # # Check code + # # composer --working-dir=drupal --no-interaction require --dev drupal/core-dev + # cd drupal/web/modules/contrib/os2forms_digital_post + # # Remove our non-dev dependencies to prevent duplicated Drupal installation + # # PHP Fatal error: Cannot redeclare drupal_get_filename() (previously declared in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/modules/contrib/os2forms_digital_post/vendor/drupal/core/includes/bootstrap.inc:190) in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/core/includes/bootstrap.inc on line 190 + # # Use sed to remove the "require" property in composer.json + # sed -i '/^\s*"require":/,/^\s*}/d' composer.json + # composer --no-interaction install + # composer code-analysis markdown-coding-standards: runs-on: ubuntu-20.04 From a73ba72ed71d9d00c6a341f74a5b7504e1da8099 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Thu, 20 Jul 2023 10:26:34 +0200 Subject: [PATCH 17/26] FORDRIF-167: Removed support for SF1600 --- .php-version | 2 +- CHANGELOG.md | 3 + README.md | 92 +- composer.json | 5 +- drush.services.yml | 6 - .../PrintService/ClassMap.php | 51 - .../PrintService/EnumType/FarveSHKodeType.php | 38 - .../PrintService/EnumType/KanalKodeType.php | 38 - .../PrintService/EnumType/KanalvalgType.php | 59 - .../EnumType/KuvertTypeKodeType.php | 45 - .../EnumType/KvitteringsTypeKodeType.php | 45 - .../EnumType/MeddelelseSvarTypeNavnType.php | 45 - .../EnumType/PostKategoriKodeType.php | 66 - .../PrintService/EnumType/PrioritetType.php | 38 - .../EnumType/SimplexDuplexKodeType.php | 38 - .../PrintService/ServiceType/Afsend.php | 47 - .../PrintService/ServiceType/Spoerg.php | 47 - .../StructType/AuthorityContextType.php | 63 - .../StructType/BilagSamlingType.php | 105 -- .../PrintService/StructType/BilagType.php | 452 ----- .../StructType/BrevSPBodyType.php | 127 -- .../StructType/CallContextType.php | 146 -- .../CountryIdentificationCodeType.php | 85 - .../StructType/DigitalPostParametreType.php | 259 --- .../StructType/DokumentParametreType.php | 155 -- .../PrintService/StructType/ErrorListType.php | 97 -- .../PrintService/StructType/ErrorType.php | 91 - .../PrintService/StructType/FejlType.php | 146 -- .../StructType/ForsendelseAfsenderType.php | 54 - .../StructType/ForsendelseIType.php | 413 ----- .../StructType/ForsendelseModtagerType.php | 85 - .../StructType/InvocationContextType.php | 310 ---- .../KanalUafhaengigeParametreIType.php | 350 ---- .../StructType/KontaktOplysningType.php | 1475 ----------------- .../StructType/MeddelelseFESDmetadataType.php | 183 -- .../MeddelelsesFormatObjektType.php | 64 - .../StructType/PostParametreType.php | 202 --- .../StructType/PrintAfsendBrevRequestType.php | 146 -- .../PrintAfsendBrevResponseType.php | 57 - .../StructType/PrintParametreType.php | 134 -- .../PrintSpoergTilmeldingRequestType.php | 146 -- .../PrintSpoergTilmeldingResponseType.php | 57 - .../StructType/ServiceplatformFaultType.php | 53 - .../StructType/SlutbrugerIdentitetType.php | 187 --- .../StructType/TilmeldingRequestType.php | 88 - .../StructType/TransaktionsParametreIType.php | 183 -- generated-sources/PrintService/tutorial.php | 49 - os2forms_digital_post.info.yml | 1 + os2forms_digital_post.services.yml | 18 - phpcs.xml.dist | 2 - phpstan.neon | 3 - .../PrintService/PrintServiceMsg.xsd | 50 - .../SF1600_EP_SP1-2/xsd/oio/Aa.xsd | 8 - .../SF1600_EP_SP1-2/xsd/oio/Afsendelse.xsd | 64 - .../xsd/oio/AfsendelseDatoTid.xsd | 5 - .../xsd/oio/AfsendelseIdentifikator.xsd | 13 - .../xsd/oio/AfsendelseModtager.xsd | 5 - .../xsd/oio/AfsendelseTilstandNavn.xsd | 11 - .../xsd/oio/AfsendelseURLreference.xsd | 5 - .../xsd/oio/AfsenderAdresse.xsd | 5 - .../xsd/oio/AfsenderSystemIdentifikator.xsd | 6 - .../xsd/oio/AllokeringsIdentifikator.xsd | 6 - .../SF1600_EP_SP1-2/xsd/oio/Bilag.xsd | 26 - .../xsd/oio/BilagIdentifikator.xsd | 9 - .../SF1600_EP_SP1-2/xsd/oio/BilagNavn.xsd | 9 - .../SF1600_EP_SP1-2/xsd/oio/BilagSamling.xsd | 10 - .../BilagSorteringsIndeksIdentifikator.xsd | 6 - .../SF1600_EP_SP1-2/xsd/oio/BrevDato.xsd | 6 - .../SF1600_EP_SP1-2/xsd/oio/BrugerNavn.xsd | 10 - .../xsd/oio/CPR_CompletePostalLabelText.xsd | 9 - .../CPR_PersonCivilRegistrationIdentifier.xsd | 40 - .../xsd/oio/CPRnummerIdentifikator.xsd | 7 - .../xsd/oio/CVR_CVRnumberIdentifier.xsd | 13 - .../xsd/oio/CVRnummerIdentifikator.xsd | 7 - .../SF1600_EP_SP1-2/xsd/oio/CallContext.xsd | 29 - .../SF1600_EP_SP1-2/xsd/oio/CoNavn.xsd | 8 - .../oio/DKCC_CountryIdentificationCode.xsd | 56 - .../xsd/oio/DKCC_DistrictName.xsd | 19 - .../DKCC_DistrictSubdivisionIdentifier.xsd | 14 - .../xsd/oio/DKCC_FloorIdentifier.xsd | 13 - ...DKCC_MailDeliverySublocationIdentifier.xsd | 14 - .../xsd/oio/DKCC_PostCodeIdentifier.xsd | 13 - .../xsd/oio/DKCC_PostOfficeBoxIdentifier.xsd | 17 - .../oio/DKCC_PostalAddressFifthLineText.xsd | 5 - .../oio/DKCC_PostalAddressFirstLineText.xsd | 5 - .../oio/DKCC_PostalAddressFourthLineText.xsd | 5 - .../oio/DKCC_PostalAddressSecondLineText.xsd | 5 - .../oio/DKCC_PostalAddressSixthLineText.xsd | 5 - .../oio/DKCC_PostalAddressThirdLineText.xsd | 5 - .../xsd/oio/DKCC_StreetBuildingIdentifier.xsd | 13 - .../xsd/oio/DKCC_StreetName.xsd | 14 - .../xsd/oio/DKCC_SuiteIdentifier.xsd | 14 - .../xsd/oio/DigitalPostParametre.xsd | 24 - .../xsd/oio/DokumentParametre.xsd | 18 - .../SF1600_EP_SP1-2/xsd/oio/EnhedTekst.xsd | 9 - .../xsd/oio/FESDaktoerIdentifikator.xsd | 5 - .../xsd/oio/FESDdokumentIdentifikator.xsd | 5 - .../xsd/oio/FESDsagIdentifikator.xsd | 5 - .../FESDsagsklassifikationIdentifikator.xsd | 5 - .../SF1600_EP_SP1-2/xsd/oio/FarveSHKode.xsd | 10 - .../SF1600_EP_SP1-2/xsd/oio/Fejl.xsd | 14 - .../xsd/oio/FejlIdentifikator.xsd | 9 - .../SF1600_EP_SP1-2/xsd/oio/FejlKode.xsd | 10 - .../SF1600_EP_SP1-2/xsd/oio/FejlTekst.xsd | 9 - .../xsd/oio/FejlbeskedTekst.xsd | 8 - .../SF1600_EP_SP1-2/xsd/oio/FilformatNavn.xsd | 9 - .../xsd/oio/ForsendelseAfsender.xsd | 10 - .../SF1600_EP_SP1-2/xsd/oio/ForsendelseI.xsd | 32 - .../xsd/oio/ForsendelseModtager.xsd | 12 - .../xsd/oio/ForsendelseStatus.xsd | 17 - .../xsd/oio/ForsendelseTypeIdentifikator.xsd | 7 - .../xsd/oio/HasteBrevIndikator.xsd | 6 - .../xsd/oio/ITST_PersonName.xsd | 10 - .../xsd/oio/IndholdStoerrelseMaal.xsd | 5 - ...InformationVedAdresseAendringIndikator.xsd | 6 - .../SF1600_EP_SP1-2/xsd/oio/KanalKode.xsd | 10 - .../xsd/oio/KanalUafhaengigeParametreI.xsd | 28 - .../xsd/oio/KontaktOplysning.xsd | 50 - .../xsd/oio/KonteringsGruppeTekst.xsd | 9 - .../xsd/oio/KuvertTypeKode.xsd | 11 - .../SF1600_EP_SP1-2/xsd/oio/Kvittering.xsd | 53 - .../xsd/oio/KvitteringsEmail.xsd | 8 - .../xsd/oio/KvitteringsTypeKode.xsd | 11 - .../xsd/oio/MIMEcontentIdentifikator.xsd | 5 - .../xsd/oio/MasseForsendelseIdentifikator.xsd | 13 - .../xsd/oio/MeddelelseAfsenderNavn.xsd | 9 - .../xsd/oio/MeddelelseFESDmetadata.xsd | 16 - .../xsd/oio/MeddelelseIdentifikator.xsd | 10 - .../xsd/oio/MeddelelseIndholdData.xsd | 5 - .../xsd/oio/MeddelelseIndholdURLreference.xsd | 5 - .../MeddelelseIndholdstypeIdentifikator.xsd | 5 - .../xsd/oio/MeddelelseServicebeskedTekst.xsd | 9 - .../oio/MeddelelseSvarEmneIdentifikator.xsd | 5 - .../MeddelelseSvarPostkasseIdentifikator.xsd | 5 - .../xsd/oio/MeddelelseSvarTypeNavn.xsd | 11 - .../xsd/oio/MeddelelseTidsfristDato.xsd | 5 - .../xsd/oio/MeddelelseTidsfristTekst.xsd | 9 - .../xsd/oio/MeddelelseTitelTekst.xsd | 9 - .../xsd/oio/MeddelelseTraadIdentifikator.xsd | 5 - .../xsd/oio/MeddelelseTypeNavn.xsd | 10 - .../xsd/oio/MeddelelsesFormatObjekt.xsd | 9 - .../MedsendDokumentRegistreringIndikator.xsd | 4 - .../xsd/oio/ModtagerAdresse.xsd | 5 - .../oio/PaatrykAfsenderAdresseIndikator.xsd | 6 - .../xsd/oio/PaatrykBrevdatoIndikator.xsd | 4 - .../oio/PaatrykModtagerAdresseIndikator.xsd | 4 - .../xsd/oio/PostKategoriKode.xsd | 14 - .../SF1600_EP_SP1-2/xsd/oio/PostParametre.xsd | 20 - .../xsd/oio/PrintParametre.xsd | 16 - ...posthaandteringHosLeverandoerIndikator.xsd | 4 - .../SF1600_EP_SP1-2/xsd/oio/SideKvantitet.xsd | 9 - .../xsd/oio/SimplexDuplexKode.xsd | 10 - .../xsd/oio/SlutbrugerIdentitet.xsd | 12 - .../SF1600_EP_SP1-2/xsd/oio/StandardRetur.xsd | 15 - .../SF1600_EP_SP1-2/xsd/oio/StatusKode.xsd | 8 - .../xsd/oio/TilbagekaldFejlKode.xsd | 11 - .../xsd/oio/TilbagekaldFejlTekst.xsd | 10 - .../xsd/oio/TilbagekaldStatus.xsd | 20 - .../xsd/oio/TilbagekaldStatusKode.xsd | 14 - .../SF1600_EP_SP1-2/xsd/oio/TitelTekst.xsd | 6 - .../xsd/oio/TransaktionsDatoTid.xsd | 6 - .../xsd/oio/TransaktionsParametreI.xsd | 19 - .../SF1600_EP_SP1-2/xsd/oio/UUID.xsd | 9 - .../xsd/oio/UUIDIdentifikator.xsd | 6 - .../oio/VedhaeftSomIndholdDataIndikator.xsd | 6 - .../SF1600_EP_SP1-2/xsd/oio/Vedhaeftning.xsd | 40 - .../xsd/oio/VedhaeftningIndholdData.xsd | 5 - .../oio/VedhaeftningIndholdIdentifikator.xsd | 9 - .../oio/VedhaeftningIndholdURLreference.xsd | 5 - .../xsd/oio/VedhaeftningNavn.xsd | 9 - ...rindeligAfsenderCVRnummerIdentifikator.xsd | 7 - .../VedhaeftningOprindeligAfsenderNavn.xsd | 5 - .../VedhaeftningOprindeligModtagetDatoTid.xsd | 5 - .../xsd/oio/VedhaeftningSamling.xsd | 10 - .../xsd/oio/VedhaeftningSamlingKvantitet.xsd | 5 - .../xsd/oio/XKOM_EmailAddressIdentifier.xsd | 9 - .../PrintService/sp/AuthorityContext_1.xsd | 22 - .../PrintService/sp/CallContext_1.xsd | 38 - .../PrintService/sp/InvocationContext_1.xsd | 67 - .../sp/ServiceplatformFaultMessage_1.wsdl | 18 - .../sp/ServiceplatformFault_1.xsd | 27 - .../PrintService/sp/service.properties | 2 - .../wsdl/context/PrintService.wsdl | 103 -- .../PrintService/wsdl/context/policies.wsdl | 40 - .../PrintService/wsdl/token/PrintService.wsdl | 103 -- .../PrintService/wsdl/token/policies.wsdl | 83 - .../xsd/PrintServiceRequestTypes.xsd | 60 - src/Client/ClassMap.php | 51 - src/Client/EnumType/FarveSHKodeType.php | 38 - src/Client/EnumType/KanalKodeType.php | 38 - src/Client/EnumType/KanalvalgType.php | 59 - src/Client/EnumType/KuvertTypeKodeType.php | 45 - .../EnumType/KvitteringsTypeKodeType.php | 45 - .../EnumType/MeddelelseSvarTypeNavnType.php | 45 - src/Client/EnumType/PostKategoriKodeType.php | 66 - src/Client/EnumType/PrioritetType.php | 38 - src/Client/EnumType/SimplexDuplexKodeType.php | 38 - src/Client/ServiceType/Afsend.php | 47 - src/Client/ServiceType/Spoerg.php | 47 - .../StructType/AuthorityContextType.php | 63 - src/Client/StructType/BilagSamlingType.php | 105 -- src/Client/StructType/BilagType.php | 452 ----- src/Client/StructType/BrevSPBodyType.php | 127 -- src/Client/StructType/CallContextType.php | 146 -- .../CountryIdentificationCodeType.php | 85 - .../StructType/DigitalPostParametreType.php | 259 --- .../StructType/DokumentParametreType.php | 155 -- src/Client/StructType/ErrorListType.php | 97 -- src/Client/StructType/ErrorType.php | 91 - src/Client/StructType/FejlType.php | 146 -- .../StructType/ForsendelseAfsenderType.php | 54 - src/Client/StructType/ForsendelseIType.php | 413 ----- .../StructType/ForsendelseModtagerType.php | 85 - .../StructType/InvocationContextType.php | 310 ---- .../KanalUafhaengigeParametreIType.php | 350 ---- .../StructType/KontaktOplysningType.php | 1475 ----------------- .../StructType/MeddelelseFESDmetadataType.php | 183 -- .../MeddelelsesFormatObjektType.php | 64 - src/Client/StructType/PostParametreType.php | 202 --- .../StructType/PrintAfsendBrevRequestType.php | 146 -- .../PrintAfsendBrevResponseType.php | 57 - src/Client/StructType/PrintParametreType.php | 134 -- .../PrintSpoergTilmeldingRequestType.php | 146 -- .../PrintSpoergTilmeldingResponseType.php | 57 - .../StructType/ServiceplatformFaultType.php | 53 - .../StructType/SlutbrugerIdentitetType.php | 187 --- .../StructType/TilmeldingRequestType.php | 88 - .../StructType/TransaktionsParametreIType.php | 183 -- src/Commands/CreatePdf.php | 97 -- src/Consumer/PrintServiceConsumer.php | 356 ---- ...prElementNotFoundInSubmissionException.php | 10 - .../InvalidRecipientDataException.php | 10 - src/Helper/WebformHelper.php | 214 --- src/Manager/TemplateManager.php | 132 -- src/Manager/TemplateManagerInterface.php | 20 - .../AdvancedQueue/JobType/SendDigitalPost.php | 73 - .../DigitalPostWebformHandler.php | 397 ----- 237 files changed, 15 insertions(+), 16479 deletions(-) delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ClassMap.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/FarveSHKodeType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/KanalKodeType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/KanalvalgType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/KuvertTypeKodeType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/KvitteringsTypeKodeType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/MeddelelseSvarTypeNavnType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/PostKategoriKodeType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/PrioritetType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/SimplexDuplexKodeType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ServiceType/Afsend.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ServiceType/Spoerg.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/AuthorityContextType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BilagSamlingType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BilagType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BrevSPBodyType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/CallContextType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/CountryIdentificationCodeType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/DigitalPostParametreType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/DokumentParametreType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ErrorListType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ErrorType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/FejlType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseAfsenderType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseIType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseModtagerType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/InvocationContextType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/KanalUafhaengigeParametreIType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/KontaktOplysningType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/MeddelelseFESDmetadataType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/MeddelelsesFormatObjektType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PostParametreType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintAfsendBrevRequestType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintAfsendBrevResponseType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintParametreType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintSpoergTilmeldingRequestType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintSpoergTilmeldingResponseType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ServiceplatformFaultType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/SlutbrugerIdentitetType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/TilmeldingRequestType.php delete mode 100644 generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/TransaktionsParametreIType.php delete mode 100644 generated-sources/PrintService/tutorial.php delete mode 100644 resources/contracts/PrintService/PrintServiceMsg.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Aa.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Afsendelse.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseDatoTid.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseModtager.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseTilstandNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseURLreference.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsenderAdresse.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsenderSystemIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AllokeringsIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Bilag.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagSamling.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagSorteringsIndeksIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BrevDato.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BrugerNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPR_CompletePostalLabelText.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPR_PersonCivilRegistrationIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPRnummerIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CVR_CVRnumberIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CVRnummerIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CallContext.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CoNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_CountryIdentificationCode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_DistrictName.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_DistrictSubdivisionIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_FloorIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_MailDeliverySublocationIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostCodeIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostOfficeBoxIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFifthLineText.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFirstLineText.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFourthLineText.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressSecondLineText.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressSixthLineText.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressThirdLineText.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_StreetBuildingIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_StreetName.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_SuiteIdentifier.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DigitalPostParametre.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DokumentParametre.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/EnhedTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDaktoerIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDdokumentIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDsagIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDsagsklassifikationIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FarveSHKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Fejl.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlbeskedTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FilformatNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseAfsender.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseI.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseModtager.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseStatus.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseTypeIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/HasteBrevIndikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ITST_PersonName.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/IndholdStoerrelseMaal.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/InformationVedAdresseAendringIndikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KanalKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KanalUafhaengigeParametreI.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KontaktOplysning.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KonteringsGruppeTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KuvertTypeKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Kvittering.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KvitteringsEmail.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KvitteringsTypeKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MIMEcontentIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MasseForsendelseIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseAfsenderNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseFESDmetadata.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdData.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdURLreference.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdstypeIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseServicebeskedTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarEmneIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarPostkasseIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarTypeNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTidsfristDato.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTidsfristTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTitelTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTraadIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTypeNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelsesFormatObjekt.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MedsendDokumentRegistreringIndikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ModtagerAdresse.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykAfsenderAdresseIndikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykBrevdatoIndikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykModtagerAdresseIndikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PostKategoriKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PostParametre.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PrintParametre.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ReturposthaandteringHosLeverandoerIndikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SideKvantitet.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SimplexDuplexKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SlutbrugerIdentitet.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/StandardRetur.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/StatusKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldFejlKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldFejlTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldStatus.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldStatusKode.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TitelTekst.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TransaktionsDatoTid.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TransaktionsParametreI.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/UUID.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/UUIDIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftSomIndholdDataIndikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Vedhaeftning.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdData.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdURLreference.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligAfsenderCVRnummerIdentifikator.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligAfsenderNavn.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligModtagetDatoTid.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningSamling.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningSamlingKvantitet.xsd delete mode 100644 resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/XKOM_EmailAddressIdentifier.xsd delete mode 100644 resources/contracts/PrintService/sp/AuthorityContext_1.xsd delete mode 100644 resources/contracts/PrintService/sp/CallContext_1.xsd delete mode 100644 resources/contracts/PrintService/sp/InvocationContext_1.xsd delete mode 100644 resources/contracts/PrintService/sp/ServiceplatformFaultMessage_1.wsdl delete mode 100644 resources/contracts/PrintService/sp/ServiceplatformFault_1.xsd delete mode 100644 resources/contracts/PrintService/sp/service.properties delete mode 100644 resources/contracts/PrintService/wsdl/context/PrintService.wsdl delete mode 100644 resources/contracts/PrintService/wsdl/context/policies.wsdl delete mode 100644 resources/contracts/PrintService/wsdl/token/PrintService.wsdl delete mode 100644 resources/contracts/PrintService/wsdl/token/policies.wsdl delete mode 100644 resources/contracts/PrintService/xsd/PrintServiceRequestTypes.xsd delete mode 100644 src/Client/ClassMap.php delete mode 100644 src/Client/EnumType/FarveSHKodeType.php delete mode 100644 src/Client/EnumType/KanalKodeType.php delete mode 100644 src/Client/EnumType/KanalvalgType.php delete mode 100644 src/Client/EnumType/KuvertTypeKodeType.php delete mode 100644 src/Client/EnumType/KvitteringsTypeKodeType.php delete mode 100644 src/Client/EnumType/MeddelelseSvarTypeNavnType.php delete mode 100644 src/Client/EnumType/PostKategoriKodeType.php delete mode 100644 src/Client/EnumType/PrioritetType.php delete mode 100644 src/Client/EnumType/SimplexDuplexKodeType.php delete mode 100644 src/Client/ServiceType/Afsend.php delete mode 100644 src/Client/ServiceType/Spoerg.php delete mode 100644 src/Client/StructType/AuthorityContextType.php delete mode 100644 src/Client/StructType/BilagSamlingType.php delete mode 100644 src/Client/StructType/BilagType.php delete mode 100644 src/Client/StructType/BrevSPBodyType.php delete mode 100644 src/Client/StructType/CallContextType.php delete mode 100644 src/Client/StructType/CountryIdentificationCodeType.php delete mode 100644 src/Client/StructType/DigitalPostParametreType.php delete mode 100644 src/Client/StructType/DokumentParametreType.php delete mode 100644 src/Client/StructType/ErrorListType.php delete mode 100644 src/Client/StructType/ErrorType.php delete mode 100644 src/Client/StructType/FejlType.php delete mode 100644 src/Client/StructType/ForsendelseAfsenderType.php delete mode 100644 src/Client/StructType/ForsendelseIType.php delete mode 100644 src/Client/StructType/ForsendelseModtagerType.php delete mode 100644 src/Client/StructType/InvocationContextType.php delete mode 100644 src/Client/StructType/KanalUafhaengigeParametreIType.php delete mode 100644 src/Client/StructType/KontaktOplysningType.php delete mode 100644 src/Client/StructType/MeddelelseFESDmetadataType.php delete mode 100644 src/Client/StructType/MeddelelsesFormatObjektType.php delete mode 100644 src/Client/StructType/PostParametreType.php delete mode 100644 src/Client/StructType/PrintAfsendBrevRequestType.php delete mode 100644 src/Client/StructType/PrintAfsendBrevResponseType.php delete mode 100644 src/Client/StructType/PrintParametreType.php delete mode 100644 src/Client/StructType/PrintSpoergTilmeldingRequestType.php delete mode 100644 src/Client/StructType/PrintSpoergTilmeldingResponseType.php delete mode 100644 src/Client/StructType/ServiceplatformFaultType.php delete mode 100644 src/Client/StructType/SlutbrugerIdentitetType.php delete mode 100644 src/Client/StructType/TilmeldingRequestType.php delete mode 100644 src/Client/StructType/TransaktionsParametreIType.php delete mode 100644 src/Commands/CreatePdf.php delete mode 100644 src/Consumer/PrintServiceConsumer.php delete mode 100644 src/Exception/CprElementNotFoundInSubmissionException.php delete mode 100644 src/Exception/InvalidRecipientDataException.php delete mode 100644 src/Helper/WebformHelper.php delete mode 100644 src/Manager/TemplateManager.php delete mode 100644 src/Manager/TemplateManagerInterface.php delete mode 100644 src/Plugin/AdvancedQueue/JobType/SendDigitalPost.php delete mode 100644 src/Plugin/WebformHandler/DigitalPostWebformHandler.php diff --git a/.php-version b/.php-version index 37722eb..b8eb026 100644 --- a/.php-version +++ b/.php-version @@ -1 +1 @@ -7.4 +8.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index a4cb7f4..1468fdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Removed +- Removed support for [SF-1600](https://digitaliseringskataloget.dk/integration/sf1600). + ### Added - Added the `CPR / Navn validering` element to allowed recipient element names diff --git a/README.md b/README.md index 9c9264e..b5abdaf 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,16 @@ Send Digital Post to danish citizens from a webform. This module uses the -[SF1600](https://digitaliseringskataloget.dk/integration/sf1600) service from +[SF1601](https://digitaliseringskataloget.dk/integration/sf1601) service from Serviceplatformen. Information and documentation can be obtained by following that link. +## Usage + +This module provides functionality for sending digital post to danish citizens. +A WebformHandler is provided that you can add to your webform, and if configured +it will send the submitted data as digital post. + ## Beskedfordeler endpoint This module provides an endpoint, @@ -72,76 +78,6 @@ drush advancedqueue:queue:list or go to `/admin/config/system/queues/jobs/os2forms_digital_post` for a graphical overview of jobs in the queue. --------------------------------------------------------------------------------- - - - - - - -# Obsolete documentation - -Add the following configuration: - -```php -$config['os2forms_digital_post'] = [ - 'path_to_templates' => '', - - 'digital_post_system_id' => '', - 'digital_post_afsender_system' => '', - - 'digital_post_materiale_id' => '', - - 'digital_post_forsendelses_type' => '', - - 'azure_tenant_id' => '', - 'azure_application_id' => '', - 'azure_client_secret' => '', - - 'azure_key_vault_name' => '', - 'azure_key_vault_secret' => '', - 'azure_key_vault_secret_version' => '', - - 'service_agreement_uuid' => '', - 'user_system_uuid' => '', - 'user_uuid' => '', - - 'service_uuid' => 'fd885b8b-4a3f-46cb-b367-6c9dda1c78f6', - 'service_endpoint' => 'https://prod.serviceplatformen.dk/service/Print/Print/2', - 'service_contract' => dirname(DRUPAL_ROOT) . '/web/modules/contrib/os2forms_digital_post/resources/contracts/PrintService/wsdl/context/PrintService.wsdl', -]; - -``` - -## Templating / Styling the PDF -You'll need to provide a PDF template, that will be rendered when sending letters via digital post. -The template has to be in the twig format and accessible by this module. Configure the path to your templates -in the settings mentioned above. - -The following variables is present in the twig-template: -* logo - Path to the logo in your template. -* recipient - Which holds information about the recipient of the letter. -* elements - The elements submitted in the form. - -### Structure of template -Your template folder structure has to be as following: -```shell -/templates-root # Set this folder as "path_to_templates" in the settings. - /name-of-template - index.html.twig # The actual twig template. - logo.png # Logo - styles.css # The styles. Be aware that this module uses DomPDF to render the PDF, and therefore are submitted to the CSS rules defined in DomPDF. -``` - -## Usage - -This module provides functionality for sending digital post to danish citizens. -A WebformHandler is provided that you can add to your webform, and if configured -it will send the submitted data as digital post. - -This module provides functionality for querying the danish CPR register and -showing the result in webforms. - @@ -170,17 +106,3 @@ docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:lates docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app coding-standards-apply ``` - - - - - - -## Drush command - -A drush command is available for testing purposes. It creates a PDF from a template and a given submission. - -Read more: -```shell -drush os2forms_digital_post:create_pdf --help -``` diff --git a/composer.json b/composer.json index b66ba0d..c358775 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "os2forms/os2forms_digital_post", - "description": "Provides integration to Print service provided by Serviceplatformen.", + "description": "Provides integration to Afsend post service provided by Serviceplatformen.", "type": "drupal-module", "license": "MIT", "authors": [ @@ -22,8 +22,10 @@ "prefer-stable": true, "require": { "php": "^8.1", + "ext-dom": "*", "ext-soap": "*", "dompdf/dompdf": "^2.0", + "drupal/advancedqueue": "^1.0", "drupal/webform": "^6.0", "drush/drush": "^10 || ^11", "http-interop/http-factory-guzzle": "^1.0.0", @@ -33,7 +35,6 @@ "os2web/os2web_datalookup": "^1.5", "php-http/guzzle6-adapter": "^2.0", "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/property-access": "^4.4", "wsdltophp/packagebase": "^5.0" }, "autoload": { diff --git a/drush.services.yml b/drush.services.yml index a9a87c8..077e6e7 100644 --- a/drush.services.yml +++ b/drush.services.yml @@ -1,10 +1,4 @@ services: - os2forms_digital_post.commands: - class: \Drupal\os2forms_digital_post\Commands\CreatePdf - arguments: ['@os2forms_digital_post.webform_helper', '@os2forms_digital_post.template_manager', '@entity_type.manager'] - tags: - - { name: drush.command } - Drupal\os2forms_digital_post\Commands\CommandsSF1601: arguments: - '@Drupal\os2forms_digital_post\Helper\WebformHelperSF1601' diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ClassMap.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ClassMap.php deleted file mode 100644 index f2be373..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ClassMap.php +++ /dev/null @@ -1,51 +0,0 @@ - '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\InvocationContextType', - 'AuthorityContextType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\AuthorityContextType', - 'CallContextType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\CallContextType', - 'MeddelelsesFormatObjektType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\MeddelelsesFormatObjektType', - 'DokumentParametreType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\DokumentParametreType', - 'CountryIdentificationCodeType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\CountryIdentificationCodeType', - 'KontaktOplysningType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\KontaktOplysningType', - 'ForsendelseAfsenderType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\ForsendelseAfsenderType', - 'KanalUafhaengigeParametreIType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\KanalUafhaengigeParametreIType', - 'MeddelelseFESDmetadataType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\MeddelelseFESDmetadataType', - 'DigitalPostParametreType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\DigitalPostParametreType', - 'PostParametreType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\PostParametreType', - 'TransaktionsParametreIType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\TransaktionsParametreIType', - 'PrintParametreType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\PrintParametreType', - 'SlutbrugerIdentitetType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\SlutbrugerIdentitetType', - 'ForsendelseModtagerType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\ForsendelseModtagerType', - 'BilagType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\BilagType', - 'BilagSamlingType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\BilagSamlingType', - 'ForsendelseIType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\ForsendelseIType', - 'BrevSPBodyType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\BrevSPBodyType', - 'TilmeldingRequestType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\TilmeldingRequestType', - 'PrintAfsendBrevRequestType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\PrintAfsendBrevRequestType', - 'PrintAfsendBrevResponseType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\PrintAfsendBrevResponseType', - 'PrintSpoergTilmeldingRequestType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\PrintSpoergTilmeldingRequestType', - 'PrintSpoergTilmeldingResponseType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\PrintSpoergTilmeldingResponseType', - 'FejlType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\FejlType', - 'ServiceplatformFaultType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\ServiceplatformFaultType', - 'ErrorListType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\ErrorListType', - 'ErrorType' => '\\ItkDev\\OS2Forms_Digital_Post\\PrintService\\StructType\\ErrorType', - ]; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/FarveSHKodeType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/FarveSHKodeType.php deleted file mode 100644 index d02e7a5..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/EnumType/FarveSHKodeType.php +++ /dev/null @@ -1,38 +0,0 @@ -setResult($resultAfsendBrev = $this->getSoapClient()->__soapCall('afsendBrev', [ - $request, - ], [], [], $this->outputHeaders)); - - return $resultAfsendBrev; - } catch (SoapFault $soapFault) { - $this->saveLastError(__METHOD__, $soapFault); - - return false; - } - } - /** - * Returns the result - * @see AbstractSoapClientBase::getResult() - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintAfsendBrevResponseType - */ - public function getResult() - { - return parent::getResult(); - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ServiceType/Spoerg.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ServiceType/Spoerg.php deleted file mode 100644 index 108761a..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ServiceType/Spoerg.php +++ /dev/null @@ -1,47 +0,0 @@ -setResult($resultSpoergTilmelding = $this->getSoapClient()->__soapCall('spoergTilmelding', [ - $request, - ], [], [], $this->outputHeaders)); - - return $resultSpoergTilmelding; - } catch (SoapFault $soapFault) { - $this->saveLastError(__METHOD__, $soapFault); - - return false; - } - } - /** - * Returns the result - * @see AbstractSoapClientBase::getResult() - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintSpoergTilmeldingResponseType - */ - public function getResult() - { - return parent::getResult(); - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/AuthorityContextType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/AuthorityContextType.php deleted file mode 100644 index 5c722a7..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/AuthorityContextType.php +++ /dev/null @@ -1,63 +0,0 @@ -setMunicipalityCVR($municipalityCVR); - } - /** - * Get MunicipalityCVR value - * @return string - */ - public function getMunicipalityCVR(): string - { - return $this->MunicipalityCVR; - } - /** - * Set MunicipalityCVR value - * @param string $municipalityCVR - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType - */ - public function setMunicipalityCVR(string $municipalityCVR): self - { - // validation for constraint: string - if (!is_null($municipalityCVR) && !is_string($municipalityCVR)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($municipalityCVR, true), gettype($municipalityCVR)), __LINE__); - } - // validation for constraint: pattern([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) - if (!is_null($municipalityCVR) && !preg_match('/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/', $municipalityCVR)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/', var_export($municipalityCVR, true)), __LINE__); - } - $this->MunicipalityCVR = $municipalityCVR; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BilagSamlingType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BilagSamlingType.php deleted file mode 100644 index bfda73d..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BilagSamlingType.php +++ /dev/null @@ -1,105 +0,0 @@ -setBilag($bilag); - } - /** - * Get Bilag value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType[] - */ - public function getBilag(): array - { - return $this->Bilag; - } - /** - * This method is responsible for validating the values passed to the setBilag method - * This method is willingly generated in order to preserve the one-line inline validation within the setBilag method - * @param array $values - * @return string A non-empty message if the values does not match the validation rules - */ - public static function validateBilagForArrayConstraintsFromSetBilag(array $values = []): string - { - $message = ''; - $invalidValues = []; - foreach ($values as $bilagSamlingTypeBilagItem) { - // validation for constraint: itemType - if (!$bilagSamlingTypeBilagItem instanceof \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType) { - $invalidValues[] = is_object($bilagSamlingTypeBilagItem) ? get_class($bilagSamlingTypeBilagItem) : sprintf('%s(%s)', gettype($bilagSamlingTypeBilagItem), var_export($bilagSamlingTypeBilagItem, true)); - } - } - if (!empty($invalidValues)) { - $message = sprintf('The Bilag property can only contain items of type \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); - } - unset($invalidValues); - - return $message; - } - /** - * Set Bilag value - * @throws InvalidArgumentException - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType[] $bilag - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagSamlingType - */ - public function setBilag(array $bilag = []): self - { - // validation for constraint: array - if ('' !== ($bilagArrayErrorMessage = self::validateBilagForArrayConstraintsFromSetBilag($bilag))) { - throw new InvalidArgumentException($bilagArrayErrorMessage, __LINE__); - } - // validation for constraint: maxOccurs(100) - if (is_array($bilag) && count($bilag) > 100) { - throw new InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 100', count($bilag)), __LINE__); - } - $this->Bilag = $bilag; - - return $this; - } - /** - * Add item to Bilag value - * @throws InvalidArgumentException - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType $item - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagSamlingType - */ - public function addToBilag(\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType $item): self - { - // validation for constraint: itemType - if (!$item instanceof \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType) { - throw new InvalidArgumentException(sprintf('The Bilag property can only contain items of type \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); - } - // validation for constraint: maxOccurs(100) - if (is_array($this->Bilag) && count($this->Bilag) >= 100) { - throw new InvalidArgumentException(sprintf('You can\'t add anymore element to this property that already contains %s elements, the number of elements contained by the property must be less than or equal to 100', count($this->Bilag)), __LINE__); - } - $this->Bilag[] = $item; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BilagType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BilagType.php deleted file mode 100644 index 1ac4b03..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BilagType.php +++ /dev/null @@ -1,452 +0,0 @@ -setBilagNavn($bilagNavn) - ->setFilformatNavn($filformatNavn) - ->setBilagSorteringsIndeksIdentifikator($bilagSorteringsIndeksIdentifikator) - ->setBilagIdentifikator($bilagIdentifikator) - ->setVedhaeftningIndholdData($vedhaeftningIndholdData) - ->setVedhaeftningIndholdURLreference($vedhaeftningIndholdURLreference) - ->setVedhaeftSomIndholdDataIndikator($vedhaeftSomIndholdDataIndikator); - } - /** - * Get BilagNavn value - * @return string|null - */ - public function getBilagNavn(): ?string - { - return $this->BilagNavn; - } - /** - * Set BilagNavn value - * @param string $bilagNavn - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType - */ - public function setBilagNavn(?string $bilagNavn = null): self - { - // validation for constraint: string - if (!is_null($bilagNavn) && !is_string($bilagNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bilagNavn, true), gettype($bilagNavn)), __LINE__); - } - // validation for constraint: maxLength(300) - if (!is_null($bilagNavn) && mb_strlen((string) $bilagNavn) > 300) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 300', mb_strlen((string) $bilagNavn)), __LINE__); - } - $this->BilagNavn = $bilagNavn; - - return $this; - } - /** - * Get FilformatNavn value - * @return string|null - */ - public function getFilformatNavn(): ?string - { - return $this->FilformatNavn; - } - /** - * Set FilformatNavn value - * @param string $filformatNavn - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType - */ - public function setFilformatNavn(?string $filformatNavn = null): self - { - // validation for constraint: string - if (!is_null($filformatNavn) && !is_string($filformatNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($filformatNavn, true), gettype($filformatNavn)), __LINE__); - } - // validation for constraint: maxLength(10) - if (!is_null($filformatNavn) && mb_strlen((string) $filformatNavn) > 10) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 10', mb_strlen((string) $filformatNavn)), __LINE__); - } - $this->FilformatNavn = $filformatNavn; - - return $this; - } - /** - * Get BilagSorteringsIndeksIdentifikator value - * @return int|null - */ - public function getBilagSorteringsIndeksIdentifikator(): ?int - { - return $this->BilagSorteringsIndeksIdentifikator; - } - /** - * Set BilagSorteringsIndeksIdentifikator value - * @param int $bilagSorteringsIndeksIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType - */ - public function setBilagSorteringsIndeksIdentifikator(?int $bilagSorteringsIndeksIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($bilagSorteringsIndeksIdentifikator) && !(is_int($bilagSorteringsIndeksIdentifikator) || ctype_digit($bilagSorteringsIndeksIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($bilagSorteringsIndeksIdentifikator, true), gettype($bilagSorteringsIndeksIdentifikator)), __LINE__); - } - $this->BilagSorteringsIndeksIdentifikator = $bilagSorteringsIndeksIdentifikator; - - return $this; - } - /** - * Get BilagIdentifikator value - * @return string|null - */ - public function getBilagIdentifikator(): ?string - { - return isset($this->BilagIdentifikator) ? $this->BilagIdentifikator : null; - } - /** - * This method is responsible for validating the value passed to the setBilagIdentifikator method - * This method is willingly generated in order to preserve the one-line inline validation within the setBilagIdentifikator method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateBilagIdentifikatorForChoiceConstraintsFromSetBilagIdentifikator($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'VedhaeftningIndholdData', - 'VedhaeftningIndholdURLreference', - 'VedhaeftSomIndholdDataIndikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property BilagIdentifikator can\'t be set as the property %s is already set. Only one property must be set among these properties: BilagIdentifikator, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set BilagIdentifikator value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $bilagIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType - */ - public function setBilagIdentifikator(?string $bilagIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($bilagIdentifikator) && !is_string($bilagIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bilagIdentifikator, true), gettype($bilagIdentifikator)), __LINE__); - } - // validation for constraint: choice(BilagIdentifikator, VedhaeftningIndholdData, VedhaeftningIndholdURLreference, VedhaeftSomIndholdDataIndikator) - if ('' !== ($bilagIdentifikatorChoiceErrorMessage = self::validateBilagIdentifikatorForChoiceConstraintsFromSetBilagIdentifikator($bilagIdentifikator))) { - throw new InvalidArgumentException($bilagIdentifikatorChoiceErrorMessage, __LINE__); - } - // validation for constraint: maxLength(10) - if (!is_null($bilagIdentifikator) && mb_strlen((string) $bilagIdentifikator) > 10) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 10', mb_strlen((string) $bilagIdentifikator)), __LINE__); - } - if (is_null($bilagIdentifikator) || (is_array($bilagIdentifikator) && empty($bilagIdentifikator))) { - unset($this->BilagIdentifikator); - } else { - $this->BilagIdentifikator = $bilagIdentifikator; - } - - return $this; - } - /** - * Get VedhaeftningIndholdData value - * @return string|null - */ - public function getVedhaeftningIndholdData(): ?string - { - return isset($this->VedhaeftningIndholdData) ? $this->VedhaeftningIndholdData : null; - } - /** - * This method is responsible for validating the value passed to the setVedhaeftningIndholdData method - * This method is willingly generated in order to preserve the one-line inline validation within the setVedhaeftningIndholdData method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateVedhaeftningIndholdDataForChoiceConstraintsFromSetVedhaeftningIndholdData($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'BilagIdentifikator', - 'VedhaeftningIndholdURLreference', - 'VedhaeftSomIndholdDataIndikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property VedhaeftningIndholdData can\'t be set as the property %s is already set. Only one property must be set among these properties: VedhaeftningIndholdData, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set VedhaeftningIndholdData value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $vedhaeftningIndholdData - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType - */ - public function setVedhaeftningIndholdData(?string $vedhaeftningIndholdData = null): self - { - // validation for constraint: string - if (!is_null($vedhaeftningIndholdData) && !is_string($vedhaeftningIndholdData)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($vedhaeftningIndholdData, true), gettype($vedhaeftningIndholdData)), __LINE__); - } - // validation for constraint: choice(BilagIdentifikator, VedhaeftningIndholdData, VedhaeftningIndholdURLreference, VedhaeftSomIndholdDataIndikator) - if ('' !== ($vedhaeftningIndholdDataChoiceErrorMessage = self::validateVedhaeftningIndholdDataForChoiceConstraintsFromSetVedhaeftningIndholdData($vedhaeftningIndholdData))) { - throw new InvalidArgumentException($vedhaeftningIndholdDataChoiceErrorMessage, __LINE__); - } - if (is_null($vedhaeftningIndholdData) || (is_array($vedhaeftningIndholdData) && empty($vedhaeftningIndholdData))) { - unset($this->VedhaeftningIndholdData); - } else { - $this->VedhaeftningIndholdData = $vedhaeftningIndholdData; - } - - return $this; - } - /** - * Get VedhaeftningIndholdURLreference value - * @return string|null - */ - public function getVedhaeftningIndholdURLreference(): ?string - { - return isset($this->VedhaeftningIndholdURLreference) ? $this->VedhaeftningIndholdURLreference : null; - } - /** - * This method is responsible for validating the value passed to the setVedhaeftningIndholdURLreference method - * This method is willingly generated in order to preserve the one-line inline validation within the setVedhaeftningIndholdURLreference method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateVedhaeftningIndholdURLreferenceForChoiceConstraintsFromSetVedhaeftningIndholdURLreference($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'BilagIdentifikator', - 'VedhaeftningIndholdData', - 'VedhaeftSomIndholdDataIndikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property VedhaeftningIndholdURLreference can\'t be set as the property %s is already set. Only one property must be set among these properties: VedhaeftningIndholdURLreference, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set VedhaeftningIndholdURLreference value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $vedhaeftningIndholdURLreference - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType - */ - public function setVedhaeftningIndholdURLreference(?string $vedhaeftningIndholdURLreference = null): self - { - // validation for constraint: string - if (!is_null($vedhaeftningIndholdURLreference) && !is_string($vedhaeftningIndholdURLreference)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($vedhaeftningIndholdURLreference, true), gettype($vedhaeftningIndholdURLreference)), __LINE__); - } - // validation for constraint: choice(BilagIdentifikator, VedhaeftningIndholdData, VedhaeftningIndholdURLreference, VedhaeftSomIndholdDataIndikator) - if ('' !== ($vedhaeftningIndholdURLreferenceChoiceErrorMessage = self::validateVedhaeftningIndholdURLreferenceForChoiceConstraintsFromSetVedhaeftningIndholdURLreference($vedhaeftningIndholdURLreference))) { - throw new InvalidArgumentException($vedhaeftningIndholdURLreferenceChoiceErrorMessage, __LINE__); - } - if (is_null($vedhaeftningIndholdURLreference) || (is_array($vedhaeftningIndholdURLreference) && empty($vedhaeftningIndholdURLreference))) { - unset($this->VedhaeftningIndholdURLreference); - } else { - $this->VedhaeftningIndholdURLreference = $vedhaeftningIndholdURLreference; - } - - return $this; - } - /** - * Get VedhaeftSomIndholdDataIndikator value - * @return bool|null - */ - public function getVedhaeftSomIndholdDataIndikator(): ?bool - { - return isset($this->VedhaeftSomIndholdDataIndikator) ? $this->VedhaeftSomIndholdDataIndikator : null; - } - /** - * This method is responsible for validating the value passed to the setVedhaeftSomIndholdDataIndikator method - * This method is willingly generated in order to preserve the one-line inline validation within the setVedhaeftSomIndholdDataIndikator method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateVedhaeftSomIndholdDataIndikatorForChoiceConstraintsFromSetVedhaeftSomIndholdDataIndikator($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'BilagIdentifikator', - 'VedhaeftningIndholdData', - 'VedhaeftningIndholdURLreference', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property VedhaeftSomIndholdDataIndikator can\'t be set as the property %s is already set. Only one property must be set among these properties: VedhaeftSomIndholdDataIndikator, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set VedhaeftSomIndholdDataIndikator value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param bool $vedhaeftSomIndholdDataIndikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagType - */ - public function setVedhaeftSomIndholdDataIndikator(?bool $vedhaeftSomIndholdDataIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($vedhaeftSomIndholdDataIndikator) && !is_bool($vedhaeftSomIndholdDataIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($vedhaeftSomIndholdDataIndikator, true), gettype($vedhaeftSomIndholdDataIndikator)), __LINE__); - } - // validation for constraint: choice(BilagIdentifikator, VedhaeftningIndholdData, VedhaeftningIndholdURLreference, VedhaeftSomIndholdDataIndikator) - if ('' !== ($vedhaeftSomIndholdDataIndikatorChoiceErrorMessage = self::validateVedhaeftSomIndholdDataIndikatorForChoiceConstraintsFromSetVedhaeftSomIndholdDataIndikator($vedhaeftSomIndholdDataIndikator))) { - throw new InvalidArgumentException($vedhaeftSomIndholdDataIndikatorChoiceErrorMessage, __LINE__); - } - if (is_null($vedhaeftSomIndholdDataIndikator) || (is_array($vedhaeftSomIndholdDataIndikator) && empty($vedhaeftSomIndholdDataIndikator))) { - unset($this->VedhaeftSomIndholdDataIndikator); - } else { - $this->VedhaeftSomIndholdDataIndikator = $vedhaeftSomIndholdDataIndikator; - } - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BrevSPBodyType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BrevSPBodyType.php deleted file mode 100644 index 3ccc163..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/BrevSPBodyType.php +++ /dev/null @@ -1,127 +0,0 @@ -setKanalvalg($kanalvalg) - ->setPrioritet($prioritet) - ->setForsendelseI($forsendelseI); - } - /** - * Get Kanalvalg value - * @return string - */ - public function getKanalvalg(): string - { - return $this->Kanalvalg; - } - /** - * Set Kanalvalg value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalvalgType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalvalgType::getValidValues() - * @throws InvalidArgumentException - * @param string $kanalvalg - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BrevSPBodyType - */ - public function setKanalvalg(string $kanalvalg): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalvalgType::valueIsValid($kanalvalg)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalvalgType', is_array($kanalvalg) ? implode(', ', $kanalvalg) : var_export($kanalvalg, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalvalgType::getValidValues())), __LINE__); - } - $this->Kanalvalg = $kanalvalg; - - return $this; - } - /** - * Get Prioritet value - * @return string - */ - public function getPrioritet(): string - { - return $this->Prioritet; - } - /** - * Set Prioritet value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PrioritetType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PrioritetType::getValidValues() - * @throws InvalidArgumentException - * @param string $prioritet - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BrevSPBodyType - */ - public function setPrioritet(string $prioritet): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PrioritetType::valueIsValid($prioritet)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PrioritetType', is_array($prioritet) ? implode(', ', $prioritet) : var_export($prioritet, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PrioritetType::getValidValues())), __LINE__); - } - $this->Prioritet = $prioritet; - - return $this; - } - /** - * Get ForsendelseI value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function getForsendelseI(): \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - { - return $this->ForsendelseI; - } - /** - * Set ForsendelseI value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType $forsendelseI - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BrevSPBodyType - */ - public function setForsendelseI(\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType $forsendelseI): self - { - $this->ForsendelseI = $forsendelseI; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/CallContextType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/CallContextType.php deleted file mode 100644 index cc4041b..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/CallContextType.php +++ /dev/null @@ -1,146 +0,0 @@ -setOnBehalfOfUser($onBehalfOfUser) - ->setCallersServiceCallIdentifier($callersServiceCallIdentifier) - ->setAccountingInfo($accountingInfo); - } - /** - * Get OnBehalfOfUser value - * @return string|null - */ - public function getOnBehalfOfUser(): ?string - { - return $this->OnBehalfOfUser; - } - /** - * Set OnBehalfOfUser value - * @param string $onBehalfOfUser - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType - */ - public function setOnBehalfOfUser(?string $onBehalfOfUser = null): self - { - // validation for constraint: string - if (!is_null($onBehalfOfUser) && !is_string($onBehalfOfUser)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($onBehalfOfUser, true), gettype($onBehalfOfUser)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($onBehalfOfUser) && mb_strlen((string) $onBehalfOfUser) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $onBehalfOfUser)), __LINE__); - } - $this->OnBehalfOfUser = $onBehalfOfUser; - - return $this; - } - /** - * Get CallersServiceCallIdentifier value - * @return string|null - */ - public function getCallersServiceCallIdentifier(): ?string - { - return $this->CallersServiceCallIdentifier; - } - /** - * Set CallersServiceCallIdentifier value - * @param string $callersServiceCallIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType - */ - public function setCallersServiceCallIdentifier(?string $callersServiceCallIdentifier = null): self - { - // validation for constraint: string - if (!is_null($callersServiceCallIdentifier) && !is_string($callersServiceCallIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($callersServiceCallIdentifier, true), gettype($callersServiceCallIdentifier)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($callersServiceCallIdentifier) && mb_strlen((string) $callersServiceCallIdentifier) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $callersServiceCallIdentifier)), __LINE__); - } - $this->CallersServiceCallIdentifier = $callersServiceCallIdentifier; - - return $this; - } - /** - * Get AccountingInfo value - * @return string|null - */ - public function getAccountingInfo(): ?string - { - return $this->AccountingInfo; - } - /** - * Set AccountingInfo value - * @param string $accountingInfo - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType - */ - public function setAccountingInfo(?string $accountingInfo = null): self - { - // validation for constraint: string - if (!is_null($accountingInfo) && !is_string($accountingInfo)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accountingInfo, true), gettype($accountingInfo)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($accountingInfo) && mb_strlen((string) $accountingInfo) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $accountingInfo)), __LINE__); - } - $this->AccountingInfo = $accountingInfo; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/CountryIdentificationCodeType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/CountryIdentificationCodeType.php deleted file mode 100644 index 2a2fcf6..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/CountryIdentificationCodeType.php +++ /dev/null @@ -1,85 +0,0 @@ -set_($_) - ->setScheme($scheme); - } - /** - * Get _ value - * @return string|null - */ - public function get_(): ?string - { - return $this->_; - } - /** - * Set _ value - * @param string $_ - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CountryIdentificationCodeType - */ - public function set_(?string $_ = null): self - { - // validation for constraint: string - if (!is_null($_) && !is_string($_)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($_, true), gettype($_)), __LINE__); - } - $this->_ = $_; - - return $this; - } - /** - * Get scheme value - * @return string|null - */ - public function getScheme(): ?string - { - return $this->scheme; - } - /** - * Set scheme value - * @param string $scheme - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CountryIdentificationCodeType - */ - public function setScheme(?string $scheme = null): self - { - // validation for constraint: string - if (!is_null($scheme) && !is_string($scheme)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($scheme, true), gettype($scheme)), __LINE__); - } - $this->scheme = $scheme; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/DigitalPostParametreType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/DigitalPostParametreType.php deleted file mode 100644 index 6c4ed00..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/DigitalPostParametreType.php +++ /dev/null @@ -1,259 +0,0 @@ -setAfsendelseDatoTid($afsendelseDatoTid) - ->setMeddelelseIndholdstypeIdentifikator($meddelelseIndholdstypeIdentifikator) - ->setMeddelelseSvarTypeNavn($meddelelseSvarTypeNavn) - ->setMeddelelseSvarPostkasseIdentifikator($meddelelseSvarPostkasseIdentifikator) - ->setMeddelelseSvarEmneIdentifikator($meddelelseSvarEmneIdentifikator) - ->setMeddelelseFESDmetadata($meddelelseFESDmetadata) - ->setMedsendDokumentRegistreringIndikator($medsendDokumentRegistreringIndikator); - } - /** - * Get AfsendelseDatoTid value - * @return string|null - */ - public function getAfsendelseDatoTid(): ?string - { - return $this->AfsendelseDatoTid; - } - /** - * Set AfsendelseDatoTid value - * @param string $afsendelseDatoTid - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType - */ - public function setAfsendelseDatoTid(?string $afsendelseDatoTid = null): self - { - // validation for constraint: string - if (!is_null($afsendelseDatoTid) && !is_string($afsendelseDatoTid)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($afsendelseDatoTid, true), gettype($afsendelseDatoTid)), __LINE__); - } - $this->AfsendelseDatoTid = $afsendelseDatoTid; - - return $this; - } - /** - * Get MeddelelseIndholdstypeIdentifikator value - * @return int|null - */ - public function getMeddelelseIndholdstypeIdentifikator(): ?int - { - return $this->MeddelelseIndholdstypeIdentifikator; - } - /** - * Set MeddelelseIndholdstypeIdentifikator value - * @param int $meddelelseIndholdstypeIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType - */ - public function setMeddelelseIndholdstypeIdentifikator(?int $meddelelseIndholdstypeIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($meddelelseIndholdstypeIdentifikator) && !(is_int($meddelelseIndholdstypeIdentifikator) || ctype_digit($meddelelseIndholdstypeIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($meddelelseIndholdstypeIdentifikator, true), gettype($meddelelseIndholdstypeIdentifikator)), __LINE__); - } - $this->MeddelelseIndholdstypeIdentifikator = $meddelelseIndholdstypeIdentifikator; - - return $this; - } - /** - * Get MeddelelseSvarTypeNavn value - * @return string|null - */ - public function getMeddelelseSvarTypeNavn(): ?string - { - return $this->MeddelelseSvarTypeNavn; - } - /** - * Set MeddelelseSvarTypeNavn value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\MeddelelseSvarTypeNavnType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\MeddelelseSvarTypeNavnType::getValidValues() - * @throws InvalidArgumentException - * @param string $meddelelseSvarTypeNavn - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType - */ - public function setMeddelelseSvarTypeNavn(?string $meddelelseSvarTypeNavn = null): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\MeddelelseSvarTypeNavnType::valueIsValid($meddelelseSvarTypeNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\MeddelelseSvarTypeNavnType', is_array($meddelelseSvarTypeNavn) ? implode(', ', $meddelelseSvarTypeNavn) : var_export($meddelelseSvarTypeNavn, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\MeddelelseSvarTypeNavnType::getValidValues())), __LINE__); - } - $this->MeddelelseSvarTypeNavn = $meddelelseSvarTypeNavn; - - return $this; - } - /** - * Get MeddelelseSvarPostkasseIdentifikator value - * @return int|null - */ - public function getMeddelelseSvarPostkasseIdentifikator(): ?int - { - return $this->MeddelelseSvarPostkasseIdentifikator; - } - /** - * Set MeddelelseSvarPostkasseIdentifikator value - * @param int $meddelelseSvarPostkasseIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType - */ - public function setMeddelelseSvarPostkasseIdentifikator(?int $meddelelseSvarPostkasseIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($meddelelseSvarPostkasseIdentifikator) && !(is_int($meddelelseSvarPostkasseIdentifikator) || ctype_digit($meddelelseSvarPostkasseIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($meddelelseSvarPostkasseIdentifikator, true), gettype($meddelelseSvarPostkasseIdentifikator)), __LINE__); - } - $this->MeddelelseSvarPostkasseIdentifikator = $meddelelseSvarPostkasseIdentifikator; - - return $this; - } - /** - * Get MeddelelseSvarEmneIdentifikator value - * @return int|null - */ - public function getMeddelelseSvarEmneIdentifikator(): ?int - { - return $this->MeddelelseSvarEmneIdentifikator; - } - /** - * Set MeddelelseSvarEmneIdentifikator value - * @param int $meddelelseSvarEmneIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType - */ - public function setMeddelelseSvarEmneIdentifikator(?int $meddelelseSvarEmneIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($meddelelseSvarEmneIdentifikator) && !(is_int($meddelelseSvarEmneIdentifikator) || ctype_digit($meddelelseSvarEmneIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($meddelelseSvarEmneIdentifikator, true), gettype($meddelelseSvarEmneIdentifikator)), __LINE__); - } - $this->MeddelelseSvarEmneIdentifikator = $meddelelseSvarEmneIdentifikator; - - return $this; - } - /** - * Get MeddelelseFESDmetadata value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelseFESDmetadataType|null - */ - public function getMeddelelseFESDmetadata(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelseFESDmetadataType - { - return $this->MeddelelseFESDmetadata; - } - /** - * Set MeddelelseFESDmetadata value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelseFESDmetadataType $meddelelseFESDmetadata - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType - */ - public function setMeddelelseFESDmetadata(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelseFESDmetadataType $meddelelseFESDmetadata = null): self - { - $this->MeddelelseFESDmetadata = $meddelelseFESDmetadata; - - return $this; - } - /** - * Get MedsendDokumentRegistreringIndikator value - * @return bool|null - */ - public function getMedsendDokumentRegistreringIndikator(): ?bool - { - return $this->MedsendDokumentRegistreringIndikator; - } - /** - * Set MedsendDokumentRegistreringIndikator value - * @param bool $medsendDokumentRegistreringIndikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType - */ - public function setMedsendDokumentRegistreringIndikator(?bool $medsendDokumentRegistreringIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($medsendDokumentRegistreringIndikator) && !is_bool($medsendDokumentRegistreringIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($medsendDokumentRegistreringIndikator, true), gettype($medsendDokumentRegistreringIndikator)), __LINE__); - } - $this->MedsendDokumentRegistreringIndikator = $medsendDokumentRegistreringIndikator; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/DokumentParametreType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/DokumentParametreType.php deleted file mode 100644 index d6cdc43..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/DokumentParametreType.php +++ /dev/null @@ -1,155 +0,0 @@ -setTitelTekst($titelTekst) - ->setUUIDIdentifikator($uUIDIdentifikator) - ->setBrevDato($brevDato) - ->setMeddelelsesFormatObjekt($meddelelsesFormatObjekt); - } - /** - * Get TitelTekst value - * @return string|null - */ - public function getTitelTekst(): ?string - { - return $this->TitelTekst; - } - /** - * Set TitelTekst value - * @param string $titelTekst - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DokumentParametreType - */ - public function setTitelTekst(?string $titelTekst = null): self - { - // validation for constraint: string - if (!is_null($titelTekst) && !is_string($titelTekst)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($titelTekst, true), gettype($titelTekst)), __LINE__); - } - $this->TitelTekst = $titelTekst; - - return $this; - } - /** - * Get UUIDIdentifikator value - * @return string|null - */ - public function getUUIDIdentifikator(): ?string - { - return $this->UUIDIdentifikator; - } - /** - * Set UUIDIdentifikator value - * @param string $uUIDIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DokumentParametreType - */ - public function setUUIDIdentifikator(?string $uUIDIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($uUIDIdentifikator) && !is_string($uUIDIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($uUIDIdentifikator, true), gettype($uUIDIdentifikator)), __LINE__); - } - $this->UUIDIdentifikator = $uUIDIdentifikator; - - return $this; - } - /** - * Get BrevDato value - * @return string|null - */ - public function getBrevDato(): ?string - { - return $this->BrevDato; - } - /** - * Set BrevDato value - * @param string $brevDato - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DokumentParametreType - */ - public function setBrevDato(?string $brevDato = null): self - { - // validation for constraint: string - if (!is_null($brevDato) && !is_string($brevDato)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($brevDato, true), gettype($brevDato)), __LINE__); - } - $this->BrevDato = $brevDato; - - return $this; - } - /** - * Get MeddelelsesFormatObjekt value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelsesFormatObjektType|null - */ - public function getMeddelelsesFormatObjekt(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelsesFormatObjektType - { - return $this->MeddelelsesFormatObjekt; - } - /** - * Set MeddelelsesFormatObjekt value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelsesFormatObjektType $meddelelsesFormatObjekt - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DokumentParametreType - */ - public function setMeddelelsesFormatObjekt(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelsesFormatObjektType $meddelelsesFormatObjekt = null): self - { - $this->MeddelelsesFormatObjekt = $meddelelsesFormatObjekt; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ErrorListType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ErrorListType.php deleted file mode 100644 index 603b68a..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ErrorListType.php +++ /dev/null @@ -1,97 +0,0 @@ -setError($error); - } - /** - * Get Error value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType[] - */ - public function getError(): array - { - return $this->Error; - } - /** - * This method is responsible for validating the values passed to the setError method - * This method is willingly generated in order to preserve the one-line inline validation within the setError method - * @param array $values - * @return string A non-empty message if the values does not match the validation rules - */ - public static function validateErrorForArrayConstraintsFromSetError(array $values = []): string - { - $message = ''; - $invalidValues = []; - foreach ($values as $errorListTypeErrorItem) { - // validation for constraint: itemType - if (!$errorListTypeErrorItem instanceof \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType) { - $invalidValues[] = is_object($errorListTypeErrorItem) ? get_class($errorListTypeErrorItem) : sprintf('%s(%s)', gettype($errorListTypeErrorItem), var_export($errorListTypeErrorItem, true)); - } - } - if (!empty($invalidValues)) { - $message = sprintf('The Error property can only contain items of type \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); - } - unset($invalidValues); - - return $message; - } - /** - * Set Error value - * @throws InvalidArgumentException - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType[] $error - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorListType - */ - public function setError(array $error): self - { - // validation for constraint: array - if ('' !== ($errorArrayErrorMessage = self::validateErrorForArrayConstraintsFromSetError($error))) { - throw new InvalidArgumentException($errorArrayErrorMessage, __LINE__); - } - $this->Error = $error; - - return $this; - } - /** - * Add item to Error value - * @throws InvalidArgumentException - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType $item - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorListType - */ - public function addToError(\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType $item): self - { - // validation for constraint: itemType - if (!$item instanceof \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType) { - throw new InvalidArgumentException(sprintf('The Error property can only contain items of type \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); - } - $this->Error[] = $item; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ErrorType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ErrorType.php deleted file mode 100644 index c86d5e5..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ErrorType.php +++ /dev/null @@ -1,91 +0,0 @@ -setErrorCode($errorCode) - ->setErrorText($errorText); - } - /** - * Get ErrorCode value - * @return string - */ - public function getErrorCode(): string - { - return $this->ErrorCode; - } - /** - * Set ErrorCode value - * @param string $errorCode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType - */ - public function setErrorCode(string $errorCode): self - { - // validation for constraint: string - if (!is_null($errorCode) && !is_string($errorCode)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorCode, true), gettype($errorCode)), __LINE__); - } - $this->ErrorCode = $errorCode; - - return $this; - } - /** - * Get ErrorText value - * @return string - */ - public function getErrorText(): string - { - return $this->ErrorText; - } - /** - * Set ErrorText value - * @param string $errorText - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorType - */ - public function setErrorText(string $errorText): self - { - // validation for constraint: string - if (!is_null($errorText) && !is_string($errorText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorText, true), gettype($errorText)), __LINE__); - } - $this->ErrorText = $errorText; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/FejlType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/FejlType.php deleted file mode 100644 index 2bbf97f..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/FejlType.php +++ /dev/null @@ -1,146 +0,0 @@ -setFejlKode($fejlKode) - ->setFejlTekst($fejlTekst) - ->setFejlIdentifikator($fejlIdentifikator); - } - /** - * Get FejlKode value - * @return int|null - */ - public function getFejlKode(): ?int - { - return $this->FejlKode; - } - /** - * Set FejlKode value - * @param int $fejlKode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\FejlType - */ - public function setFejlKode(?int $fejlKode = null): self - { - // validation for constraint: int - if (!is_null($fejlKode) && !(is_int($fejlKode) || ctype_digit($fejlKode))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($fejlKode, true), gettype($fejlKode)), __LINE__); - } - // validation for constraint: maxInclusive(9999) - if (!is_null($fejlKode) && $fejlKode > 9999) { - throw new InvalidArgumentException(sprintf('Invalid value %s, the value must be numerically less than or equal to 9999', var_export($fejlKode, true)), __LINE__); - } - // validation for constraint: minInclusive(1000) - if (!is_null($fejlKode) && $fejlKode < 1000) { - throw new InvalidArgumentException(sprintf('Invalid value %s, the value must be numerically greater than or equal to 1000', var_export($fejlKode, true)), __LINE__); - } - $this->FejlKode = $fejlKode; - - return $this; - } - /** - * Get FejlTekst value - * @return string|null - */ - public function getFejlTekst(): ?string - { - return $this->FejlTekst; - } - /** - * Set FejlTekst value - * @param string $fejlTekst - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\FejlType - */ - public function setFejlTekst(?string $fejlTekst = null): self - { - // validation for constraint: string - if (!is_null($fejlTekst) && !is_string($fejlTekst)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fejlTekst, true), gettype($fejlTekst)), __LINE__); - } - // validation for constraint: maxLength(2048) - if (!is_null($fejlTekst) && mb_strlen((string) $fejlTekst) > 2048) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 2048', mb_strlen((string) $fejlTekst)), __LINE__); - } - $this->FejlTekst = $fejlTekst; - - return $this; - } - /** - * Get FejlIdentifikator value - * @return string|null - */ - public function getFejlIdentifikator(): ?string - { - return $this->FejlIdentifikator; - } - /** - * Set FejlIdentifikator value - * @param string $fejlIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\FejlType - */ - public function setFejlIdentifikator(?string $fejlIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fejlIdentifikator) && !is_string($fejlIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fejlIdentifikator, true), gettype($fejlIdentifikator)), __LINE__); - } - // validation for constraint: maxLength(26) - if (!is_null($fejlIdentifikator) && mb_strlen((string) $fejlIdentifikator) > 26) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 26', mb_strlen((string) $fejlIdentifikator)), __LINE__); - } - $this->FejlIdentifikator = $fejlIdentifikator; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseAfsenderType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseAfsenderType.php deleted file mode 100644 index 93cbd1c..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseAfsenderType.php +++ /dev/null @@ -1,54 +0,0 @@ -setAfsenderAdresse($afsenderAdresse); - } - /** - * Get AfsenderAdresse value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType|null - */ - public function getAfsenderAdresse(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - { - return $this->AfsenderAdresse; - } - /** - * Set AfsenderAdresse value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType $afsenderAdresse - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseAfsenderType - */ - public function setAfsenderAdresse(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType $afsenderAdresse = null): self - { - $this->AfsenderAdresse = $afsenderAdresse; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseIType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseIType.php deleted file mode 100644 index 834d2cf..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseIType.php +++ /dev/null @@ -1,413 +0,0 @@ -setAfsendelseIdentifikator($afsendelseIdentifikator) - ->setForsendelseTypeIdentifikator($forsendelseTypeIdentifikator) - ->setForsendelseModtager($forsendelseModtager) - ->setFilformatNavn($filformatNavn) - ->setMeddelelseIndholdData($meddelelseIndholdData) - ->setTransaktionsParametreI($transaktionsParametreI) - ->setDokumentParametre($dokumentParametre) - ->setKanalUafhaengigeParametreI($kanalUafhaengigeParametreI) - ->setPrintParametre($printParametre) - ->setDigitalPostParametre($digitalPostParametre) - ->setPostParametre($postParametre) - ->setBilagSamling($bilagSamling); - } - /** - * Get AfsendelseIdentifikator value - * @return string|null - */ - public function getAfsendelseIdentifikator(): ?string - { - return $this->AfsendelseIdentifikator; - } - /** - * Set AfsendelseIdentifikator value - * @param string $afsendelseIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setAfsendelseIdentifikator(?string $afsendelseIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($afsendelseIdentifikator) && !is_string($afsendelseIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($afsendelseIdentifikator, true), gettype($afsendelseIdentifikator)), __LINE__); - } - // validation for constraint: maxLength(38) - if (!is_null($afsendelseIdentifikator) && mb_strlen((string) $afsendelseIdentifikator) > 38) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 38', mb_strlen((string) $afsendelseIdentifikator)), __LINE__); - } - // validation for constraint: minLength(1) - if (!is_null($afsendelseIdentifikator) && mb_strlen((string) $afsendelseIdentifikator) < 1) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be greater than or equal to 1', mb_strlen((string) $afsendelseIdentifikator)), __LINE__); - } - $this->AfsendelseIdentifikator = $afsendelseIdentifikator; - - return $this; - } - /** - * Get ForsendelseTypeIdentifikator value - * @return int|null - */ - public function getForsendelseTypeIdentifikator(): ?int - { - return $this->ForsendelseTypeIdentifikator; - } - /** - * Set ForsendelseTypeIdentifikator value - * @param int $forsendelseTypeIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setForsendelseTypeIdentifikator(?int $forsendelseTypeIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($forsendelseTypeIdentifikator) && !(is_int($forsendelseTypeIdentifikator) || ctype_digit($forsendelseTypeIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($forsendelseTypeIdentifikator, true), gettype($forsendelseTypeIdentifikator)), __LINE__); - } - $this->ForsendelseTypeIdentifikator = $forsendelseTypeIdentifikator; - - return $this; - } - /** - * Get ForsendelseModtager value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseModtagerType|null - */ - public function getForsendelseModtager(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseModtagerType - { - return $this->ForsendelseModtager; - } - /** - * Set ForsendelseModtager value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseModtagerType $forsendelseModtager - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setForsendelseModtager(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseModtagerType $forsendelseModtager = null): self - { - $this->ForsendelseModtager = $forsendelseModtager; - - return $this; - } - /** - * Get FilformatNavn value - * @return string|null - */ - public function getFilformatNavn(): ?string - { - return $this->FilformatNavn; - } - /** - * Set FilformatNavn value - * @param string $filformatNavn - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setFilformatNavn(?string $filformatNavn = null): self - { - // validation for constraint: string - if (!is_null($filformatNavn) && !is_string($filformatNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($filformatNavn, true), gettype($filformatNavn)), __LINE__); - } - // validation for constraint: maxLength(10) - if (!is_null($filformatNavn) && mb_strlen((string) $filformatNavn) > 10) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 10', mb_strlen((string) $filformatNavn)), __LINE__); - } - $this->FilformatNavn = $filformatNavn; - - return $this; - } - /** - * Get MeddelelseIndholdData value - * @return string|null - */ - public function getMeddelelseIndholdData(): ?string - { - return $this->MeddelelseIndholdData; - } - /** - * Set MeddelelseIndholdData value - * @param string $meddelelseIndholdData - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setMeddelelseIndholdData(?string $meddelelseIndholdData = null): self - { - // validation for constraint: string - if (!is_null($meddelelseIndholdData) && !is_string($meddelelseIndholdData)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($meddelelseIndholdData, true), gettype($meddelelseIndholdData)), __LINE__); - } - $this->MeddelelseIndholdData = $meddelelseIndholdData; - - return $this; - } - /** - * Get TransaktionsParametreI value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TransaktionsParametreIType|null - */ - public function getTransaktionsParametreI(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TransaktionsParametreIType - { - return $this->TransaktionsParametreI; - } - /** - * Set TransaktionsParametreI value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TransaktionsParametreIType $transaktionsParametreI - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setTransaktionsParametreI(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TransaktionsParametreIType $transaktionsParametreI = null): self - { - $this->TransaktionsParametreI = $transaktionsParametreI; - - return $this; - } - /** - * Get DokumentParametre value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DokumentParametreType|null - */ - public function getDokumentParametre(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DokumentParametreType - { - return $this->DokumentParametre; - } - /** - * Set DokumentParametre value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DokumentParametreType $dokumentParametre - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setDokumentParametre(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DokumentParametreType $dokumentParametre = null): self - { - $this->DokumentParametre = $dokumentParametre; - - return $this; - } - /** - * Get KanalUafhaengigeParametreI value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType|null - */ - public function getKanalUafhaengigeParametreI(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - { - return $this->KanalUafhaengigeParametreI; - } - /** - * Set KanalUafhaengigeParametreI value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType $kanalUafhaengigeParametreI - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setKanalUafhaengigeParametreI(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType $kanalUafhaengigeParametreI = null): self - { - $this->KanalUafhaengigeParametreI = $kanalUafhaengigeParametreI; - - return $this; - } - /** - * Get PrintParametre value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintParametreType|null - */ - public function getPrintParametre(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintParametreType - { - return $this->PrintParametre; - } - /** - * Set PrintParametre value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintParametreType $printParametre - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setPrintParametre(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintParametreType $printParametre = null): self - { - $this->PrintParametre = $printParametre; - - return $this; - } - /** - * Get DigitalPostParametre value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType|null - */ - public function getDigitalPostParametre(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType - { - return $this->DigitalPostParametre; - } - /** - * Set DigitalPostParametre value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType $digitalPostParametre - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setDigitalPostParametre(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\DigitalPostParametreType $digitalPostParametre = null): self - { - $this->DigitalPostParametre = $digitalPostParametre; - - return $this; - } - /** - * Get PostParametre value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType|null - */ - public function getPostParametre(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType - { - return $this->PostParametre; - } - /** - * Set PostParametre value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType $postParametre - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setPostParametre(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType $postParametre = null): self - { - $this->PostParametre = $postParametre; - - return $this; - } - /** - * Get BilagSamling value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagSamlingType|null - */ - public function getBilagSamling(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagSamlingType - { - return $this->BilagSamling; - } - /** - * Set BilagSamling value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagSamlingType $bilagSamling - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseIType - */ - public function setBilagSamling(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BilagSamlingType $bilagSamling = null): self - { - $this->BilagSamling = $bilagSamling; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseModtagerType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseModtagerType.php deleted file mode 100644 index e80aaca..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ForsendelseModtagerType.php +++ /dev/null @@ -1,85 +0,0 @@ -setAfsendelseModtager($afsendelseModtager) - ->setModtagerAdresse($modtagerAdresse); - } - /** - * Get AfsendelseModtager value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType|null - */ - public function getAfsendelseModtager(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType - { - return $this->AfsendelseModtager; - } - /** - * Set AfsendelseModtager value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType $afsendelseModtager - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseModtagerType - */ - public function setAfsendelseModtager(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType $afsendelseModtager = null): self - { - $this->AfsendelseModtager = $afsendelseModtager; - - return $this; - } - /** - * Get ModtagerAdresse value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType|null - */ - public function getModtagerAdresse(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - { - return $this->ModtagerAdresse; - } - /** - * Set ModtagerAdresse value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType $modtagerAdresse - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseModtagerType - */ - public function setModtagerAdresse(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType $modtagerAdresse = null): self - { - $this->ModtagerAdresse = $modtagerAdresse; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/InvocationContextType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/InvocationContextType.php deleted file mode 100644 index 8dfbf7e..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/InvocationContextType.php +++ /dev/null @@ -1,310 +0,0 @@ -setServiceAgreementUUID($serviceAgreementUUID) - ->setUserSystemUUID($userSystemUUID) - ->setUserUUID($userUUID) - ->setServiceUUID($serviceUUID) - ->setOnBehalfOfUser($onBehalfOfUser) - ->setCallersServiceCallIdentifier($callersServiceCallIdentifier) - ->setAccountingInfo($accountingInfo); - } - /** - * Get ServiceAgreementUUID value - * @return string - */ - public function getServiceAgreementUUID(): string - { - return $this->ServiceAgreementUUID; - } - /** - * Set ServiceAgreementUUID value - * @param string $serviceAgreementUUID - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - */ - public function setServiceAgreementUUID(string $serviceAgreementUUID): self - { - // validation for constraint: string - if (!is_null($serviceAgreementUUID) && !is_string($serviceAgreementUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceAgreementUUID, true), gettype($serviceAgreementUUID)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($serviceAgreementUUID) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $serviceAgreementUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($serviceAgreementUUID, true)), __LINE__); - } - $this->ServiceAgreementUUID = $serviceAgreementUUID; - - return $this; - } - /** - * Get UserSystemUUID value - * @return string - */ - public function getUserSystemUUID(): string - { - return $this->UserSystemUUID; - } - /** - * Set UserSystemUUID value - * @param string $userSystemUUID - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - */ - public function setUserSystemUUID(string $userSystemUUID): self - { - // validation for constraint: string - if (!is_null($userSystemUUID) && !is_string($userSystemUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($userSystemUUID, true), gettype($userSystemUUID)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($userSystemUUID) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $userSystemUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($userSystemUUID, true)), __LINE__); - } - $this->UserSystemUUID = $userSystemUUID; - - return $this; - } - /** - * Get UserUUID value - * @return string - */ - public function getUserUUID(): string - { - return $this->UserUUID; - } - /** - * Set UserUUID value - * @param string $userUUID - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - */ - public function setUserUUID(string $userUUID): self - { - // validation for constraint: string - if (!is_null($userUUID) && !is_string($userUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($userUUID, true), gettype($userUUID)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($userUUID) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $userUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($userUUID, true)), __LINE__); - } - $this->UserUUID = $userUUID; - - return $this; - } - /** - * Get ServiceUUID value - * @return string - */ - public function getServiceUUID(): string - { - return $this->ServiceUUID; - } - /** - * Set ServiceUUID value - * @param string $serviceUUID - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - */ - public function setServiceUUID(string $serviceUUID): self - { - // validation for constraint: string - if (!is_null($serviceUUID) && !is_string($serviceUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceUUID, true), gettype($serviceUUID)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($serviceUUID) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $serviceUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($serviceUUID, true)), __LINE__); - } - $this->ServiceUUID = $serviceUUID; - - return $this; - } - /** - * Get OnBehalfOfUser value - * @return string|null - */ - public function getOnBehalfOfUser(): ?string - { - return $this->OnBehalfOfUser; - } - /** - * Set OnBehalfOfUser value - * @param string $onBehalfOfUser - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - */ - public function setOnBehalfOfUser(?string $onBehalfOfUser = null): self - { - // validation for constraint: string - if (!is_null($onBehalfOfUser) && !is_string($onBehalfOfUser)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($onBehalfOfUser, true), gettype($onBehalfOfUser)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($onBehalfOfUser) && mb_strlen((string) $onBehalfOfUser) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $onBehalfOfUser)), __LINE__); - } - $this->OnBehalfOfUser = $onBehalfOfUser; - - return $this; - } - /** - * Get CallersServiceCallIdentifier value - * @return string|null - */ - public function getCallersServiceCallIdentifier(): ?string - { - return $this->CallersServiceCallIdentifier; - } - /** - * Set CallersServiceCallIdentifier value - * @param string $callersServiceCallIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - */ - public function setCallersServiceCallIdentifier(?string $callersServiceCallIdentifier = null): self - { - // validation for constraint: string - if (!is_null($callersServiceCallIdentifier) && !is_string($callersServiceCallIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($callersServiceCallIdentifier, true), gettype($callersServiceCallIdentifier)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($callersServiceCallIdentifier) && mb_strlen((string) $callersServiceCallIdentifier) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $callersServiceCallIdentifier)), __LINE__); - } - $this->CallersServiceCallIdentifier = $callersServiceCallIdentifier; - - return $this; - } - /** - * Get AccountingInfo value - * @return string|null - */ - public function getAccountingInfo(): ?string - { - return $this->AccountingInfo; - } - /** - * Set AccountingInfo value - * @param string $accountingInfo - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - */ - public function setAccountingInfo(?string $accountingInfo = null): self - { - // validation for constraint: string - if (!is_null($accountingInfo) && !is_string($accountingInfo)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accountingInfo, true), gettype($accountingInfo)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($accountingInfo) && mb_strlen((string) $accountingInfo) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $accountingInfo)), __LINE__); - } - $this->AccountingInfo = $accountingInfo; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/KanalUafhaengigeParametreIType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/KanalUafhaengigeParametreIType.php deleted file mode 100644 index 91f0c7a..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/KanalUafhaengigeParametreIType.php +++ /dev/null @@ -1,350 +0,0 @@ -setEnhedTekst($enhedTekst) - ->setBrugerNavn($brugerNavn) - ->setKonteringsGruppeTekst($konteringsGruppeTekst) - ->setForsendelseAfsender($forsendelseAfsender) - ->setPaatrykAfsenderAdresseIndikator($paatrykAfsenderAdresseIndikator) - ->setPaatrykModtagerAdresseIndikator($paatrykModtagerAdresseIndikator) - ->setPaatrykBrevdatoIndikator($paatrykBrevdatoIndikator) - ->setKanalKode($kanalKode) - ->setHasteBrevIndikator($hasteBrevIndikator); - } - /** - * Get EnhedTekst value - * @return string|null - */ - public function getEnhedTekst(): ?string - { - return $this->EnhedTekst; - } - /** - * Set EnhedTekst value - * @param string $enhedTekst - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setEnhedTekst(?string $enhedTekst = null): self - { - // validation for constraint: string - if (!is_null($enhedTekst) && !is_string($enhedTekst)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($enhedTekst, true), gettype($enhedTekst)), __LINE__); - } - // validation for constraint: maxLength(2000) - if (!is_null($enhedTekst) && mb_strlen((string) $enhedTekst) > 2000) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 2000', mb_strlen((string) $enhedTekst)), __LINE__); - } - $this->EnhedTekst = $enhedTekst; - - return $this; - } - /** - * Get BrugerNavn value - * @return string|null - */ - public function getBrugerNavn(): ?string - { - return $this->BrugerNavn; - } - /** - * Set BrugerNavn value - * @param string $brugerNavn - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setBrugerNavn(?string $brugerNavn = null): self - { - // validation for constraint: string - if (!is_null($brugerNavn) && !is_string($brugerNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($brugerNavn, true), gettype($brugerNavn)), __LINE__); - } - // validation for constraint: maxLength(2000) - if (!is_null($brugerNavn) && mb_strlen((string) $brugerNavn) > 2000) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 2000', mb_strlen((string) $brugerNavn)), __LINE__); - } - // validation for constraint: minLength(1) - if (!is_null($brugerNavn) && mb_strlen((string) $brugerNavn) < 1) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be greater than or equal to 1', mb_strlen((string) $brugerNavn)), __LINE__); - } - $this->BrugerNavn = $brugerNavn; - - return $this; - } - /** - * Get KonteringsGruppeTekst value - * @return string|null - */ - public function getKonteringsGruppeTekst(): ?string - { - return $this->KonteringsGruppeTekst; - } - /** - * Set KonteringsGruppeTekst value - * @param string $konteringsGruppeTekst - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setKonteringsGruppeTekst(?string $konteringsGruppeTekst = null): self - { - // validation for constraint: string - if (!is_null($konteringsGruppeTekst) && !is_string($konteringsGruppeTekst)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($konteringsGruppeTekst, true), gettype($konteringsGruppeTekst)), __LINE__); - } - // validation for constraint: maxLength(2000) - if (!is_null($konteringsGruppeTekst) && mb_strlen((string) $konteringsGruppeTekst) > 2000) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 2000', mb_strlen((string) $konteringsGruppeTekst)), __LINE__); - } - $this->KonteringsGruppeTekst = $konteringsGruppeTekst; - - return $this; - } - /** - * Get ForsendelseAfsender value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseAfsenderType|null - */ - public function getForsendelseAfsender(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseAfsenderType - { - return $this->ForsendelseAfsender; - } - /** - * Set ForsendelseAfsender value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseAfsenderType $forsendelseAfsender - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setForsendelseAfsender(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ForsendelseAfsenderType $forsendelseAfsender = null): self - { - $this->ForsendelseAfsender = $forsendelseAfsender; - - return $this; - } - /** - * Get PaatrykAfsenderAdresseIndikator value - * @return bool|null - */ - public function getPaatrykAfsenderAdresseIndikator(): ?bool - { - return $this->PaatrykAfsenderAdresseIndikator; - } - /** - * Set PaatrykAfsenderAdresseIndikator value - * @param bool $paatrykAfsenderAdresseIndikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setPaatrykAfsenderAdresseIndikator(?bool $paatrykAfsenderAdresseIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($paatrykAfsenderAdresseIndikator) && !is_bool($paatrykAfsenderAdresseIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($paatrykAfsenderAdresseIndikator, true), gettype($paatrykAfsenderAdresseIndikator)), __LINE__); - } - $this->PaatrykAfsenderAdresseIndikator = $paatrykAfsenderAdresseIndikator; - - return $this; - } - /** - * Get PaatrykModtagerAdresseIndikator value - * @return bool|null - */ - public function getPaatrykModtagerAdresseIndikator(): ?bool - { - return $this->PaatrykModtagerAdresseIndikator; - } - /** - * Set PaatrykModtagerAdresseIndikator value - * @param bool $paatrykModtagerAdresseIndikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setPaatrykModtagerAdresseIndikator(?bool $paatrykModtagerAdresseIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($paatrykModtagerAdresseIndikator) && !is_bool($paatrykModtagerAdresseIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($paatrykModtagerAdresseIndikator, true), gettype($paatrykModtagerAdresseIndikator)), __LINE__); - } - $this->PaatrykModtagerAdresseIndikator = $paatrykModtagerAdresseIndikator; - - return $this; - } - /** - * Get PaatrykBrevdatoIndikator value - * @return bool|null - */ - public function getPaatrykBrevdatoIndikator(): ?bool - { - return $this->PaatrykBrevdatoIndikator; - } - /** - * Set PaatrykBrevdatoIndikator value - * @param bool $paatrykBrevdatoIndikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setPaatrykBrevdatoIndikator(?bool $paatrykBrevdatoIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($paatrykBrevdatoIndikator) && !is_bool($paatrykBrevdatoIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($paatrykBrevdatoIndikator, true), gettype($paatrykBrevdatoIndikator)), __LINE__); - } - $this->PaatrykBrevdatoIndikator = $paatrykBrevdatoIndikator; - - return $this; - } - /** - * Get KanalKode value - * @return string|null - */ - public function getKanalKode(): ?string - { - return $this->KanalKode; - } - /** - * Set KanalKode value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalKodeType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $kanalKode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setKanalKode(?string $kanalKode = null): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalKodeType::valueIsValid($kanalKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalKodeType', is_array($kanalKode) ? implode(', ', $kanalKode) : var_export($kanalKode, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KanalKodeType::getValidValues())), __LINE__); - } - $this->KanalKode = $kanalKode; - - return $this; - } - /** - * Get HasteBrevIndikator value - * @return bool|null - */ - public function getHasteBrevIndikator(): ?bool - { - return $this->HasteBrevIndikator; - } - /** - * Set HasteBrevIndikator value - * @param bool $hasteBrevIndikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KanalUafhaengigeParametreIType - */ - public function setHasteBrevIndikator(?bool $hasteBrevIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($hasteBrevIndikator) && !is_bool($hasteBrevIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($hasteBrevIndikator, true), gettype($hasteBrevIndikator)), __LINE__); - } - $this->HasteBrevIndikator = $hasteBrevIndikator; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/KontaktOplysningType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/KontaktOplysningType.php deleted file mode 100644 index 297521a..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/KontaktOplysningType.php +++ /dev/null @@ -1,1475 +0,0 @@ -setPersonName($personName) - ->setCoNavn($coNavn) - ->setStreetName($streetName) - ->setStreetBuildingIdentifier($streetBuildingIdentifier) - ->setFloorIdentifier($floorIdentifier) - ->setSuiteIdentifier($suiteIdentifier) - ->setMailDeliverySublocationIdentifier($mailDeliverySublocationIdentifier) - ->setPostCodeIdentifier($postCodeIdentifier) - ->setDistrictSubdivisionIdentifier($districtSubdivisionIdentifier) - ->setPostOfficeBoxIdentifier($postOfficeBoxIdentifier) - ->setPostalAddressFirstLineText($postalAddressFirstLineText) - ->setPostalAddressSecondLineText($postalAddressSecondLineText) - ->setPostalAddressThirdLineText($postalAddressThirdLineText) - ->setPostalAddressFourthLineText($postalAddressFourthLineText) - ->setPostalAddressFifthLineText($postalAddressFifthLineText) - ->setPostalAddressSixthLineText($postalAddressSixthLineText) - ->setCountryIdentificationCode($countryIdentificationCode); - } - /** - * Get PersonName value - * @return string|null - */ - public function getPersonName(): ?string - { - return $this->PersonName; - } - /** - * Set PersonName value - * @param string $personName - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPersonName(?string $personName = null): self - { - // validation for constraint: string - if (!is_null($personName) && !is_string($personName)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($personName, true), gettype($personName)), __LINE__); - } - $this->PersonName = $personName; - - return $this; - } - /** - * Get CoNavn value - * @return string|null - */ - public function getCoNavn(): ?string - { - return isset($this->CoNavn) ? $this->CoNavn : null; - } - /** - * This method is responsible for validating the value passed to the setCoNavn method - * This method is willingly generated in order to preserve the one-line inline validation within the setCoNavn method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateCoNavnForChoiceConstraintsFromSetCoNavn($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property CoNavn can\'t be set as the property %s is already set. Only one property must be set among these properties: CoNavn, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set CoNavn value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $coNavn - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setCoNavn(?string $coNavn = null): self - { - // validation for constraint: string - if (!is_null($coNavn) && !is_string($coNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($coNavn, true), gettype($coNavn)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($coNavnChoiceErrorMessage = self::validateCoNavnForChoiceConstraintsFromSetCoNavn($coNavn))) { - throw new InvalidArgumentException($coNavnChoiceErrorMessage, __LINE__); - } - if (is_null($coNavn) || (is_array($coNavn) && empty($coNavn))) { - unset($this->CoNavn); - } else { - $this->CoNavn = $coNavn; - } - - return $this; - } - /** - * Get StreetName value - * @return string|null - */ - public function getStreetName(): ?string - { - return isset($this->StreetName) ? $this->StreetName : null; - } - /** - * This method is responsible for validating the value passed to the setStreetName method - * This method is willingly generated in order to preserve the one-line inline validation within the setStreetName method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateStreetNameForChoiceConstraintsFromSetStreetName($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property StreetName can\'t be set as the property %s is already set. Only one property must be set among these properties: StreetName, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set StreetName value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $streetName - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setStreetName(?string $streetName = null): self - { - // validation for constraint: string - if (!is_null($streetName) && !is_string($streetName)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($streetName, true), gettype($streetName)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($streetNameChoiceErrorMessage = self::validateStreetNameForChoiceConstraintsFromSetStreetName($streetName))) { - throw new InvalidArgumentException($streetNameChoiceErrorMessage, __LINE__); - } - if (is_null($streetName) || (is_array($streetName) && empty($streetName))) { - unset($this->StreetName); - } else { - $this->StreetName = $streetName; - } - - return $this; - } - /** - * Get StreetBuildingIdentifier value - * @return string|null - */ - public function getStreetBuildingIdentifier(): ?string - { - return isset($this->StreetBuildingIdentifier) ? $this->StreetBuildingIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setStreetBuildingIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setStreetBuildingIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateStreetBuildingIdentifierForChoiceConstraintsFromSetStreetBuildingIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property StreetBuildingIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: StreetBuildingIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set StreetBuildingIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $streetBuildingIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setStreetBuildingIdentifier(?string $streetBuildingIdentifier = null): self - { - // validation for constraint: string - if (!is_null($streetBuildingIdentifier) && !is_string($streetBuildingIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($streetBuildingIdentifier, true), gettype($streetBuildingIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($streetBuildingIdentifierChoiceErrorMessage = self::validateStreetBuildingIdentifierForChoiceConstraintsFromSetStreetBuildingIdentifier($streetBuildingIdentifier))) { - throw new InvalidArgumentException($streetBuildingIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($streetBuildingIdentifier) || (is_array($streetBuildingIdentifier) && empty($streetBuildingIdentifier))) { - unset($this->StreetBuildingIdentifier); - } else { - $this->StreetBuildingIdentifier = $streetBuildingIdentifier; - } - - return $this; - } - /** - * Get FloorIdentifier value - * @return string|null - */ - public function getFloorIdentifier(): ?string - { - return isset($this->FloorIdentifier) ? $this->FloorIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setFloorIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setFloorIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateFloorIdentifierForChoiceConstraintsFromSetFloorIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property FloorIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: FloorIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set FloorIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $floorIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setFloorIdentifier(?string $floorIdentifier = null): self - { - // validation for constraint: string - if (!is_null($floorIdentifier) && !is_string($floorIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($floorIdentifier, true), gettype($floorIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($floorIdentifierChoiceErrorMessage = self::validateFloorIdentifierForChoiceConstraintsFromSetFloorIdentifier($floorIdentifier))) { - throw new InvalidArgumentException($floorIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($floorIdentifier) || (is_array($floorIdentifier) && empty($floorIdentifier))) { - unset($this->FloorIdentifier); - } else { - $this->FloorIdentifier = $floorIdentifier; - } - - return $this; - } - /** - * Get SuiteIdentifier value - * @return string|null - */ - public function getSuiteIdentifier(): ?string - { - return isset($this->SuiteIdentifier) ? $this->SuiteIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setSuiteIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setSuiteIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateSuiteIdentifierForChoiceConstraintsFromSetSuiteIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property SuiteIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: SuiteIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set SuiteIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $suiteIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setSuiteIdentifier(?string $suiteIdentifier = null): self - { - // validation for constraint: string - if (!is_null($suiteIdentifier) && !is_string($suiteIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($suiteIdentifier, true), gettype($suiteIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($suiteIdentifierChoiceErrorMessage = self::validateSuiteIdentifierForChoiceConstraintsFromSetSuiteIdentifier($suiteIdentifier))) { - throw new InvalidArgumentException($suiteIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($suiteIdentifier) || (is_array($suiteIdentifier) && empty($suiteIdentifier))) { - unset($this->SuiteIdentifier); - } else { - $this->SuiteIdentifier = $suiteIdentifier; - } - - return $this; - } - /** - * Get MailDeliverySublocationIdentifier value - * @return string|null - */ - public function getMailDeliverySublocationIdentifier(): ?string - { - return isset($this->MailDeliverySublocationIdentifier) ? $this->MailDeliverySublocationIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setMailDeliverySublocationIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setMailDeliverySublocationIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateMailDeliverySublocationIdentifierForChoiceConstraintsFromSetMailDeliverySublocationIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property MailDeliverySublocationIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: MailDeliverySublocationIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set MailDeliverySublocationIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $mailDeliverySublocationIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setMailDeliverySublocationIdentifier(?string $mailDeliverySublocationIdentifier = null): self - { - // validation for constraint: string - if (!is_null($mailDeliverySublocationIdentifier) && !is_string($mailDeliverySublocationIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mailDeliverySublocationIdentifier, true), gettype($mailDeliverySublocationIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($mailDeliverySublocationIdentifierChoiceErrorMessage = self::validateMailDeliverySublocationIdentifierForChoiceConstraintsFromSetMailDeliverySublocationIdentifier($mailDeliverySublocationIdentifier))) { - throw new InvalidArgumentException($mailDeliverySublocationIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($mailDeliverySublocationIdentifier) || (is_array($mailDeliverySublocationIdentifier) && empty($mailDeliverySublocationIdentifier))) { - unset($this->MailDeliverySublocationIdentifier); - } else { - $this->MailDeliverySublocationIdentifier = $mailDeliverySublocationIdentifier; - } - - return $this; - } - /** - * Get PostCodeIdentifier value - * @return string|null - */ - public function getPostCodeIdentifier(): ?string - { - return isset($this->PostCodeIdentifier) ? $this->PostCodeIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setPostCodeIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostCodeIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostCodeIdentifierForChoiceConstraintsFromSetPostCodeIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostCodeIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: PostCodeIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostCodeIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postCodeIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPostCodeIdentifier(?string $postCodeIdentifier = null): self - { - // validation for constraint: string - if (!is_null($postCodeIdentifier) && !is_string($postCodeIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postCodeIdentifier, true), gettype($postCodeIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postCodeIdentifierChoiceErrorMessage = self::validatePostCodeIdentifierForChoiceConstraintsFromSetPostCodeIdentifier($postCodeIdentifier))) { - throw new InvalidArgumentException($postCodeIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($postCodeIdentifier) || (is_array($postCodeIdentifier) && empty($postCodeIdentifier))) { - unset($this->PostCodeIdentifier); - } else { - $this->PostCodeIdentifier = $postCodeIdentifier; - } - - return $this; - } - /** - * Get DistrictSubdivisionIdentifier value - * @return string|null - */ - public function getDistrictSubdivisionIdentifier(): ?string - { - return isset($this->DistrictSubdivisionIdentifier) ? $this->DistrictSubdivisionIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setDistrictSubdivisionIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setDistrictSubdivisionIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateDistrictSubdivisionIdentifierForChoiceConstraintsFromSetDistrictSubdivisionIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property DistrictSubdivisionIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: DistrictSubdivisionIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set DistrictSubdivisionIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $districtSubdivisionIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setDistrictSubdivisionIdentifier(?string $districtSubdivisionIdentifier = null): self - { - // validation for constraint: string - if (!is_null($districtSubdivisionIdentifier) && !is_string($districtSubdivisionIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($districtSubdivisionIdentifier, true), gettype($districtSubdivisionIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($districtSubdivisionIdentifierChoiceErrorMessage = self::validateDistrictSubdivisionIdentifierForChoiceConstraintsFromSetDistrictSubdivisionIdentifier($districtSubdivisionIdentifier))) { - throw new InvalidArgumentException($districtSubdivisionIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($districtSubdivisionIdentifier) || (is_array($districtSubdivisionIdentifier) && empty($districtSubdivisionIdentifier))) { - unset($this->DistrictSubdivisionIdentifier); - } else { - $this->DistrictSubdivisionIdentifier = $districtSubdivisionIdentifier; - } - - return $this; - } - /** - * Get PostOfficeBoxIdentifier value - * @return int|null - */ - public function getPostOfficeBoxIdentifier(): ?int - { - return isset($this->PostOfficeBoxIdentifier) ? $this->PostOfficeBoxIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setPostOfficeBoxIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostOfficeBoxIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostOfficeBoxIdentifierForChoiceConstraintsFromSetPostOfficeBoxIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostOfficeBoxIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: PostOfficeBoxIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostOfficeBoxIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param int $postOfficeBoxIdentifier - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPostOfficeBoxIdentifier(?int $postOfficeBoxIdentifier = null): self - { - // validation for constraint: int - if (!is_null($postOfficeBoxIdentifier) && !(is_int($postOfficeBoxIdentifier) || ctype_digit($postOfficeBoxIdentifier))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($postOfficeBoxIdentifier, true), gettype($postOfficeBoxIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postOfficeBoxIdentifierChoiceErrorMessage = self::validatePostOfficeBoxIdentifierForChoiceConstraintsFromSetPostOfficeBoxIdentifier($postOfficeBoxIdentifier))) { - throw new InvalidArgumentException($postOfficeBoxIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($postOfficeBoxIdentifier) || (is_array($postOfficeBoxIdentifier) && empty($postOfficeBoxIdentifier))) { - unset($this->PostOfficeBoxIdentifier); - } else { - $this->PostOfficeBoxIdentifier = $postOfficeBoxIdentifier; - } - - return $this; - } - /** - * Get PostalAddressFirstLineText value - * @return string|null - */ - public function getPostalAddressFirstLineText(): ?string - { - return isset($this->PostalAddressFirstLineText) ? $this->PostalAddressFirstLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressFirstLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressFirstLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressFirstLineTextForChoiceConstraintsFromSetPostalAddressFirstLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressFirstLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressFirstLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressFirstLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressFirstLineText - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPostalAddressFirstLineText(?string $postalAddressFirstLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressFirstLineText) && !is_string($postalAddressFirstLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressFirstLineText, true), gettype($postalAddressFirstLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressFirstLineTextChoiceErrorMessage = self::validatePostalAddressFirstLineTextForChoiceConstraintsFromSetPostalAddressFirstLineText($postalAddressFirstLineText))) { - throw new InvalidArgumentException($postalAddressFirstLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressFirstLineText) || (is_array($postalAddressFirstLineText) && empty($postalAddressFirstLineText))) { - unset($this->PostalAddressFirstLineText); - } else { - $this->PostalAddressFirstLineText = $postalAddressFirstLineText; - } - - return $this; - } - /** - * Get PostalAddressSecondLineText value - * @return string|null - */ - public function getPostalAddressSecondLineText(): ?string - { - return isset($this->PostalAddressSecondLineText) ? $this->PostalAddressSecondLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressSecondLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressSecondLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressSecondLineTextForChoiceConstraintsFromSetPostalAddressSecondLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressSecondLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressSecondLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressSecondLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressSecondLineText - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPostalAddressSecondLineText(?string $postalAddressSecondLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressSecondLineText) && !is_string($postalAddressSecondLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressSecondLineText, true), gettype($postalAddressSecondLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressSecondLineTextChoiceErrorMessage = self::validatePostalAddressSecondLineTextForChoiceConstraintsFromSetPostalAddressSecondLineText($postalAddressSecondLineText))) { - throw new InvalidArgumentException($postalAddressSecondLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressSecondLineText) || (is_array($postalAddressSecondLineText) && empty($postalAddressSecondLineText))) { - unset($this->PostalAddressSecondLineText); - } else { - $this->PostalAddressSecondLineText = $postalAddressSecondLineText; - } - - return $this; - } - /** - * Get PostalAddressThirdLineText value - * @return string|null - */ - public function getPostalAddressThirdLineText(): ?string - { - return isset($this->PostalAddressThirdLineText) ? $this->PostalAddressThirdLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressThirdLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressThirdLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressThirdLineTextForChoiceConstraintsFromSetPostalAddressThirdLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressThirdLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressThirdLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressThirdLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressThirdLineText - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPostalAddressThirdLineText(?string $postalAddressThirdLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressThirdLineText) && !is_string($postalAddressThirdLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressThirdLineText, true), gettype($postalAddressThirdLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressThirdLineTextChoiceErrorMessage = self::validatePostalAddressThirdLineTextForChoiceConstraintsFromSetPostalAddressThirdLineText($postalAddressThirdLineText))) { - throw new InvalidArgumentException($postalAddressThirdLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressThirdLineText) || (is_array($postalAddressThirdLineText) && empty($postalAddressThirdLineText))) { - unset($this->PostalAddressThirdLineText); - } else { - $this->PostalAddressThirdLineText = $postalAddressThirdLineText; - } - - return $this; - } - /** - * Get PostalAddressFourthLineText value - * @return string|null - */ - public function getPostalAddressFourthLineText(): ?string - { - return isset($this->PostalAddressFourthLineText) ? $this->PostalAddressFourthLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressFourthLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressFourthLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressFourthLineTextForChoiceConstraintsFromSetPostalAddressFourthLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressFourthLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressFourthLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressFourthLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressFourthLineText - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPostalAddressFourthLineText(?string $postalAddressFourthLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressFourthLineText) && !is_string($postalAddressFourthLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressFourthLineText, true), gettype($postalAddressFourthLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressFourthLineTextChoiceErrorMessage = self::validatePostalAddressFourthLineTextForChoiceConstraintsFromSetPostalAddressFourthLineText($postalAddressFourthLineText))) { - throw new InvalidArgumentException($postalAddressFourthLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressFourthLineText) || (is_array($postalAddressFourthLineText) && empty($postalAddressFourthLineText))) { - unset($this->PostalAddressFourthLineText); - } else { - $this->PostalAddressFourthLineText = $postalAddressFourthLineText; - } - - return $this; - } - /** - * Get PostalAddressFifthLineText value - * @return string|null - */ - public function getPostalAddressFifthLineText(): ?string - { - return isset($this->PostalAddressFifthLineText) ? $this->PostalAddressFifthLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressFifthLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressFifthLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressFifthLineTextForChoiceConstraintsFromSetPostalAddressFifthLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressFifthLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressFifthLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressFifthLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressFifthLineText - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPostalAddressFifthLineText(?string $postalAddressFifthLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressFifthLineText) && !is_string($postalAddressFifthLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressFifthLineText, true), gettype($postalAddressFifthLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressFifthLineTextChoiceErrorMessage = self::validatePostalAddressFifthLineTextForChoiceConstraintsFromSetPostalAddressFifthLineText($postalAddressFifthLineText))) { - throw new InvalidArgumentException($postalAddressFifthLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressFifthLineText) || (is_array($postalAddressFifthLineText) && empty($postalAddressFifthLineText))) { - unset($this->PostalAddressFifthLineText); - } else { - $this->PostalAddressFifthLineText = $postalAddressFifthLineText; - } - - return $this; - } - /** - * Get PostalAddressSixthLineText value - * @return string|null - */ - public function getPostalAddressSixthLineText(): ?string - { - return isset($this->PostalAddressSixthLineText) ? $this->PostalAddressSixthLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressSixthLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressSixthLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressSixthLineTextForChoiceConstraintsFromSetPostalAddressSixthLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressSixthLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressSixthLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressSixthLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressSixthLineText - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setPostalAddressSixthLineText(?string $postalAddressSixthLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressSixthLineText) && !is_string($postalAddressSixthLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressSixthLineText, true), gettype($postalAddressSixthLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressSixthLineTextChoiceErrorMessage = self::validatePostalAddressSixthLineTextForChoiceConstraintsFromSetPostalAddressSixthLineText($postalAddressSixthLineText))) { - throw new InvalidArgumentException($postalAddressSixthLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressSixthLineText) || (is_array($postalAddressSixthLineText) && empty($postalAddressSixthLineText))) { - unset($this->PostalAddressSixthLineText); - } else { - $this->PostalAddressSixthLineText = $postalAddressSixthLineText; - } - - return $this; - } - /** - * Get CountryIdentificationCode value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CountryIdentificationCodeType|null - */ - public function getCountryIdentificationCode(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CountryIdentificationCodeType - { - return $this->CountryIdentificationCode; - } - /** - * Set CountryIdentificationCode value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CountryIdentificationCodeType $countryIdentificationCode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\KontaktOplysningType - */ - public function setCountryIdentificationCode(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CountryIdentificationCodeType $countryIdentificationCode = null): self - { - $this->CountryIdentificationCode = $countryIdentificationCode; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/MeddelelseFESDmetadataType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/MeddelelseFESDmetadataType.php deleted file mode 100644 index 204569d..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/MeddelelseFESDmetadataType.php +++ /dev/null @@ -1,183 +0,0 @@ -setFESDdokumentIdentifikator($fESDdokumentIdentifikator) - ->setFESDaktoerIdentifikator($fESDaktoerIdentifikator) - ->setFESDsagIdentifikator($fESDsagIdentifikator) - ->setFESDsagsklassifikationIdentifikator($fESDsagsklassifikationIdentifikator); - } - /** - * Get FESDdokumentIdentifikator value - * @return string|null - */ - public function getFESDdokumentIdentifikator(): ?string - { - return $this->FESDdokumentIdentifikator; - } - /** - * Set FESDdokumentIdentifikator value - * @param string $fESDdokumentIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelseFESDmetadataType - */ - public function setFESDdokumentIdentifikator(?string $fESDdokumentIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fESDdokumentIdentifikator) && !is_string($fESDdokumentIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fESDdokumentIdentifikator, true), gettype($fESDdokumentIdentifikator)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($fESDdokumentIdentifikator) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $fESDdokumentIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($fESDdokumentIdentifikator, true)), __LINE__); - } - $this->FESDdokumentIdentifikator = $fESDdokumentIdentifikator; - - return $this; - } - /** - * Get FESDaktoerIdentifikator value - * @return string|null - */ - public function getFESDaktoerIdentifikator(): ?string - { - return $this->FESDaktoerIdentifikator; - } - /** - * Set FESDaktoerIdentifikator value - * @param string $fESDaktoerIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelseFESDmetadataType - */ - public function setFESDaktoerIdentifikator(?string $fESDaktoerIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fESDaktoerIdentifikator) && !is_string($fESDaktoerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fESDaktoerIdentifikator, true), gettype($fESDaktoerIdentifikator)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($fESDaktoerIdentifikator) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $fESDaktoerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($fESDaktoerIdentifikator, true)), __LINE__); - } - $this->FESDaktoerIdentifikator = $fESDaktoerIdentifikator; - - return $this; - } - /** - * Get FESDsagIdentifikator value - * @return string|null - */ - public function getFESDsagIdentifikator(): ?string - { - return $this->FESDsagIdentifikator; - } - /** - * Set FESDsagIdentifikator value - * @param string $fESDsagIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelseFESDmetadataType - */ - public function setFESDsagIdentifikator(?string $fESDsagIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fESDsagIdentifikator) && !is_string($fESDsagIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fESDsagIdentifikator, true), gettype($fESDsagIdentifikator)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($fESDsagIdentifikator) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $fESDsagIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($fESDsagIdentifikator, true)), __LINE__); - } - $this->FESDsagIdentifikator = $fESDsagIdentifikator; - - return $this; - } - /** - * Get FESDsagsklassifikationIdentifikator value - * @return string|null - */ - public function getFESDsagsklassifikationIdentifikator(): ?string - { - return $this->FESDsagsklassifikationIdentifikator; - } - /** - * Set FESDsagsklassifikationIdentifikator value - * @param string $fESDsagsklassifikationIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelseFESDmetadataType - */ - public function setFESDsagsklassifikationIdentifikator(?string $fESDsagsklassifikationIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fESDsagsklassifikationIdentifikator) && !is_string($fESDsagsklassifikationIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fESDsagsklassifikationIdentifikator, true), gettype($fESDsagsklassifikationIdentifikator)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($fESDsagsklassifikationIdentifikator) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $fESDsagsklassifikationIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($fESDsagsklassifikationIdentifikator, true)), __LINE__); - } - $this->FESDsagsklassifikationIdentifikator = $fESDsagsklassifikationIdentifikator; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/MeddelelsesFormatObjektType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/MeddelelsesFormatObjektType.php deleted file mode 100644 index 6d881be..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/MeddelelsesFormatObjektType.php +++ /dev/null @@ -1,64 +0,0 @@ -setAny($any); - } - /** - * Get any value - * @uses \DOMDocument::loadXML() - * @param bool $asString true: returns XML string, false: returns \DOMDocument - * @return \DOMDocument|string|null - */ - public function getAny(bool $asDomDocument = false) - { - $domDocument = null; - if (!empty($this->any) && $asDomDocument) { - $domDocument = new \DOMDocument('1.0', 'UTF-8'); - $domDocument->loadXML($this->any); - } - return $asDomDocument ? $domDocument : $this->any; - } - /** - * Set any value - * @uses \DOMDocument::hasChildNodes() - * @uses \DOMDocument::saveXML() - * @uses \DOMNode::item() - * @param \DOMDocument|string|null $any - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\MeddelelsesFormatObjektType - */ - public function setAny($any = null): self - { - // validation for constraint: xml - if (!is_null($any) && !$any instanceof \DOMDocument && (!is_string($any) || (is_string($any) && (empty($any) || (($anyDoc = new \DOMDocument()) && false === $anyDoc->loadXML($any)))))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a valid XML string', var_export($any, true)), __LINE__); - } - $this->any = ($any instanceof \DOMDocument) ? $any->saveXML($any->hasChildNodes() ? $any->childNodes->item(0) : null) : $any; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PostParametreType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PostParametreType.php deleted file mode 100644 index fbb821f..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PostParametreType.php +++ /dev/null @@ -1,202 +0,0 @@ -setPostKategoriKode($postKategoriKode) - ->setAllokeringsIdentifikator($allokeringsIdentifikator) - ->setReturposthaandteringHosLeverandoerIndikator($returposthaandteringHosLeverandoerIndikator) - ->setInformationVedAdresseAendringIndikator($informationVedAdresseAendringIndikator) - ->setSideKvantitet($sideKvantitet); - } - /** - * Get PostKategoriKode value - * @return string|null - */ - public function getPostKategoriKode(): ?string - { - return $this->PostKategoriKode; - } - /** - * Set PostKategoriKode value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PostKategoriKodeType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PostKategoriKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $postKategoriKode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType - */ - public function setPostKategoriKode(?string $postKategoriKode = null): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PostKategoriKodeType::valueIsValid($postKategoriKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PostKategoriKodeType', is_array($postKategoriKode) ? implode(', ', $postKategoriKode) : var_export($postKategoriKode, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\PostKategoriKodeType::getValidValues())), __LINE__); - } - $this->PostKategoriKode = $postKategoriKode; - - return $this; - } - /** - * Get AllokeringsIdentifikator value - * @return int|null - */ - public function getAllokeringsIdentifikator(): ?int - { - return $this->AllokeringsIdentifikator; - } - /** - * Set AllokeringsIdentifikator value - * @param int $allokeringsIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType - */ - public function setAllokeringsIdentifikator(?int $allokeringsIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($allokeringsIdentifikator) && !(is_int($allokeringsIdentifikator) || ctype_digit($allokeringsIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($allokeringsIdentifikator, true), gettype($allokeringsIdentifikator)), __LINE__); - } - $this->AllokeringsIdentifikator = $allokeringsIdentifikator; - - return $this; - } - /** - * Get ReturposthaandteringHosLeverandoerIndikator value - * @return bool|null - */ - public function getReturposthaandteringHosLeverandoerIndikator(): ?bool - { - return $this->ReturposthaandteringHosLeverandoerIndikator; - } - /** - * Set ReturposthaandteringHosLeverandoerIndikator value - * @param bool $returposthaandteringHosLeverandoerIndikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType - */ - public function setReturposthaandteringHosLeverandoerIndikator(?bool $returposthaandteringHosLeverandoerIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($returposthaandteringHosLeverandoerIndikator) && !is_bool($returposthaandteringHosLeverandoerIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($returposthaandteringHosLeverandoerIndikator, true), gettype($returposthaandteringHosLeverandoerIndikator)), __LINE__); - } - $this->ReturposthaandteringHosLeverandoerIndikator = $returposthaandteringHosLeverandoerIndikator; - - return $this; - } - /** - * Get InformationVedAdresseAendringIndikator value - * @return bool|null - */ - public function getInformationVedAdresseAendringIndikator(): ?bool - { - return $this->InformationVedAdresseAendringIndikator; - } - /** - * Set InformationVedAdresseAendringIndikator value - * @param bool $informationVedAdresseAendringIndikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType - */ - public function setInformationVedAdresseAendringIndikator(?bool $informationVedAdresseAendringIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($informationVedAdresseAendringIndikator) && !is_bool($informationVedAdresseAendringIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($informationVedAdresseAendringIndikator, true), gettype($informationVedAdresseAendringIndikator)), __LINE__); - } - $this->InformationVedAdresseAendringIndikator = $informationVedAdresseAendringIndikator; - - return $this; - } - /** - * Get SideKvantitet value - * @return int|null - */ - public function getSideKvantitet(): ?int - { - return $this->SideKvantitet; - } - /** - * Set SideKvantitet value - * @param int $sideKvantitet - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PostParametreType - */ - public function setSideKvantitet(?int $sideKvantitet = null): self - { - // validation for constraint: int - if (!is_null($sideKvantitet) && !(is_int($sideKvantitet) || ctype_digit($sideKvantitet))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($sideKvantitet, true), gettype($sideKvantitet)), __LINE__); - } - // validation for constraint: minInclusive - if (!is_null($sideKvantitet) && $sideKvantitet < 0) { - throw new InvalidArgumentException(sprintf('Invalid value %s, the value must be numerically greater than or equal to 0', var_export($sideKvantitet, true)), __LINE__); - } - $this->SideKvantitet = $sideKvantitet; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintAfsendBrevRequestType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintAfsendBrevRequestType.php deleted file mode 100644 index 2366a30..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintAfsendBrevRequestType.php +++ /dev/null @@ -1,146 +0,0 @@ -setBrevSPBody($brevSPBody) - ->setInvocationContext($invocationContext) - ->setAuthorityContext($authorityContext) - ->setCallContext($callContext); - } - /** - * Get BrevSPBody value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BrevSPBodyType - */ - public function getBrevSPBody(): \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BrevSPBodyType - { - return $this->BrevSPBody; - } - /** - * Set BrevSPBody value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BrevSPBodyType $brevSPBody - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintAfsendBrevRequestType - */ - public function setBrevSPBody(\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\BrevSPBodyType $brevSPBody): self - { - $this->BrevSPBody = $brevSPBody; - - return $this; - } - /** - * Get InvocationContext value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType|null - */ - public function getInvocationContext(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - { - return $this->InvocationContext; - } - /** - * Set InvocationContext value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType $invocationContext - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintAfsendBrevRequestType - */ - public function setInvocationContext(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType $invocationContext = null): self - { - $this->InvocationContext = $invocationContext; - - return $this; - } - /** - * Get AuthorityContext value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType|null - */ - public function getAuthorityContext(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType - { - return $this->AuthorityContext; - } - /** - * Set AuthorityContext value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType $authorityContext - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintAfsendBrevRequestType - */ - public function setAuthorityContext(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType $authorityContext = null): self - { - $this->AuthorityContext = $authorityContext; - - return $this; - } - /** - * Get CallContext value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType|null - */ - public function getCallContext(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType - { - return $this->CallContext; - } - /** - * Set CallContext value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType $callContext - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintAfsendBrevRequestType - */ - public function setCallContext(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType $callContext = null): self - { - $this->CallContext = $callContext; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintAfsendBrevResponseType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintAfsendBrevResponseType.php deleted file mode 100644 index dc24d72..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintAfsendBrevResponseType.php +++ /dev/null @@ -1,57 +0,0 @@ -setResultat($resultat); - } - /** - * Get resultat value - * @return bool - */ - public function getResultat(): bool - { - return $this->resultat; - } - /** - * Set resultat value - * @param bool $resultat - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintAfsendBrevResponseType - */ - public function setResultat(bool $resultat): self - { - // validation for constraint: boolean - if (!is_null($resultat) && !is_bool($resultat)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($resultat, true), gettype($resultat)), __LINE__); - } - $this->resultat = $resultat; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintParametreType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintParametreType.php deleted file mode 100644 index 0167907..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintParametreType.php +++ /dev/null @@ -1,134 +0,0 @@ -setSimplexDuplexKode($simplexDuplexKode) - ->setFarveSHKode($farveSHKode) - ->setKuvertTypeKode($kuvertTypeKode); - } - /** - * Get SimplexDuplexKode value - * @return string|null - */ - public function getSimplexDuplexKode(): ?string - { - return $this->SimplexDuplexKode; - } - /** - * Set SimplexDuplexKode value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\SimplexDuplexKodeType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\SimplexDuplexKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $simplexDuplexKode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintParametreType - */ - public function setSimplexDuplexKode(?string $simplexDuplexKode = null): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\SimplexDuplexKodeType::valueIsValid($simplexDuplexKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\SimplexDuplexKodeType', is_array($simplexDuplexKode) ? implode(', ', $simplexDuplexKode) : var_export($simplexDuplexKode, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\SimplexDuplexKodeType::getValidValues())), __LINE__); - } - $this->SimplexDuplexKode = $simplexDuplexKode; - - return $this; - } - /** - * Get FarveSHKode value - * @return string|null - */ - public function getFarveSHKode(): ?string - { - return $this->FarveSHKode; - } - /** - * Set FarveSHKode value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\FarveSHKodeType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\FarveSHKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $farveSHKode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintParametreType - */ - public function setFarveSHKode(?string $farveSHKode = null): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\FarveSHKodeType::valueIsValid($farveSHKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\FarveSHKodeType', is_array($farveSHKode) ? implode(', ', $farveSHKode) : var_export($farveSHKode, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\FarveSHKodeType::getValidValues())), __LINE__); - } - $this->FarveSHKode = $farveSHKode; - - return $this; - } - /** - * Get KuvertTypeKode value - * @return string|null - */ - public function getKuvertTypeKode(): ?string - { - return $this->KuvertTypeKode; - } - /** - * Set KuvertTypeKode value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KuvertTypeKodeType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KuvertTypeKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $kuvertTypeKode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintParametreType - */ - public function setKuvertTypeKode(?string $kuvertTypeKode = null): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KuvertTypeKodeType::valueIsValid($kuvertTypeKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KuvertTypeKodeType', is_array($kuvertTypeKode) ? implode(', ', $kuvertTypeKode) : var_export($kuvertTypeKode, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KuvertTypeKodeType::getValidValues())), __LINE__); - } - $this->KuvertTypeKode = $kuvertTypeKode; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintSpoergTilmeldingRequestType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintSpoergTilmeldingRequestType.php deleted file mode 100644 index 3b6ce04..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintSpoergTilmeldingRequestType.php +++ /dev/null @@ -1,146 +0,0 @@ -setTilmeldingRequest($tilmeldingRequest) - ->setInvocationContext($invocationContext) - ->setAuthorityContext($authorityContext) - ->setCallContext($callContext); - } - /** - * Get TilmeldingRequest value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TilmeldingRequestType - */ - public function getTilmeldingRequest(): \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TilmeldingRequestType - { - return $this->TilmeldingRequest; - } - /** - * Set TilmeldingRequest value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TilmeldingRequestType $tilmeldingRequest - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintSpoergTilmeldingRequestType - */ - public function setTilmeldingRequest(\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TilmeldingRequestType $tilmeldingRequest): self - { - $this->TilmeldingRequest = $tilmeldingRequest; - - return $this; - } - /** - * Get InvocationContext value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType|null - */ - public function getInvocationContext(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType - { - return $this->InvocationContext; - } - /** - * Set InvocationContext value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType $invocationContext - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintSpoergTilmeldingRequestType - */ - public function setInvocationContext(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\InvocationContextType $invocationContext = null): self - { - $this->InvocationContext = $invocationContext; - - return $this; - } - /** - * Get AuthorityContext value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType|null - */ - public function getAuthorityContext(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType - { - return $this->AuthorityContext; - } - /** - * Set AuthorityContext value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType $authorityContext - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintSpoergTilmeldingRequestType - */ - public function setAuthorityContext(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\AuthorityContextType $authorityContext = null): self - { - $this->AuthorityContext = $authorityContext; - - return $this; - } - /** - * Get CallContext value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType|null - */ - public function getCallContext(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType - { - return $this->CallContext; - } - /** - * Set CallContext value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType $callContext - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintSpoergTilmeldingRequestType - */ - public function setCallContext(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\CallContextType $callContext = null): self - { - $this->CallContext = $callContext; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintSpoergTilmeldingResponseType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintSpoergTilmeldingResponseType.php deleted file mode 100644 index 4986360..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/PrintSpoergTilmeldingResponseType.php +++ /dev/null @@ -1,57 +0,0 @@ -setTilmeldt($tilmeldt); - } - /** - * Get tilmeldt value - * @return bool - */ - public function getTilmeldt(): bool - { - return $this->tilmeldt; - } - /** - * Set tilmeldt value - * @param bool $tilmeldt - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintSpoergTilmeldingResponseType - */ - public function setTilmeldt(bool $tilmeldt): self - { - // validation for constraint: boolean - if (!is_null($tilmeldt) && !is_bool($tilmeldt)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($tilmeldt, true), gettype($tilmeldt)), __LINE__); - } - $this->tilmeldt = $tilmeldt; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ServiceplatformFaultType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ServiceplatformFaultType.php deleted file mode 100644 index 5c3f929..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/ServiceplatformFaultType.php +++ /dev/null @@ -1,53 +0,0 @@ -setErrorList($errorList); - } - /** - * Get ErrorList value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorListType|null - */ - public function getErrorList(): ?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorListType - { - return $this->ErrorList; - } - /** - * Set ErrorList value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorListType $errorList - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ServiceplatformFaultType - */ - public function setErrorList(?\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\ErrorListType $errorList = null): self - { - $this->ErrorList = $errorList; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/SlutbrugerIdentitetType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/SlutbrugerIdentitetType.php deleted file mode 100644 index fa49ce2..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/SlutbrugerIdentitetType.php +++ /dev/null @@ -1,187 +0,0 @@ -setCPRnummerIdentifikator($cPRnummerIdentifikator) - ->setCVRnummerIdentifikator($cVRnummerIdentifikator); - } - /** - * Get CPRnummerIdentifikator value - * @return string|null - */ - public function getCPRnummerIdentifikator(): ?string - { - return isset($this->CPRnummerIdentifikator) ? $this->CPRnummerIdentifikator : null; - } - /** - * This method is responsible for validating the value passed to the setCPRnummerIdentifikator method - * This method is willingly generated in order to preserve the one-line inline validation within the setCPRnummerIdentifikator method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateCPRnummerIdentifikatorForChoiceConstraintsFromSetCPRnummerIdentifikator($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CVRnummerIdentifikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property CPRnummerIdentifikator can\'t be set as the property %s is already set. Only one property must be set among these properties: CPRnummerIdentifikator, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set CPRnummerIdentifikator value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $cPRnummerIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType - */ - public function setCPRnummerIdentifikator(?string $cPRnummerIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($cPRnummerIdentifikator) && !is_string($cPRnummerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cPRnummerIdentifikator, true), gettype($cPRnummerIdentifikator)), __LINE__); - } - // validation for constraint: choice(CPRnummerIdentifikator, CVRnummerIdentifikator) - if ('' !== ($cPRnummerIdentifikatorChoiceErrorMessage = self::validateCPRnummerIdentifikatorForChoiceConstraintsFromSetCPRnummerIdentifikator($cPRnummerIdentifikator))) { - throw new InvalidArgumentException($cPRnummerIdentifikatorChoiceErrorMessage, __LINE__); - } - // validation for constraint: pattern(((((0[1-9]|1[0-9]|2[0-9]|3[0-1])(01|03|05|07|08|10|12))|((0[1-9]|1[0-9]|2[0-9]|30)(04|06|09|11))|((0[1-9]|1[0-9]|2[0-9])(02)))[0-9]{6})|0000000000) - if (!is_null($cPRnummerIdentifikator) && !preg_match('/((((0[1-9]|1[0-9]|2[0-9]|3[0-1])(01|03|05|07|08|10|12))|((0[1-9]|1[0-9]|2[0-9]|30)(04|06|09|11))|((0[1-9]|1[0-9]|2[0-9])(02)))[0-9]{6})|0000000000/', $cPRnummerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /((((0[1-9]|1[0-9]|2[0-9]|3[0-1])(01|03|05|07|08|10|12))|((0[1-9]|1[0-9]|2[0-9]|30)(04|06|09|11))|((0[1-9]|1[0-9]|2[0-9])(02)))[0-9]{6})|0000000000/', var_export($cPRnummerIdentifikator, true)), __LINE__); - } - if (is_null($cPRnummerIdentifikator) || (is_array($cPRnummerIdentifikator) && empty($cPRnummerIdentifikator))) { - unset($this->CPRnummerIdentifikator); - } else { - $this->CPRnummerIdentifikator = $cPRnummerIdentifikator; - } - - return $this; - } - /** - * Get CVRnummerIdentifikator value - * @return string|null - */ - public function getCVRnummerIdentifikator(): ?string - { - return isset($this->CVRnummerIdentifikator) ? $this->CVRnummerIdentifikator : null; - } - /** - * This method is responsible for validating the value passed to the setCVRnummerIdentifikator method - * This method is willingly generated in order to preserve the one-line inline validation within the setCVRnummerIdentifikator method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateCVRnummerIdentifikatorForChoiceConstraintsFromSetCVRnummerIdentifikator($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CPRnummerIdentifikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property CVRnummerIdentifikator can\'t be set as the property %s is already set. Only one property must be set among these properties: CVRnummerIdentifikator, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set CVRnummerIdentifikator value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $cVRnummerIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType - */ - public function setCVRnummerIdentifikator(?string $cVRnummerIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($cVRnummerIdentifikator) && !is_string($cVRnummerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cVRnummerIdentifikator, true), gettype($cVRnummerIdentifikator)), __LINE__); - } - // validation for constraint: choice(CPRnummerIdentifikator, CVRnummerIdentifikator) - if ('' !== ($cVRnummerIdentifikatorChoiceErrorMessage = self::validateCVRnummerIdentifikatorForChoiceConstraintsFromSetCVRnummerIdentifikator($cVRnummerIdentifikator))) { - throw new InvalidArgumentException($cVRnummerIdentifikatorChoiceErrorMessage, __LINE__); - } - // validation for constraint: length(8) - if (!is_null($cVRnummerIdentifikator) && mb_strlen((string) $cVRnummerIdentifikator) !== 8) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be equal to 8', mb_strlen((string) $cVRnummerIdentifikator)), __LINE__); - } - if (is_null($cVRnummerIdentifikator) || (is_array($cVRnummerIdentifikator) && empty($cVRnummerIdentifikator))) { - unset($this->CVRnummerIdentifikator); - } else { - $this->CVRnummerIdentifikator = $cVRnummerIdentifikator; - } - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/TilmeldingRequestType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/TilmeldingRequestType.php deleted file mode 100644 index 821756a..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/TilmeldingRequestType.php +++ /dev/null @@ -1,88 +0,0 @@ -setSlutbrugerIdentitet($slutbrugerIdentitet) - ->setMeddelelseIndholdstypeIdentifikator($meddelelseIndholdstypeIdentifikator); - } - /** - * Get SlutbrugerIdentitet value - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType - */ - public function getSlutbrugerIdentitet(): \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType - { - return $this->SlutbrugerIdentitet; - } - /** - * Set SlutbrugerIdentitet value - * @param \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType $slutbrugerIdentitet - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TilmeldingRequestType - */ - public function setSlutbrugerIdentitet(\ItkDev\OS2Forms_Digital_Post\PrintService\StructType\SlutbrugerIdentitetType $slutbrugerIdentitet): self - { - $this->SlutbrugerIdentitet = $slutbrugerIdentitet; - - return $this; - } - /** - * Get MeddelelseIndholdstypeIdentifikator value - * @return int|null - */ - public function getMeddelelseIndholdstypeIdentifikator(): ?int - { - return $this->MeddelelseIndholdstypeIdentifikator; - } - /** - * Set MeddelelseIndholdstypeIdentifikator value - * @param int $meddelelseIndholdstypeIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TilmeldingRequestType - */ - public function setMeddelelseIndholdstypeIdentifikator(?int $meddelelseIndholdstypeIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($meddelelseIndholdstypeIdentifikator) && !(is_int($meddelelseIndholdstypeIdentifikator) || ctype_digit($meddelelseIndholdstypeIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($meddelelseIndholdstypeIdentifikator, true), gettype($meddelelseIndholdstypeIdentifikator)), __LINE__); - } - $this->MeddelelseIndholdstypeIdentifikator = $meddelelseIndholdstypeIdentifikator; - - return $this; - } -} diff --git a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/TransaktionsParametreIType.php b/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/TransaktionsParametreIType.php deleted file mode 100644 index 2b635d9..0000000 --- a/generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/StructType/TransaktionsParametreIType.php +++ /dev/null @@ -1,183 +0,0 @@ -\(\)\[\]\\,;:@\s]{0,191}@[^>\(\)\[\]\\,;:@\s]{1,64}) - * - ref: fjernprint:KvitteringsEmail - * @var string|null - */ - protected ?string $KvitteringsEmail = null; - /** - * Constructor method for TransaktionsParametreIType - * @uses TransaktionsParametreIType::setTransaktionsDatoTid() - * @uses TransaktionsParametreIType::setMasseForsendelseIdentifikator() - * @uses TransaktionsParametreIType::setKvitteringsTypeKode() - * @uses TransaktionsParametreIType::setKvitteringsEmail() - * @param string $transaktionsDatoTid - * @param string $masseForsendelseIdentifikator - * @param string $kvitteringsTypeKode - * @param string $kvitteringsEmail - */ - public function __construct(?string $transaktionsDatoTid = null, ?string $masseForsendelseIdentifikator = null, ?string $kvitteringsTypeKode = null, ?string $kvitteringsEmail = null) - { - $this - ->setTransaktionsDatoTid($transaktionsDatoTid) - ->setMasseForsendelseIdentifikator($masseForsendelseIdentifikator) - ->setKvitteringsTypeKode($kvitteringsTypeKode) - ->setKvitteringsEmail($kvitteringsEmail); - } - /** - * Get TransaktionsDatoTid value - * @return string|null - */ - public function getTransaktionsDatoTid(): ?string - { - return $this->TransaktionsDatoTid; - } - /** - * Set TransaktionsDatoTid value - * @param string $transaktionsDatoTid - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TransaktionsParametreIType - */ - public function setTransaktionsDatoTid(?string $transaktionsDatoTid = null): self - { - // validation for constraint: string - if (!is_null($transaktionsDatoTid) && !is_string($transaktionsDatoTid)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transaktionsDatoTid, true), gettype($transaktionsDatoTid)), __LINE__); - } - $this->TransaktionsDatoTid = $transaktionsDatoTid; - - return $this; - } - /** - * Get MasseForsendelseIdentifikator value - * @return string|null - */ - public function getMasseForsendelseIdentifikator(): ?string - { - return $this->MasseForsendelseIdentifikator; - } - /** - * Set MasseForsendelseIdentifikator value - * @param string $masseForsendelseIdentifikator - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TransaktionsParametreIType - */ - public function setMasseForsendelseIdentifikator(?string $masseForsendelseIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($masseForsendelseIdentifikator) && !is_string($masseForsendelseIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($masseForsendelseIdentifikator, true), gettype($masseForsendelseIdentifikator)), __LINE__); - } - // validation for constraint: maxLength(38) - if (!is_null($masseForsendelseIdentifikator) && mb_strlen((string) $masseForsendelseIdentifikator) > 38) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 38', mb_strlen((string) $masseForsendelseIdentifikator)), __LINE__); - } - // validation for constraint: minLength(1) - if (!is_null($masseForsendelseIdentifikator) && mb_strlen((string) $masseForsendelseIdentifikator) < 1) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be greater than or equal to 1', mb_strlen((string) $masseForsendelseIdentifikator)), __LINE__); - } - $this->MasseForsendelseIdentifikator = $masseForsendelseIdentifikator; - - return $this; - } - /** - * Get KvitteringsTypeKode value - * @return string|null - */ - public function getKvitteringsTypeKode(): ?string - { - return $this->KvitteringsTypeKode; - } - /** - * Set KvitteringsTypeKode value - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KvitteringsTypeKodeType::valueIsValid() - * @uses \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KvitteringsTypeKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $kvitteringsTypeKode - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TransaktionsParametreIType - */ - public function setKvitteringsTypeKode(?string $kvitteringsTypeKode = null): self - { - // validation for constraint: enumeration - if (!\ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KvitteringsTypeKodeType::valueIsValid($kvitteringsTypeKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KvitteringsTypeKodeType', is_array($kvitteringsTypeKode) ? implode(', ', $kvitteringsTypeKode) : var_export($kvitteringsTypeKode, true), implode(', ', \ItkDev\OS2Forms_Digital_Post\PrintService\EnumType\KvitteringsTypeKodeType::getValidValues())), __LINE__); - } - $this->KvitteringsTypeKode = $kvitteringsTypeKode; - - return $this; - } - /** - * Get KvitteringsEmail value - * @return string|null - */ - public function getKvitteringsEmail(): ?string - { - return $this->KvitteringsEmail; - } - /** - * Set KvitteringsEmail value - * @param string $kvitteringsEmail - * @return \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\TransaktionsParametreIType - */ - public function setKvitteringsEmail(?string $kvitteringsEmail = null): self - { - // validation for constraint: string - if (!is_null($kvitteringsEmail) && !is_string($kvitteringsEmail)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($kvitteringsEmail, true), gettype($kvitteringsEmail)), __LINE__); - } - // validation for constraint: pattern(([^>\(\)\[\]\\,;:@\s]{0,191}@[^>\(\)\[\]\\,;:@\s]{1,64})) - if (!is_null($kvitteringsEmail) && !preg_match('/([^>\\(\\)\\[\\]\\\\,;:@\\s]{0,191}@[^>\\(\\)\\[\\]\\\\,;:@\\s]{1,64})/', $kvitteringsEmail)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /([^>\\(\\)\\[\\]\\\\,;:@\\s]{0,191}@[^>\\(\\)\\[\\]\\\\,;:@\\s]{1,64})/', var_export($kvitteringsEmail, true)), __LINE__); - } - $this->KvitteringsEmail = $kvitteringsEmail; - - return $this; - } -} diff --git a/generated-sources/PrintService/tutorial.php b/generated-sources/PrintService/tutorial.php deleted file mode 100644 index 0322841..0000000 --- a/generated-sources/PrintService/tutorial.php +++ /dev/null @@ -1,49 +0,0 @@ - '../resources/contracts/PrintService/wsdl/context/PrintService.wsdl', - * WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_TRACE => true, - * WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_LOGIN => 'you_secret_login', - * WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_PASSWORD => 'you_secret_password', - * ]; - * etc... - * ################################################################################ - * Don't forget to add wsdltophp/packagebase:~5.0 to your main composer.json. - * ################################################################################ - */ -/** - * Minimal options - */ -$options = [ - WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => '../resources/contracts/PrintService/wsdl/context/PrintService.wsdl', - WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \ItkDev\OS2Forms_Digital_Post\PrintService\ClassMap::get(), -]; -/** - * Samples for Afsend ServiceType - */ -$afsend = new \ItkDev\OS2Forms_Digital_Post\PrintService\ServiceType\Afsend($options); -/** - * Sample call for afsendBrev operation/method - */ -if ($afsend->afsendBrev(new \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintAfsendBrevRequestType()) !== false) { - print_r($afsend->getResult()); -} else { - print_r($afsend->getLastError()); -} -/** - * Samples for Spoerg ServiceType - */ -$spoerg = new \ItkDev\OS2Forms_Digital_Post\PrintService\ServiceType\Spoerg($options); -/** - * Sample call for spoergTilmelding operation/method - */ -if ($spoerg->spoergTilmelding(new \ItkDev\OS2Forms_Digital_Post\PrintService\StructType\PrintSpoergTilmeldingRequestType()) !== false) { - print_r($spoerg->getResult()); -} else { - print_r($spoerg->getLastError()); -} diff --git a/os2forms_digital_post.info.yml b/os2forms_digital_post.info.yml index 79c6eb5..266ecf7 100644 --- a/os2forms_digital_post.info.yml +++ b/os2forms_digital_post.info.yml @@ -5,6 +5,7 @@ package: 'OS2Forms' core_version_requirement: ^9 dependencies: - 'beskedfordeler:beskedfordeler' + - 'drupal:advancedqueue' - 'os2web_datalookup:os2web_datalookup' - 'webform:webform' - 'webform:webform_submission_log' diff --git a/os2forms_digital_post.services.yml b/os2forms_digital_post.services.yml index 30e7d93..2b7a0ad 100644 --- a/os2forms_digital_post.services.yml +++ b/os2forms_digital_post.services.yml @@ -3,24 +3,6 @@ services: parent: logger.channel_base arguments: [ 'os2forms_digital_post' ] - os2forms_digital_post.template_manager: - class: Drupal\os2forms_digital_post\Manager\TemplateManager - arguments: ["@config.factory", "@twig", "@twig.loader.filesystem"] - - os2forms_digital_post.print_service_consumer: - class: Drupal\os2forms_digital_post\Consumer\PrintServiceConsumer - arguments: ["@config.factory", "@http_client", "@lock", "@state", "@uuid"] - - os2forms_digital_post.webform_helper: - class: Drupal\os2forms_digital_post\Helper\WebformHelper - arguments: - - "@entity_type.manager" - - "@renderer" - - "@plugin.manager.os2web_datalookup" - - "@os2forms_digital_post.print_service_consumer" - - "@os2forms_digital_post.template_manager" - - "@logger.factory" - Drupal\os2forms_digital_post\Helper\Settings: arguments: - "@keyvalue" diff --git a/phpcs.xml.dist b/phpcs.xml.dist index a81e1e1..afd36d2 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -3,9 +3,7 @@ The coding standard. . - generated-sources/ vendor/ - src/Client/ diff --git a/phpstan.neon b/phpstan.neon index 46acb27..16572fc 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,9 +6,6 @@ parameters: # @see https://github.com/mglaman/drupal-check/issues/261#issuecomment-1030141772/ - vendor - '*/node_modules/*' - # Auto-generated code - - generated-sources - - '*/Client/*' ignoreErrors: - # Ignore some weird errors reported by PHPStan diff --git a/resources/contracts/PrintService/PrintServiceMsg.xsd b/resources/contracts/PrintService/PrintServiceMsg.xsd deleted file mode 100644 index 4f6e44e..0000000 --- a/resources/contracts/PrintService/PrintServiceMsg.xsd +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Aa.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Aa.xsd deleted file mode 100644 index 3115b62..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Aa.xsd +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Afsendelse.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Afsendelse.xsd deleted file mode 100644 index 1ff8d70..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Afsendelse.xsd +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseDatoTid.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseDatoTid.xsd deleted file mode 100644 index 760818b..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseDatoTid.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseIdentifikator.xsd deleted file mode 100644 index daf2eb8..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseIdentifikator.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseModtager.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseModtager.xsd deleted file mode 100644 index 84e8dc8..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseModtager.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseTilstandNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseTilstandNavn.xsd deleted file mode 100644 index 1ee149e..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseTilstandNavn.xsd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseURLreference.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseURLreference.xsd deleted file mode 100644 index f5069f9..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsendelseURLreference.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsenderAdresse.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsenderAdresse.xsd deleted file mode 100644 index c5b1958..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsenderAdresse.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsenderSystemIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsenderSystemIdentifikator.xsd deleted file mode 100644 index 6bbbae4..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AfsenderSystemIdentifikator.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AllokeringsIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AllokeringsIdentifikator.xsd deleted file mode 100644 index 098aaaf..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/AllokeringsIdentifikator.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Bilag.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Bilag.xsd deleted file mode 100644 index 69b3efa..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Bilag.xsd +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagIdentifikator.xsd deleted file mode 100644 index 6003f9a..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagIdentifikator.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagNavn.xsd deleted file mode 100644 index 8b32854..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagNavn.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagSamling.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagSamling.xsd deleted file mode 100644 index d165c78..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagSamling.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagSorteringsIndeksIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagSorteringsIndeksIdentifikator.xsd deleted file mode 100644 index fef870d..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BilagSorteringsIndeksIdentifikator.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BrevDato.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BrevDato.xsd deleted file mode 100644 index 9199770..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BrevDato.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BrugerNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BrugerNavn.xsd deleted file mode 100644 index fb532f7..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/BrugerNavn.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPR_CompletePostalLabelText.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPR_CompletePostalLabelText.xsd deleted file mode 100644 index cf9bdde..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPR_CompletePostalLabelText.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPR_PersonCivilRegistrationIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPR_PersonCivilRegistrationIdentifier.xsd deleted file mode 100644 index c56fe94..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPR_PersonCivilRegistrationIdentifier.xsd +++ /dev/null @@ -1,40 +0,0 @@ - - - - - CivilRegistrationNumber (PNR) - - Description: - Unique identification of a person - - The Civil Registration System contains: - - Data on persons, who after 1968 April 2nd Danish registry of citizens. - As for Greenland the corresponding date is 1972 may 1st. - - Danish citizens living outside Denmark (who must pay duty and ATP) - has also been given a civil registration number. - - Civil registration numbers are also assigned for other administrative purposes. - - - Value space: - The civil registration number consists of two parts. - The first part is the valid birthday in the form DDMMYY. - The following part is a serial number of four digits. - The civil registration number may also hold the value 0000000000. - This value is used where the civil registration number is required but unknown. - - Lifecycle: - The civil registration number is generated and assigned at birth, entry and change of civil registration number of for administrative reasons. - The civil registration number may be assigned via hospitals. - - The civil registration number is not to be deleted. - - Remarks: - 1994 June 11th the civil registration number was changed according to this description. - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPRnummerIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPRnummerIdentifikator.xsd deleted file mode 100644 index d7e135f..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CPRnummerIdentifikator.xsd +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CVR_CVRnumberIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CVR_CVRnumberIdentifier.xsd deleted file mode 100644 index d6b533c..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CVR_CVRnumberIdentifier.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Unique and generally usable identifier for all legal units included i CVR. - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CVRnummerIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CVRnummerIdentifikator.xsd deleted file mode 100644 index 67d3c78..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CVRnummerIdentifikator.xsd +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CallContext.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CallContext.xsd deleted file mode 100644 index 61493dc..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CallContext.xsd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CoNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CoNavn.xsd deleted file mode 100644 index 6c638f4..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/CoNavn.xsd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_CountryIdentificationCode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_CountryIdentificationCode.xsd deleted file mode 100644 index 6146a36..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_CountryIdentificationCode.xsd +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - The country code based on the 4 diffent schemes. - Landeidentifikations kode baseret på de 4 forskellige formater. - - - - - - - - - - This is a support type for CountryIdentificationCodeType. The pattern is a choice of 4 different patterns for different schems. ISO 3166 standard, alpha 2: [a-z,A-Z]{2}. Eksample "DK" for Danmark. ISO 3166 standard, alpha 3: [a-z,A-Z]{3}. Eksample "DKN" for Danmark. UN Statistics Divisions country codes: [0-9]{3}. Eksample "208" for Danmark AuthorityCode from the Central Office of Civil Registration: [0-9]{4}. Eksample "5100" for Danmark. - Dette er en støttetype til CountryIdentificationCodeType. Det regulære udtryk er et valg for de 4 forskellige regulære udtryk for de forskellige formater. ISO 3166 standard, alpha 2: [a-z,A-Z]{2}. Eksempel "DK" for Danmark. ISO 3166 standard, alpha 3: [a-z,A-Z]{3}. Eksempel "DKN" for Danmark. UN Statistics Divisions country codes: [0-9]{3}. Eksempel "208" for Danmark AuthorityCode from the Central Office of Civil Registration: [0-9]{4}. Eksempel "5100" for Danmark. - - - - - - - - This is a support type for CountryIdentificationCodeType. - Dette er en støttetype til CountryIdentificationCodeType. - - - - - This scheme follows the ISO 3166 standard, alpha 2. - Dette format følge ISO 3166 standarden, alpha 2. - - - - - This scheme follows the ISO 3166 standard, alpha 3. - Dette format følge ISO 3166 standarden, alpha 3. - - - - - This scheme follows the UN Statistics Divisions country codes. - Dette format følger FNs Statistik Kontor landekoder - - - - - This scheme follows the AuthorityCode from the Central Office of Civil Registration. - Dette format følger MyndighedsKoden fra Det Centrale Personregister - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_DistrictName.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_DistrictName.xsd deleted file mode 100644 index 1a1ae08..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_DistrictName.xsd +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Declares the name of a postal district in plain text. -The field contains 20 positions, which enables it to fit a window envelope -together with the postal code and one free position in addition. The postal -district is defined by municipalitycode, roadcode, postalcode, housenumber -from/to together with a code, which declares whether the roadsection in -question contains even or uneven housenumbers. - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_DistrictSubdivisionIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_DistrictSubdivisionIdentifier.xsd deleted file mode 100644 index e87c720..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_DistrictSubdivisionIdentifier.xsd +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Name of a village, city or subdivision of a city or district, which is determined as a part of the official address specification for a certain street or specific parts of a street, defined by intervals of street building identifiers (da: house numbers). - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_FloorIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_FloorIdentifier.xsd deleted file mode 100644 index c213bcf..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_FloorIdentifier.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Identification which describes the floor or level on which a specific entrance door, appartment or suite is placed, in the staircase refered to. - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_MailDeliverySublocationIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_MailDeliverySublocationIdentifier.xsd deleted file mode 100644 index 5a280d5..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_MailDeliverySublocationIdentifier.xsd +++ /dev/null @@ -1,14 +0,0 @@ - - - - - The given name of a farm, estate, building or dwelling, which is used as a additional postal address identifier. - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostCodeIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostCodeIdentifier.xsd deleted file mode 100644 index ffe1bfe..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostCodeIdentifier.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - The postal departments nationwide postal code. - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostOfficeBoxIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostOfficeBoxIdentifier.xsd deleted file mode 100644 index 82a0d2f..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostOfficeBoxIdentifier.xsd +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Declaration of a Post Office Box. - - - - - Declaration of a Post Office Box. - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFifthLineText.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFifthLineText.xsd deleted file mode 100644 index 2ba8710..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFifthLineText.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFirstLineText.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFirstLineText.xsd deleted file mode 100644 index 39937ff..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFirstLineText.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFourthLineText.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFourthLineText.xsd deleted file mode 100644 index 05b0c2c..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressFourthLineText.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressSecondLineText.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressSecondLineText.xsd deleted file mode 100644 index 9723f12..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressSecondLineText.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressSixthLineText.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressSixthLineText.xsd deleted file mode 100644 index d5d9239..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressSixthLineText.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressThirdLineText.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressThirdLineText.xsd deleted file mode 100644 index c0fe822..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_PostalAddressThirdLineText.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_StreetBuildingIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_StreetBuildingIdentifier.xsd deleted file mode 100644 index f8607e1..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_StreetBuildingIdentifier.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Numeric identification (da: house number ~ 'husnummer') including an optional letter, which identifies a certain access to a building, a plot/piece of land or a plant etc. based on the named road or street which gives access hereto. The identifier is determined in increasing numerical and letter order along the road, normally with even numbers on the right side and odd numbers on the left side of the road. - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_StreetName.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_StreetName.xsd deleted file mode 100644 index 6a63ded..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_StreetName.xsd +++ /dev/null @@ -1,14 +0,0 @@ - - - - - The approved name of a road, a street, a square, a path and the like. Further more street names can be connected to other particularly limited areas like garden associations or summer residence areas without road network, large commercial or institutional areas with a large number of buildings, smaller islands without road network, larger sporting facilities and the like. - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_SuiteIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_SuiteIdentifier.xsd deleted file mode 100644 index ec855c4..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DKCC_SuiteIdentifier.xsd +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Identification which describes the location of a specific entrance door on a floor or level (repos) in the staircase referred to. - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DigitalPostParametre.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DigitalPostParametre.xsd deleted file mode 100644 index 4df675c..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DigitalPostParametre.xsd +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DokumentParametre.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DokumentParametre.xsd deleted file mode 100644 index 1f48fad..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/DokumentParametre.xsd +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/EnhedTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/EnhedTekst.xsd deleted file mode 100644 index f9865b6..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/EnhedTekst.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDaktoerIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDaktoerIdentifikator.xsd deleted file mode 100644 index f67ac96..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDaktoerIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDdokumentIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDdokumentIdentifikator.xsd deleted file mode 100644 index 74dfb34..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDdokumentIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDsagIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDsagIdentifikator.xsd deleted file mode 100644 index 5781768..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDsagIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDsagsklassifikationIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDsagsklassifikationIdentifikator.xsd deleted file mode 100644 index 3817417..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FESDsagsklassifikationIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FarveSHKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FarveSHKode.xsd deleted file mode 100644 index 451bddf..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FarveSHKode.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Fejl.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Fejl.xsd deleted file mode 100644 index 99edbad..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Fejl.xsd +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlIdentifikator.xsd deleted file mode 100644 index 88c329f..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlIdentifikator.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlKode.xsd deleted file mode 100644 index 79abc1f..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlKode.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlTekst.xsd deleted file mode 100644 index e795363..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlTekst.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlbeskedTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlbeskedTekst.xsd deleted file mode 100644 index c39d3d8..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FejlbeskedTekst.xsd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FilformatNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FilformatNavn.xsd deleted file mode 100644 index a32fe34..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/FilformatNavn.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseAfsender.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseAfsender.xsd deleted file mode 100644 index dd50c7e..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseAfsender.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseI.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseI.xsd deleted file mode 100644 index 639ee6a..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseI.xsd +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseModtager.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseModtager.xsd deleted file mode 100644 index cf739d1..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseModtager.xsd +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseStatus.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseStatus.xsd deleted file mode 100644 index 3f7f642..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseStatus.xsd +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseTypeIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseTypeIdentifikator.xsd deleted file mode 100644 index e24231b..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ForsendelseTypeIdentifikator.xsd +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/HasteBrevIndikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/HasteBrevIndikator.xsd deleted file mode 100644 index cb1b071..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/HasteBrevIndikator.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ITST_PersonName.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ITST_PersonName.xsd deleted file mode 100644 index 1bee36c..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ITST_PersonName.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/IndholdStoerrelseMaal.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/IndholdStoerrelseMaal.xsd deleted file mode 100644 index 44af303..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/IndholdStoerrelseMaal.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/InformationVedAdresseAendringIndikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/InformationVedAdresseAendringIndikator.xsd deleted file mode 100644 index 365ca6c..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/InformationVedAdresseAendringIndikator.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KanalKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KanalKode.xsd deleted file mode 100644 index 0643641..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KanalKode.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KanalUafhaengigeParametreI.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KanalUafhaengigeParametreI.xsd deleted file mode 100644 index e46ec5a..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KanalUafhaengigeParametreI.xsd +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KontaktOplysning.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KontaktOplysning.xsd deleted file mode 100644 index e477af1..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KontaktOplysning.xsd +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KonteringsGruppeTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KonteringsGruppeTekst.xsd deleted file mode 100644 index a4196a0..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KonteringsGruppeTekst.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KuvertTypeKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KuvertTypeKode.xsd deleted file mode 100644 index 9f51c02..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KuvertTypeKode.xsd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Kvittering.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Kvittering.xsd deleted file mode 100644 index a77dd17..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Kvittering.xsd +++ /dev/null @@ -1,53 +0,0 @@ - - - - Version 1.0.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KvitteringsEmail.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KvitteringsEmail.xsd deleted file mode 100644 index b1fd135..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KvitteringsEmail.xsd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KvitteringsTypeKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KvitteringsTypeKode.xsd deleted file mode 100644 index a346b70..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/KvitteringsTypeKode.xsd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MIMEcontentIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MIMEcontentIdentifikator.xsd deleted file mode 100644 index 46a96e8..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MIMEcontentIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MasseForsendelseIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MasseForsendelseIdentifikator.xsd deleted file mode 100644 index 9753a34..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MasseForsendelseIdentifikator.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseAfsenderNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseAfsenderNavn.xsd deleted file mode 100644 index b4046ec..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseAfsenderNavn.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseFESDmetadata.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseFESDmetadata.xsd deleted file mode 100644 index 918217e..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseFESDmetadata.xsd +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIdentifikator.xsd deleted file mode 100644 index e12203b..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIdentifikator.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdData.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdData.xsd deleted file mode 100644 index 264edb2..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdData.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdURLreference.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdURLreference.xsd deleted file mode 100644 index fae04c0..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdURLreference.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdstypeIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdstypeIdentifikator.xsd deleted file mode 100644 index dac3b41..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseIndholdstypeIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseServicebeskedTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseServicebeskedTekst.xsd deleted file mode 100644 index 664fa0f..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseServicebeskedTekst.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarEmneIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarEmneIdentifikator.xsd deleted file mode 100644 index c3195cf..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarEmneIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarPostkasseIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarPostkasseIdentifikator.xsd deleted file mode 100644 index 21e19a1..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarPostkasseIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarTypeNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarTypeNavn.xsd deleted file mode 100644 index 7515e22..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseSvarTypeNavn.xsd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTidsfristDato.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTidsfristDato.xsd deleted file mode 100644 index cf04cbd..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTidsfristDato.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTidsfristTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTidsfristTekst.xsd deleted file mode 100644 index 7ef1b99..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTidsfristTekst.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTitelTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTitelTekst.xsd deleted file mode 100644 index f2462bb..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTitelTekst.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTraadIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTraadIdentifikator.xsd deleted file mode 100644 index 504709c..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTraadIdentifikator.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTypeNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTypeNavn.xsd deleted file mode 100644 index 9991489..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelseTypeNavn.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelsesFormatObjekt.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelsesFormatObjekt.xsd deleted file mode 100644 index 433146f..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MeddelelsesFormatObjekt.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MedsendDokumentRegistreringIndikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MedsendDokumentRegistreringIndikator.xsd deleted file mode 100644 index e0903f1..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/MedsendDokumentRegistreringIndikator.xsd +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ModtagerAdresse.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ModtagerAdresse.xsd deleted file mode 100644 index 71eb436..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ModtagerAdresse.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykAfsenderAdresseIndikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykAfsenderAdresseIndikator.xsd deleted file mode 100644 index ef544f2..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykAfsenderAdresseIndikator.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykBrevdatoIndikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykBrevdatoIndikator.xsd deleted file mode 100644 index e681b30..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykBrevdatoIndikator.xsd +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykModtagerAdresseIndikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykModtagerAdresseIndikator.xsd deleted file mode 100644 index 38c55e4..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PaatrykModtagerAdresseIndikator.xsd +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PostKategoriKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PostKategoriKode.xsd deleted file mode 100644 index 1d5f29f..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PostKategoriKode.xsd +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PostParametre.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PostParametre.xsd deleted file mode 100644 index 225e971..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PostParametre.xsd +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PrintParametre.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PrintParametre.xsd deleted file mode 100644 index f0c0699..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/PrintParametre.xsd +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ReturposthaandteringHosLeverandoerIndikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ReturposthaandteringHosLeverandoerIndikator.xsd deleted file mode 100644 index 954410f..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/ReturposthaandteringHosLeverandoerIndikator.xsd +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SideKvantitet.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SideKvantitet.xsd deleted file mode 100644 index e3bfea2..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SideKvantitet.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SimplexDuplexKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SimplexDuplexKode.xsd deleted file mode 100644 index 7688967..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SimplexDuplexKode.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SlutbrugerIdentitet.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SlutbrugerIdentitet.xsd deleted file mode 100644 index 5794f61..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/SlutbrugerIdentitet.xsd +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/StandardRetur.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/StandardRetur.xsd deleted file mode 100644 index df3d76b..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/StandardRetur.xsd +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/StatusKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/StatusKode.xsd deleted file mode 100644 index 9e98eb2..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/StatusKode.xsd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldFejlKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldFejlKode.xsd deleted file mode 100644 index 0aaab85..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldFejlKode.xsd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldFejlTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldFejlTekst.xsd deleted file mode 100644 index adee2da..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldFejlTekst.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldStatus.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldStatus.xsd deleted file mode 100644 index 22d1c66..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldStatus.xsd +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldStatusKode.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldStatusKode.xsd deleted file mode 100644 index 484df94..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TilbagekaldStatusKode.xsd +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TitelTekst.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TitelTekst.xsd deleted file mode 100644 index a906473..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TitelTekst.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TransaktionsDatoTid.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TransaktionsDatoTid.xsd deleted file mode 100644 index b011f8c..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TransaktionsDatoTid.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TransaktionsParametreI.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TransaktionsParametreI.xsd deleted file mode 100644 index deb48a1..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/TransaktionsParametreI.xsd +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/UUID.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/UUID.xsd deleted file mode 100644 index 6b95f9e..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/UUID.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/UUIDIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/UUIDIdentifikator.xsd deleted file mode 100644 index dc06dc4..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/UUIDIdentifikator.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftSomIndholdDataIndikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftSomIndholdDataIndikator.xsd deleted file mode 100644 index f5d2566..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftSomIndholdDataIndikator.xsd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Vedhaeftning.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Vedhaeftning.xsd deleted file mode 100644 index 0be9aa2..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/Vedhaeftning.xsd +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdData.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdData.xsd deleted file mode 100644 index 9ab26e7..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdData.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdIdentifikator.xsd deleted file mode 100644 index 6e1c3f7..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdIdentifikator.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdURLreference.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdURLreference.xsd deleted file mode 100644 index 94deb75..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningIndholdURLreference.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningNavn.xsd deleted file mode 100644 index 1e72e6b..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningNavn.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligAfsenderCVRnummerIdentifikator.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligAfsenderCVRnummerIdentifikator.xsd deleted file mode 100644 index cb5d3fc..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligAfsenderCVRnummerIdentifikator.xsd +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligAfsenderNavn.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligAfsenderNavn.xsd deleted file mode 100644 index e3fe561..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligAfsenderNavn.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligModtagetDatoTid.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligModtagetDatoTid.xsd deleted file mode 100644 index 476cc07..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningOprindeligModtagetDatoTid.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningSamling.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningSamling.xsd deleted file mode 100644 index 03b77ad..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningSamling.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningSamlingKvantitet.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningSamlingKvantitet.xsd deleted file mode 100644 index ab87562..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/VedhaeftningSamlingKvantitet.xsd +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/XKOM_EmailAddressIdentifier.xsd b/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/XKOM_EmailAddressIdentifier.xsd deleted file mode 100644 index 08257c5..0000000 --- a/resources/contracts/PrintService/SF1600_EP_SP1-2/xsd/oio/XKOM_EmailAddressIdentifier.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/sp/AuthorityContext_1.xsd b/resources/contracts/PrintService/sp/AuthorityContext_1.xsd deleted file mode 100644 index 964e341..0000000 --- a/resources/contracts/PrintService/sp/AuthorityContext_1.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/sp/CallContext_1.xsd b/resources/contracts/PrintService/sp/CallContext_1.xsd deleted file mode 100644 index 263b291..0000000 --- a/resources/contracts/PrintService/sp/CallContext_1.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/sp/InvocationContext_1.xsd b/resources/contracts/PrintService/sp/InvocationContext_1.xsd deleted file mode 100644 index 8793b46..0000000 --- a/resources/contracts/PrintService/sp/InvocationContext_1.xsd +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/sp/ServiceplatformFaultMessage_1.wsdl b/resources/contracts/PrintService/sp/ServiceplatformFaultMessage_1.wsdl deleted file mode 100644 index 0adde52..0000000 --- a/resources/contracts/PrintService/sp/ServiceplatformFaultMessage_1.wsdl +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/sp/ServiceplatformFault_1.xsd b/resources/contracts/PrintService/sp/ServiceplatformFault_1.xsd deleted file mode 100644 index ad5420e..0000000 --- a/resources/contracts/PrintService/sp/ServiceplatformFault_1.xsd +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/sp/service.properties b/resources/contracts/PrintService/sp/service.properties deleted file mode 100644 index 2aa25f5..0000000 --- a/resources/contracts/PrintService/sp/service.properties +++ /dev/null @@ -1,2 +0,0 @@ -service.uuid=fd885b8b-4a3f-46cb-b367-6c9dda1c78f6 -service.entityID=http://print.serviceplatformen.dk/service/forsendelse/2 \ No newline at end of file diff --git a/resources/contracts/PrintService/wsdl/context/PrintService.wsdl b/resources/contracts/PrintService/wsdl/context/PrintService.wsdl deleted file mode 100644 index 736dda6..0000000 --- a/resources/contracts/PrintService/wsdl/context/PrintService.wsdl +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/wsdl/context/policies.wsdl b/resources/contracts/PrintService/wsdl/context/policies.wsdl deleted file mode 100644 index 3a3ba98..0000000 --- a/resources/contracts/PrintService/wsdl/context/policies.wsdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/wsdl/token/PrintService.wsdl b/resources/contracts/PrintService/wsdl/token/PrintService.wsdl deleted file mode 100644 index 736dda6..0000000 --- a/resources/contracts/PrintService/wsdl/token/PrintService.wsdl +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/contracts/PrintService/wsdl/token/policies.wsdl b/resources/contracts/PrintService/wsdl/token/policies.wsdl deleted file mode 100644 index 655cbd7..0000000 --- a/resources/contracts/PrintService/wsdl/token/policies.wsdl +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/contracts/PrintService/xsd/PrintServiceRequestTypes.xsd b/resources/contracts/PrintService/xsd/PrintServiceRequestTypes.xsd deleted file mode 100644 index a8bfe7d..0000000 --- a/resources/contracts/PrintService/xsd/PrintServiceRequestTypes.xsd +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Client/ClassMap.php b/src/Client/ClassMap.php deleted file mode 100644 index 6dccc70..0000000 --- a/src/Client/ClassMap.php +++ /dev/null @@ -1,51 +0,0 @@ - '\\Drupal\\os2forms_digital_post\\Client\\StructType\\InvocationContextType', - 'AuthorityContextType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\AuthorityContextType', - 'CallContextType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\CallContextType', - 'MeddelelsesFormatObjektType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\MeddelelsesFormatObjektType', - 'DokumentParametreType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\DokumentParametreType', - 'CountryIdentificationCodeType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\CountryIdentificationCodeType', - 'KontaktOplysningType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\KontaktOplysningType', - 'ForsendelseAfsenderType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\ForsendelseAfsenderType', - 'KanalUafhaengigeParametreIType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\KanalUafhaengigeParametreIType', - 'MeddelelseFESDmetadataType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\MeddelelseFESDmetadataType', - 'DigitalPostParametreType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\DigitalPostParametreType', - 'PostParametreType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\PostParametreType', - 'TransaktionsParametreIType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\TransaktionsParametreIType', - 'PrintParametreType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\PrintParametreType', - 'SlutbrugerIdentitetType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\SlutbrugerIdentitetType', - 'ForsendelseModtagerType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\ForsendelseModtagerType', - 'BilagType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\BilagType', - 'BilagSamlingType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\BilagSamlingType', - 'ForsendelseIType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\ForsendelseIType', - 'BrevSPBodyType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\BrevSPBodyType', - 'TilmeldingRequestType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\TilmeldingRequestType', - 'PrintAfsendBrevRequestType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\PrintAfsendBrevRequestType', - 'PrintAfsendBrevResponseType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\PrintAfsendBrevResponseType', - 'PrintSpoergTilmeldingRequestType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\PrintSpoergTilmeldingRequestType', - 'PrintSpoergTilmeldingResponseType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\PrintSpoergTilmeldingResponseType', - 'FejlType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\FejlType', - 'ServiceplatformFaultType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\ServiceplatformFaultType', - 'ErrorListType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\ErrorListType', - 'ErrorType' => '\\Drupal\\os2forms_digital_post\\Client\\StructType\\ErrorType', - ]; - } -} diff --git a/src/Client/EnumType/FarveSHKodeType.php b/src/Client/EnumType/FarveSHKodeType.php deleted file mode 100644 index 6e2eba5..0000000 --- a/src/Client/EnumType/FarveSHKodeType.php +++ /dev/null @@ -1,38 +0,0 @@ -setResult($resultAfsendBrev = $this->getSoapClient()->__soapCall('afsendBrev', [ - $request, - ], [], [], $this->outputHeaders)); - - return $resultAfsendBrev; - } catch (SoapFault $soapFault) { - $this->saveLastError(__METHOD__, $soapFault); - - return false; - } - } - /** - * Returns the result - * @see AbstractSoapClientBase::getResult() - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintAfsendBrevResponseType - */ - public function getResult() - { - return parent::getResult(); - } -} diff --git a/src/Client/ServiceType/Spoerg.php b/src/Client/ServiceType/Spoerg.php deleted file mode 100644 index 05de11c..0000000 --- a/src/Client/ServiceType/Spoerg.php +++ /dev/null @@ -1,47 +0,0 @@ -setResult($resultSpoergTilmelding = $this->getSoapClient()->__soapCall('spoergTilmelding', [ - $request, - ], [], [], $this->outputHeaders)); - - return $resultSpoergTilmelding; - } catch (SoapFault $soapFault) { - $this->saveLastError(__METHOD__, $soapFault); - - return false; - } - } - /** - * Returns the result - * @see AbstractSoapClientBase::getResult() - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintSpoergTilmeldingResponseType - */ - public function getResult() - { - return parent::getResult(); - } -} diff --git a/src/Client/StructType/AuthorityContextType.php b/src/Client/StructType/AuthorityContextType.php deleted file mode 100644 index 1412ae8..0000000 --- a/src/Client/StructType/AuthorityContextType.php +++ /dev/null @@ -1,63 +0,0 @@ -setMunicipalityCVR($municipalityCVR); - } - /** - * Get MunicipalityCVR value - * @return string - */ - public function getMunicipalityCVR(): string - { - return $this->MunicipalityCVR; - } - /** - * Set MunicipalityCVR value - * @param string $municipalityCVR - * @return \Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType - */ - public function setMunicipalityCVR(string $municipalityCVR): self - { - // validation for constraint: string - if (!is_null($municipalityCVR) && !is_string($municipalityCVR)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($municipalityCVR, true), gettype($municipalityCVR)), __LINE__); - } - // validation for constraint: pattern([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) - if (!is_null($municipalityCVR) && !preg_match('/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/', $municipalityCVR)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/', var_export($municipalityCVR, true)), __LINE__); - } - $this->MunicipalityCVR = $municipalityCVR; - - return $this; - } -} diff --git a/src/Client/StructType/BilagSamlingType.php b/src/Client/StructType/BilagSamlingType.php deleted file mode 100644 index 78f5dda..0000000 --- a/src/Client/StructType/BilagSamlingType.php +++ /dev/null @@ -1,105 +0,0 @@ -setBilag($bilag); - } - /** - * Get Bilag value - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagType[] - */ - public function getBilag(): array - { - return $this->Bilag; - } - /** - * This method is responsible for validating the values passed to the setBilag method - * This method is willingly generated in order to preserve the one-line inline validation within the setBilag method - * @param array $values - * @return string A non-empty message if the values does not match the validation rules - */ - public static function validateBilagForArrayConstraintsFromSetBilag(array $values = []): string - { - $message = ''; - $invalidValues = []; - foreach ($values as $bilagSamlingTypeBilagItem) { - // validation for constraint: itemType - if (!$bilagSamlingTypeBilagItem instanceof \Drupal\os2forms_digital_post\Client\StructType\BilagType) { - $invalidValues[] = is_object($bilagSamlingTypeBilagItem) ? get_class($bilagSamlingTypeBilagItem) : sprintf('%s(%s)', gettype($bilagSamlingTypeBilagItem), var_export($bilagSamlingTypeBilagItem, true)); - } - } - if (!empty($invalidValues)) { - $message = sprintf('The Bilag property can only contain items of type \Drupal\os2forms_digital_post\Client\StructType\BilagType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); - } - unset($invalidValues); - - return $message; - } - /** - * Set Bilag value - * @throws InvalidArgumentException - * @param \Drupal\os2forms_digital_post\Client\StructType\BilagType[] $bilag - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagSamlingType - */ - public function setBilag(array $bilag = []): self - { - // validation for constraint: array - if ('' !== ($bilagArrayErrorMessage = self::validateBilagForArrayConstraintsFromSetBilag($bilag))) { - throw new InvalidArgumentException($bilagArrayErrorMessage, __LINE__); - } - // validation for constraint: maxOccurs(100) - if (is_array($bilag) && count($bilag) > 100) { - throw new InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 100', count($bilag)), __LINE__); - } - $this->Bilag = $bilag; - - return $this; - } - /** - * Add item to Bilag value - * @throws InvalidArgumentException - * @param \Drupal\os2forms_digital_post\Client\StructType\BilagType $item - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagSamlingType - */ - public function addToBilag(\Drupal\os2forms_digital_post\Client\StructType\BilagType $item): self - { - // validation for constraint: itemType - if (!$item instanceof \Drupal\os2forms_digital_post\Client\StructType\BilagType) { - throw new InvalidArgumentException(sprintf('The Bilag property can only contain items of type \Drupal\os2forms_digital_post\Client\StructType\BilagType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); - } - // validation for constraint: maxOccurs(100) - if (is_array($this->Bilag) && count($this->Bilag) >= 100) { - throw new InvalidArgumentException(sprintf('You can\'t add anymore element to this property that already contains %s elements, the number of elements contained by the property must be less than or equal to 100', count($this->Bilag)), __LINE__); - } - $this->Bilag[] = $item; - - return $this; - } -} diff --git a/src/Client/StructType/BilagType.php b/src/Client/StructType/BilagType.php deleted file mode 100644 index 889b8ac..0000000 --- a/src/Client/StructType/BilagType.php +++ /dev/null @@ -1,452 +0,0 @@ -setBilagNavn($bilagNavn) - ->setFilformatNavn($filformatNavn) - ->setBilagSorteringsIndeksIdentifikator($bilagSorteringsIndeksIdentifikator) - ->setBilagIdentifikator($bilagIdentifikator) - ->setVedhaeftningIndholdData($vedhaeftningIndholdData) - ->setVedhaeftningIndholdURLreference($vedhaeftningIndholdURLreference) - ->setVedhaeftSomIndholdDataIndikator($vedhaeftSomIndholdDataIndikator); - } - /** - * Get BilagNavn value - * @return string|null - */ - public function getBilagNavn(): ?string - { - return $this->BilagNavn; - } - /** - * Set BilagNavn value - * @param string $bilagNavn - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagType - */ - public function setBilagNavn(?string $bilagNavn = null): self - { - // validation for constraint: string - if (!is_null($bilagNavn) && !is_string($bilagNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bilagNavn, true), gettype($bilagNavn)), __LINE__); - } - // validation for constraint: maxLength(300) - if (!is_null($bilagNavn) && mb_strlen((string) $bilagNavn) > 300) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 300', mb_strlen((string) $bilagNavn)), __LINE__); - } - $this->BilagNavn = $bilagNavn; - - return $this; - } - /** - * Get FilformatNavn value - * @return string|null - */ - public function getFilformatNavn(): ?string - { - return $this->FilformatNavn; - } - /** - * Set FilformatNavn value - * @param string $filformatNavn - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagType - */ - public function setFilformatNavn(?string $filformatNavn = null): self - { - // validation for constraint: string - if (!is_null($filformatNavn) && !is_string($filformatNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($filformatNavn, true), gettype($filformatNavn)), __LINE__); - } - // validation for constraint: maxLength(10) - if (!is_null($filformatNavn) && mb_strlen((string) $filformatNavn) > 10) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 10', mb_strlen((string) $filformatNavn)), __LINE__); - } - $this->FilformatNavn = $filformatNavn; - - return $this; - } - /** - * Get BilagSorteringsIndeksIdentifikator value - * @return int|null - */ - public function getBilagSorteringsIndeksIdentifikator(): ?int - { - return $this->BilagSorteringsIndeksIdentifikator; - } - /** - * Set BilagSorteringsIndeksIdentifikator value - * @param int $bilagSorteringsIndeksIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagType - */ - public function setBilagSorteringsIndeksIdentifikator(?int $bilagSorteringsIndeksIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($bilagSorteringsIndeksIdentifikator) && !(is_int($bilagSorteringsIndeksIdentifikator) || ctype_digit($bilagSorteringsIndeksIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($bilagSorteringsIndeksIdentifikator, true), gettype($bilagSorteringsIndeksIdentifikator)), __LINE__); - } - $this->BilagSorteringsIndeksIdentifikator = $bilagSorteringsIndeksIdentifikator; - - return $this; - } - /** - * Get BilagIdentifikator value - * @return string|null - */ - public function getBilagIdentifikator(): ?string - { - return isset($this->BilagIdentifikator) ? $this->BilagIdentifikator : null; - } - /** - * This method is responsible for validating the value passed to the setBilagIdentifikator method - * This method is willingly generated in order to preserve the one-line inline validation within the setBilagIdentifikator method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateBilagIdentifikatorForChoiceConstraintsFromSetBilagIdentifikator($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'VedhaeftningIndholdData', - 'VedhaeftningIndholdURLreference', - 'VedhaeftSomIndholdDataIndikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property BilagIdentifikator can\'t be set as the property %s is already set. Only one property must be set among these properties: BilagIdentifikator, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set BilagIdentifikator value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $bilagIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagType - */ - public function setBilagIdentifikator(?string $bilagIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($bilagIdentifikator) && !is_string($bilagIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bilagIdentifikator, true), gettype($bilagIdentifikator)), __LINE__); - } - // validation for constraint: choice(BilagIdentifikator, VedhaeftningIndholdData, VedhaeftningIndholdURLreference, VedhaeftSomIndholdDataIndikator) - if ('' !== ($bilagIdentifikatorChoiceErrorMessage = self::validateBilagIdentifikatorForChoiceConstraintsFromSetBilagIdentifikator($bilagIdentifikator))) { - throw new InvalidArgumentException($bilagIdentifikatorChoiceErrorMessage, __LINE__); - } - // validation for constraint: maxLength(10) - if (!is_null($bilagIdentifikator) && mb_strlen((string) $bilagIdentifikator) > 10) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 10', mb_strlen((string) $bilagIdentifikator)), __LINE__); - } - if (is_null($bilagIdentifikator) || (is_array($bilagIdentifikator) && empty($bilagIdentifikator))) { - unset($this->BilagIdentifikator); - } else { - $this->BilagIdentifikator = $bilagIdentifikator; - } - - return $this; - } - /** - * Get VedhaeftningIndholdData value - * @return string|null - */ - public function getVedhaeftningIndholdData(): ?string - { - return isset($this->VedhaeftningIndholdData) ? $this->VedhaeftningIndholdData : null; - } - /** - * This method is responsible for validating the value passed to the setVedhaeftningIndholdData method - * This method is willingly generated in order to preserve the one-line inline validation within the setVedhaeftningIndholdData method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateVedhaeftningIndholdDataForChoiceConstraintsFromSetVedhaeftningIndholdData($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'BilagIdentifikator', - 'VedhaeftningIndholdURLreference', - 'VedhaeftSomIndholdDataIndikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property VedhaeftningIndholdData can\'t be set as the property %s is already set. Only one property must be set among these properties: VedhaeftningIndholdData, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set VedhaeftningIndholdData value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $vedhaeftningIndholdData - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagType - */ - public function setVedhaeftningIndholdData(?string $vedhaeftningIndholdData = null): self - { - // validation for constraint: string - if (!is_null($vedhaeftningIndholdData) && !is_string($vedhaeftningIndholdData)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($vedhaeftningIndholdData, true), gettype($vedhaeftningIndholdData)), __LINE__); - } - // validation for constraint: choice(BilagIdentifikator, VedhaeftningIndholdData, VedhaeftningIndholdURLreference, VedhaeftSomIndholdDataIndikator) - if ('' !== ($vedhaeftningIndholdDataChoiceErrorMessage = self::validateVedhaeftningIndholdDataForChoiceConstraintsFromSetVedhaeftningIndholdData($vedhaeftningIndholdData))) { - throw new InvalidArgumentException($vedhaeftningIndholdDataChoiceErrorMessage, __LINE__); - } - if (is_null($vedhaeftningIndholdData) || (is_array($vedhaeftningIndholdData) && empty($vedhaeftningIndholdData))) { - unset($this->VedhaeftningIndholdData); - } else { - $this->VedhaeftningIndholdData = $vedhaeftningIndholdData; - } - - return $this; - } - /** - * Get VedhaeftningIndholdURLreference value - * @return string|null - */ - public function getVedhaeftningIndholdURLreference(): ?string - { - return isset($this->VedhaeftningIndholdURLreference) ? $this->VedhaeftningIndholdURLreference : null; - } - /** - * This method is responsible for validating the value passed to the setVedhaeftningIndholdURLreference method - * This method is willingly generated in order to preserve the one-line inline validation within the setVedhaeftningIndholdURLreference method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateVedhaeftningIndholdURLreferenceForChoiceConstraintsFromSetVedhaeftningIndholdURLreference($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'BilagIdentifikator', - 'VedhaeftningIndholdData', - 'VedhaeftSomIndholdDataIndikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property VedhaeftningIndholdURLreference can\'t be set as the property %s is already set. Only one property must be set among these properties: VedhaeftningIndholdURLreference, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set VedhaeftningIndholdURLreference value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $vedhaeftningIndholdURLreference - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagType - */ - public function setVedhaeftningIndholdURLreference(?string $vedhaeftningIndholdURLreference = null): self - { - // validation for constraint: string - if (!is_null($vedhaeftningIndholdURLreference) && !is_string($vedhaeftningIndholdURLreference)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($vedhaeftningIndholdURLreference, true), gettype($vedhaeftningIndholdURLreference)), __LINE__); - } - // validation for constraint: choice(BilagIdentifikator, VedhaeftningIndholdData, VedhaeftningIndholdURLreference, VedhaeftSomIndholdDataIndikator) - if ('' !== ($vedhaeftningIndholdURLreferenceChoiceErrorMessage = self::validateVedhaeftningIndholdURLreferenceForChoiceConstraintsFromSetVedhaeftningIndholdURLreference($vedhaeftningIndholdURLreference))) { - throw new InvalidArgumentException($vedhaeftningIndholdURLreferenceChoiceErrorMessage, __LINE__); - } - if (is_null($vedhaeftningIndholdURLreference) || (is_array($vedhaeftningIndholdURLreference) && empty($vedhaeftningIndholdURLreference))) { - unset($this->VedhaeftningIndholdURLreference); - } else { - $this->VedhaeftningIndholdURLreference = $vedhaeftningIndholdURLreference; - } - - return $this; - } - /** - * Get VedhaeftSomIndholdDataIndikator value - * @return bool|null - */ - public function getVedhaeftSomIndholdDataIndikator(): ?bool - { - return isset($this->VedhaeftSomIndholdDataIndikator) ? $this->VedhaeftSomIndholdDataIndikator : null; - } - /** - * This method is responsible for validating the value passed to the setVedhaeftSomIndholdDataIndikator method - * This method is willingly generated in order to preserve the one-line inline validation within the setVedhaeftSomIndholdDataIndikator method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateVedhaeftSomIndholdDataIndikatorForChoiceConstraintsFromSetVedhaeftSomIndholdDataIndikator($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'BilagIdentifikator', - 'VedhaeftningIndholdData', - 'VedhaeftningIndholdURLreference', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property VedhaeftSomIndholdDataIndikator can\'t be set as the property %s is already set. Only one property must be set among these properties: VedhaeftSomIndholdDataIndikator, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set VedhaeftSomIndholdDataIndikator value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param bool $vedhaeftSomIndholdDataIndikator - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagType - */ - public function setVedhaeftSomIndholdDataIndikator(?bool $vedhaeftSomIndholdDataIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($vedhaeftSomIndholdDataIndikator) && !is_bool($vedhaeftSomIndholdDataIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($vedhaeftSomIndholdDataIndikator, true), gettype($vedhaeftSomIndholdDataIndikator)), __LINE__); - } - // validation for constraint: choice(BilagIdentifikator, VedhaeftningIndholdData, VedhaeftningIndholdURLreference, VedhaeftSomIndholdDataIndikator) - if ('' !== ($vedhaeftSomIndholdDataIndikatorChoiceErrorMessage = self::validateVedhaeftSomIndholdDataIndikatorForChoiceConstraintsFromSetVedhaeftSomIndholdDataIndikator($vedhaeftSomIndholdDataIndikator))) { - throw new InvalidArgumentException($vedhaeftSomIndholdDataIndikatorChoiceErrorMessage, __LINE__); - } - if (is_null($vedhaeftSomIndholdDataIndikator) || (is_array($vedhaeftSomIndholdDataIndikator) && empty($vedhaeftSomIndholdDataIndikator))) { - unset($this->VedhaeftSomIndholdDataIndikator); - } else { - $this->VedhaeftSomIndholdDataIndikator = $vedhaeftSomIndholdDataIndikator; - } - - return $this; - } -} diff --git a/src/Client/StructType/BrevSPBodyType.php b/src/Client/StructType/BrevSPBodyType.php deleted file mode 100644 index ee5f5e7..0000000 --- a/src/Client/StructType/BrevSPBodyType.php +++ /dev/null @@ -1,127 +0,0 @@ -setKanalvalg($kanalvalg) - ->setPrioritet($prioritet) - ->setForsendelseI($forsendelseI); - } - /** - * Get Kanalvalg value - * @return string - */ - public function getKanalvalg(): string - { - return $this->Kanalvalg; - } - /** - * Set Kanalvalg value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\KanalvalgType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\KanalvalgType::getValidValues() - * @throws InvalidArgumentException - * @param string $kanalvalg - * @return \Drupal\os2forms_digital_post\Client\StructType\BrevSPBodyType - */ - public function setKanalvalg(string $kanalvalg): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\KanalvalgType::valueIsValid($kanalvalg)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\KanalvalgType', is_array($kanalvalg) ? implode(', ', $kanalvalg) : var_export($kanalvalg, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\KanalvalgType::getValidValues())), __LINE__); - } - $this->Kanalvalg = $kanalvalg; - - return $this; - } - /** - * Get Prioritet value - * @return string - */ - public function getPrioritet(): string - { - return $this->Prioritet; - } - /** - * Set Prioritet value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\PrioritetType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\PrioritetType::getValidValues() - * @throws InvalidArgumentException - * @param string $prioritet - * @return \Drupal\os2forms_digital_post\Client\StructType\BrevSPBodyType - */ - public function setPrioritet(string $prioritet): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\PrioritetType::valueIsValid($prioritet)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\PrioritetType', is_array($prioritet) ? implode(', ', $prioritet) : var_export($prioritet, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\PrioritetType::getValidValues())), __LINE__); - } - $this->Prioritet = $prioritet; - - return $this; - } - /** - * Get ForsendelseI value - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function getForsendelseI(): \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - { - return $this->ForsendelseI; - } - /** - * Set ForsendelseI value - * @param \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType $forsendelseI - * @return \Drupal\os2forms_digital_post\Client\StructType\BrevSPBodyType - */ - public function setForsendelseI(\Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType $forsendelseI): self - { - $this->ForsendelseI = $forsendelseI; - - return $this; - } -} diff --git a/src/Client/StructType/CallContextType.php b/src/Client/StructType/CallContextType.php deleted file mode 100644 index 1038b51..0000000 --- a/src/Client/StructType/CallContextType.php +++ /dev/null @@ -1,146 +0,0 @@ -setOnBehalfOfUser($onBehalfOfUser) - ->setCallersServiceCallIdentifier($callersServiceCallIdentifier) - ->setAccountingInfo($accountingInfo); - } - /** - * Get OnBehalfOfUser value - * @return string|null - */ - public function getOnBehalfOfUser(): ?string - { - return $this->OnBehalfOfUser; - } - /** - * Set OnBehalfOfUser value - * @param string $onBehalfOfUser - * @return \Drupal\os2forms_digital_post\Client\StructType\CallContextType - */ - public function setOnBehalfOfUser(?string $onBehalfOfUser = null): self - { - // validation for constraint: string - if (!is_null($onBehalfOfUser) && !is_string($onBehalfOfUser)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($onBehalfOfUser, true), gettype($onBehalfOfUser)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($onBehalfOfUser) && mb_strlen((string) $onBehalfOfUser) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $onBehalfOfUser)), __LINE__); - } - $this->OnBehalfOfUser = $onBehalfOfUser; - - return $this; - } - /** - * Get CallersServiceCallIdentifier value - * @return string|null - */ - public function getCallersServiceCallIdentifier(): ?string - { - return $this->CallersServiceCallIdentifier; - } - /** - * Set CallersServiceCallIdentifier value - * @param string $callersServiceCallIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\CallContextType - */ - public function setCallersServiceCallIdentifier(?string $callersServiceCallIdentifier = null): self - { - // validation for constraint: string - if (!is_null($callersServiceCallIdentifier) && !is_string($callersServiceCallIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($callersServiceCallIdentifier, true), gettype($callersServiceCallIdentifier)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($callersServiceCallIdentifier) && mb_strlen((string) $callersServiceCallIdentifier) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $callersServiceCallIdentifier)), __LINE__); - } - $this->CallersServiceCallIdentifier = $callersServiceCallIdentifier; - - return $this; - } - /** - * Get AccountingInfo value - * @return string|null - */ - public function getAccountingInfo(): ?string - { - return $this->AccountingInfo; - } - /** - * Set AccountingInfo value - * @param string $accountingInfo - * @return \Drupal\os2forms_digital_post\Client\StructType\CallContextType - */ - public function setAccountingInfo(?string $accountingInfo = null): self - { - // validation for constraint: string - if (!is_null($accountingInfo) && !is_string($accountingInfo)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accountingInfo, true), gettype($accountingInfo)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($accountingInfo) && mb_strlen((string) $accountingInfo) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $accountingInfo)), __LINE__); - } - $this->AccountingInfo = $accountingInfo; - - return $this; - } -} diff --git a/src/Client/StructType/CountryIdentificationCodeType.php b/src/Client/StructType/CountryIdentificationCodeType.php deleted file mode 100644 index 59b508a..0000000 --- a/src/Client/StructType/CountryIdentificationCodeType.php +++ /dev/null @@ -1,85 +0,0 @@ -set_($_) - ->setScheme($scheme); - } - /** - * Get _ value - * @return string|null - */ - public function get_(): ?string - { - return $this->_; - } - /** - * Set _ value - * @param string $_ - * @return \Drupal\os2forms_digital_post\Client\StructType\CountryIdentificationCodeType - */ - public function set_(?string $_ = null): self - { - // validation for constraint: string - if (!is_null($_) && !is_string($_)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($_, true), gettype($_)), __LINE__); - } - $this->_ = $_; - - return $this; - } - /** - * Get scheme value - * @return string|null - */ - public function getScheme(): ?string - { - return $this->scheme; - } - /** - * Set scheme value - * @param string $scheme - * @return \Drupal\os2forms_digital_post\Client\StructType\CountryIdentificationCodeType - */ - public function setScheme(?string $scheme = null): self - { - // validation for constraint: string - if (!is_null($scheme) && !is_string($scheme)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($scheme, true), gettype($scheme)), __LINE__); - } - $this->scheme = $scheme; - - return $this; - } -} diff --git a/src/Client/StructType/DigitalPostParametreType.php b/src/Client/StructType/DigitalPostParametreType.php deleted file mode 100644 index 03a9c7f..0000000 --- a/src/Client/StructType/DigitalPostParametreType.php +++ /dev/null @@ -1,259 +0,0 @@ -setAfsendelseDatoTid($afsendelseDatoTid) - ->setMeddelelseIndholdstypeIdentifikator($meddelelseIndholdstypeIdentifikator) - ->setMeddelelseSvarTypeNavn($meddelelseSvarTypeNavn) - ->setMeddelelseSvarPostkasseIdentifikator($meddelelseSvarPostkasseIdentifikator) - ->setMeddelelseSvarEmneIdentifikator($meddelelseSvarEmneIdentifikator) - ->setMeddelelseFESDmetadata($meddelelseFESDmetadata) - ->setMedsendDokumentRegistreringIndikator($medsendDokumentRegistreringIndikator); - } - /** - * Get AfsendelseDatoTid value - * @return string|null - */ - public function getAfsendelseDatoTid(): ?string - { - return $this->AfsendelseDatoTid; - } - /** - * Set AfsendelseDatoTid value - * @param string $afsendelseDatoTid - * @return \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType - */ - public function setAfsendelseDatoTid(?string $afsendelseDatoTid = null): self - { - // validation for constraint: string - if (!is_null($afsendelseDatoTid) && !is_string($afsendelseDatoTid)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($afsendelseDatoTid, true), gettype($afsendelseDatoTid)), __LINE__); - } - $this->AfsendelseDatoTid = $afsendelseDatoTid; - - return $this; - } - /** - * Get MeddelelseIndholdstypeIdentifikator value - * @return int|null - */ - public function getMeddelelseIndholdstypeIdentifikator(): ?int - { - return $this->MeddelelseIndholdstypeIdentifikator; - } - /** - * Set MeddelelseIndholdstypeIdentifikator value - * @param int $meddelelseIndholdstypeIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType - */ - public function setMeddelelseIndholdstypeIdentifikator(?int $meddelelseIndholdstypeIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($meddelelseIndholdstypeIdentifikator) && !(is_int($meddelelseIndholdstypeIdentifikator) || ctype_digit($meddelelseIndholdstypeIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($meddelelseIndholdstypeIdentifikator, true), gettype($meddelelseIndholdstypeIdentifikator)), __LINE__); - } - $this->MeddelelseIndholdstypeIdentifikator = $meddelelseIndholdstypeIdentifikator; - - return $this; - } - /** - * Get MeddelelseSvarTypeNavn value - * @return string|null - */ - public function getMeddelelseSvarTypeNavn(): ?string - { - return $this->MeddelelseSvarTypeNavn; - } - /** - * Set MeddelelseSvarTypeNavn value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\MeddelelseSvarTypeNavnType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\MeddelelseSvarTypeNavnType::getValidValues() - * @throws InvalidArgumentException - * @param string $meddelelseSvarTypeNavn - * @return \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType - */ - public function setMeddelelseSvarTypeNavn(?string $meddelelseSvarTypeNavn = null): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\MeddelelseSvarTypeNavnType::valueIsValid($meddelelseSvarTypeNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\MeddelelseSvarTypeNavnType', is_array($meddelelseSvarTypeNavn) ? implode(', ', $meddelelseSvarTypeNavn) : var_export($meddelelseSvarTypeNavn, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\MeddelelseSvarTypeNavnType::getValidValues())), __LINE__); - } - $this->MeddelelseSvarTypeNavn = $meddelelseSvarTypeNavn; - - return $this; - } - /** - * Get MeddelelseSvarPostkasseIdentifikator value - * @return int|null - */ - public function getMeddelelseSvarPostkasseIdentifikator(): ?int - { - return $this->MeddelelseSvarPostkasseIdentifikator; - } - /** - * Set MeddelelseSvarPostkasseIdentifikator value - * @param int $meddelelseSvarPostkasseIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType - */ - public function setMeddelelseSvarPostkasseIdentifikator(?int $meddelelseSvarPostkasseIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($meddelelseSvarPostkasseIdentifikator) && !(is_int($meddelelseSvarPostkasseIdentifikator) || ctype_digit($meddelelseSvarPostkasseIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($meddelelseSvarPostkasseIdentifikator, true), gettype($meddelelseSvarPostkasseIdentifikator)), __LINE__); - } - $this->MeddelelseSvarPostkasseIdentifikator = $meddelelseSvarPostkasseIdentifikator; - - return $this; - } - /** - * Get MeddelelseSvarEmneIdentifikator value - * @return int|null - */ - public function getMeddelelseSvarEmneIdentifikator(): ?int - { - return $this->MeddelelseSvarEmneIdentifikator; - } - /** - * Set MeddelelseSvarEmneIdentifikator value - * @param int $meddelelseSvarEmneIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType - */ - public function setMeddelelseSvarEmneIdentifikator(?int $meddelelseSvarEmneIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($meddelelseSvarEmneIdentifikator) && !(is_int($meddelelseSvarEmneIdentifikator) || ctype_digit($meddelelseSvarEmneIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($meddelelseSvarEmneIdentifikator, true), gettype($meddelelseSvarEmneIdentifikator)), __LINE__); - } - $this->MeddelelseSvarEmneIdentifikator = $meddelelseSvarEmneIdentifikator; - - return $this; - } - /** - * Get MeddelelseFESDmetadata value - * @return \Drupal\os2forms_digital_post\Client\StructType\MeddelelseFESDmetadataType|null - */ - public function getMeddelelseFESDmetadata(): ?\Drupal\os2forms_digital_post\Client\StructType\MeddelelseFESDmetadataType - { - return $this->MeddelelseFESDmetadata; - } - /** - * Set MeddelelseFESDmetadata value - * @param \Drupal\os2forms_digital_post\Client\StructType\MeddelelseFESDmetadataType $meddelelseFESDmetadata - * @return \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType - */ - public function setMeddelelseFESDmetadata(?\Drupal\os2forms_digital_post\Client\StructType\MeddelelseFESDmetadataType $meddelelseFESDmetadata = null): self - { - $this->MeddelelseFESDmetadata = $meddelelseFESDmetadata; - - return $this; - } - /** - * Get MedsendDokumentRegistreringIndikator value - * @return bool|null - */ - public function getMedsendDokumentRegistreringIndikator(): ?bool - { - return $this->MedsendDokumentRegistreringIndikator; - } - /** - * Set MedsendDokumentRegistreringIndikator value - * @param bool $medsendDokumentRegistreringIndikator - * @return \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType - */ - public function setMedsendDokumentRegistreringIndikator(?bool $medsendDokumentRegistreringIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($medsendDokumentRegistreringIndikator) && !is_bool($medsendDokumentRegistreringIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($medsendDokumentRegistreringIndikator, true), gettype($medsendDokumentRegistreringIndikator)), __LINE__); - } - $this->MedsendDokumentRegistreringIndikator = $medsendDokumentRegistreringIndikator; - - return $this; - } -} diff --git a/src/Client/StructType/DokumentParametreType.php b/src/Client/StructType/DokumentParametreType.php deleted file mode 100644 index 336da3e..0000000 --- a/src/Client/StructType/DokumentParametreType.php +++ /dev/null @@ -1,155 +0,0 @@ -setTitelTekst($titelTekst) - ->setUUIDIdentifikator($uUIDIdentifikator) - ->setBrevDato($brevDato) - ->setMeddelelsesFormatObjekt($meddelelsesFormatObjekt); - } - /** - * Get TitelTekst value - * @return string|null - */ - public function getTitelTekst(): ?string - { - return $this->TitelTekst; - } - /** - * Set TitelTekst value - * @param string $titelTekst - * @return \Drupal\os2forms_digital_post\Client\StructType\DokumentParametreType - */ - public function setTitelTekst(?string $titelTekst = null): self - { - // validation for constraint: string - if (!is_null($titelTekst) && !is_string($titelTekst)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($titelTekst, true), gettype($titelTekst)), __LINE__); - } - $this->TitelTekst = $titelTekst; - - return $this; - } - /** - * Get UUIDIdentifikator value - * @return string|null - */ - public function getUUIDIdentifikator(): ?string - { - return $this->UUIDIdentifikator; - } - /** - * Set UUIDIdentifikator value - * @param string $uUIDIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\DokumentParametreType - */ - public function setUUIDIdentifikator(?string $uUIDIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($uUIDIdentifikator) && !is_string($uUIDIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($uUIDIdentifikator, true), gettype($uUIDIdentifikator)), __LINE__); - } - $this->UUIDIdentifikator = $uUIDIdentifikator; - - return $this; - } - /** - * Get BrevDato value - * @return string|null - */ - public function getBrevDato(): ?string - { - return $this->BrevDato; - } - /** - * Set BrevDato value - * @param string $brevDato - * @return \Drupal\os2forms_digital_post\Client\StructType\DokumentParametreType - */ - public function setBrevDato(?string $brevDato = null): self - { - // validation for constraint: string - if (!is_null($brevDato) && !is_string($brevDato)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($brevDato, true), gettype($brevDato)), __LINE__); - } - $this->BrevDato = $brevDato; - - return $this; - } - /** - * Get MeddelelsesFormatObjekt value - * @return \Drupal\os2forms_digital_post\Client\StructType\MeddelelsesFormatObjektType|null - */ - public function getMeddelelsesFormatObjekt(): ?\Drupal\os2forms_digital_post\Client\StructType\MeddelelsesFormatObjektType - { - return $this->MeddelelsesFormatObjekt; - } - /** - * Set MeddelelsesFormatObjekt value - * @param \Drupal\os2forms_digital_post\Client\StructType\MeddelelsesFormatObjektType $meddelelsesFormatObjekt - * @return \Drupal\os2forms_digital_post\Client\StructType\DokumentParametreType - */ - public function setMeddelelsesFormatObjekt(?\Drupal\os2forms_digital_post\Client\StructType\MeddelelsesFormatObjektType $meddelelsesFormatObjekt = null): self - { - $this->MeddelelsesFormatObjekt = $meddelelsesFormatObjekt; - - return $this; - } -} diff --git a/src/Client/StructType/ErrorListType.php b/src/Client/StructType/ErrorListType.php deleted file mode 100644 index 8f8b4df..0000000 --- a/src/Client/StructType/ErrorListType.php +++ /dev/null @@ -1,97 +0,0 @@ -setError($error); - } - /** - * Get Error value - * @return \Drupal\os2forms_digital_post\Client\StructType\ErrorType[] - */ - public function getError(): array - { - return $this->Error; - } - /** - * This method is responsible for validating the values passed to the setError method - * This method is willingly generated in order to preserve the one-line inline validation within the setError method - * @param array $values - * @return string A non-empty message if the values does not match the validation rules - */ - public static function validateErrorForArrayConstraintsFromSetError(array $values = []): string - { - $message = ''; - $invalidValues = []; - foreach ($values as $errorListTypeErrorItem) { - // validation for constraint: itemType - if (!$errorListTypeErrorItem instanceof \Drupal\os2forms_digital_post\Client\StructType\ErrorType) { - $invalidValues[] = is_object($errorListTypeErrorItem) ? get_class($errorListTypeErrorItem) : sprintf('%s(%s)', gettype($errorListTypeErrorItem), var_export($errorListTypeErrorItem, true)); - } - } - if (!empty($invalidValues)) { - $message = sprintf('The Error property can only contain items of type \Drupal\os2forms_digital_post\Client\StructType\ErrorType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); - } - unset($invalidValues); - - return $message; - } - /** - * Set Error value - * @throws InvalidArgumentException - * @param \Drupal\os2forms_digital_post\Client\StructType\ErrorType[] $error - * @return \Drupal\os2forms_digital_post\Client\StructType\ErrorListType - */ - public function setError(array $error): self - { - // validation for constraint: array - if ('' !== ($errorArrayErrorMessage = self::validateErrorForArrayConstraintsFromSetError($error))) { - throw new InvalidArgumentException($errorArrayErrorMessage, __LINE__); - } - $this->Error = $error; - - return $this; - } - /** - * Add item to Error value - * @throws InvalidArgumentException - * @param \Drupal\os2forms_digital_post\Client\StructType\ErrorType $item - * @return \Drupal\os2forms_digital_post\Client\StructType\ErrorListType - */ - public function addToError(\Drupal\os2forms_digital_post\Client\StructType\ErrorType $item): self - { - // validation for constraint: itemType - if (!$item instanceof \Drupal\os2forms_digital_post\Client\StructType\ErrorType) { - throw new InvalidArgumentException(sprintf('The Error property can only contain items of type \Drupal\os2forms_digital_post\Client\StructType\ErrorType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); - } - $this->Error[] = $item; - - return $this; - } -} diff --git a/src/Client/StructType/ErrorType.php b/src/Client/StructType/ErrorType.php deleted file mode 100644 index 8c88392..0000000 --- a/src/Client/StructType/ErrorType.php +++ /dev/null @@ -1,91 +0,0 @@ -setErrorCode($errorCode) - ->setErrorText($errorText); - } - /** - * Get ErrorCode value - * @return string - */ - public function getErrorCode(): string - { - return $this->ErrorCode; - } - /** - * Set ErrorCode value - * @param string $errorCode - * @return \Drupal\os2forms_digital_post\Client\StructType\ErrorType - */ - public function setErrorCode(string $errorCode): self - { - // validation for constraint: string - if (!is_null($errorCode) && !is_string($errorCode)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorCode, true), gettype($errorCode)), __LINE__); - } - $this->ErrorCode = $errorCode; - - return $this; - } - /** - * Get ErrorText value - * @return string - */ - public function getErrorText(): string - { - return $this->ErrorText; - } - /** - * Set ErrorText value - * @param string $errorText - * @return \Drupal\os2forms_digital_post\Client\StructType\ErrorType - */ - public function setErrorText(string $errorText): self - { - // validation for constraint: string - if (!is_null($errorText) && !is_string($errorText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorText, true), gettype($errorText)), __LINE__); - } - $this->ErrorText = $errorText; - - return $this; - } -} diff --git a/src/Client/StructType/FejlType.php b/src/Client/StructType/FejlType.php deleted file mode 100644 index 9522387..0000000 --- a/src/Client/StructType/FejlType.php +++ /dev/null @@ -1,146 +0,0 @@ -setFejlKode($fejlKode) - ->setFejlTekst($fejlTekst) - ->setFejlIdentifikator($fejlIdentifikator); - } - /** - * Get FejlKode value - * @return int|null - */ - public function getFejlKode(): ?int - { - return $this->FejlKode; - } - /** - * Set FejlKode value - * @param int $fejlKode - * @return \Drupal\os2forms_digital_post\Client\StructType\FejlType - */ - public function setFejlKode(?int $fejlKode = null): self - { - // validation for constraint: int - if (!is_null($fejlKode) && !(is_int($fejlKode) || ctype_digit($fejlKode))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($fejlKode, true), gettype($fejlKode)), __LINE__); - } - // validation for constraint: maxInclusive(9999) - if (!is_null($fejlKode) && $fejlKode > 9999) { - throw new InvalidArgumentException(sprintf('Invalid value %s, the value must be numerically less than or equal to 9999', var_export($fejlKode, true)), __LINE__); - } - // validation for constraint: minInclusive(1000) - if (!is_null($fejlKode) && $fejlKode < 1000) { - throw new InvalidArgumentException(sprintf('Invalid value %s, the value must be numerically greater than or equal to 1000', var_export($fejlKode, true)), __LINE__); - } - $this->FejlKode = $fejlKode; - - return $this; - } - /** - * Get FejlTekst value - * @return string|null - */ - public function getFejlTekst(): ?string - { - return $this->FejlTekst; - } - /** - * Set FejlTekst value - * @param string $fejlTekst - * @return \Drupal\os2forms_digital_post\Client\StructType\FejlType - */ - public function setFejlTekst(?string $fejlTekst = null): self - { - // validation for constraint: string - if (!is_null($fejlTekst) && !is_string($fejlTekst)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fejlTekst, true), gettype($fejlTekst)), __LINE__); - } - // validation for constraint: maxLength(2048) - if (!is_null($fejlTekst) && mb_strlen((string) $fejlTekst) > 2048) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 2048', mb_strlen((string) $fejlTekst)), __LINE__); - } - $this->FejlTekst = $fejlTekst; - - return $this; - } - /** - * Get FejlIdentifikator value - * @return string|null - */ - public function getFejlIdentifikator(): ?string - { - return $this->FejlIdentifikator; - } - /** - * Set FejlIdentifikator value - * @param string $fejlIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\FejlType - */ - public function setFejlIdentifikator(?string $fejlIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fejlIdentifikator) && !is_string($fejlIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fejlIdentifikator, true), gettype($fejlIdentifikator)), __LINE__); - } - // validation for constraint: maxLength(26) - if (!is_null($fejlIdentifikator) && mb_strlen((string) $fejlIdentifikator) > 26) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 26', mb_strlen((string) $fejlIdentifikator)), __LINE__); - } - $this->FejlIdentifikator = $fejlIdentifikator; - - return $this; - } -} diff --git a/src/Client/StructType/ForsendelseAfsenderType.php b/src/Client/StructType/ForsendelseAfsenderType.php deleted file mode 100644 index 0b9200d..0000000 --- a/src/Client/StructType/ForsendelseAfsenderType.php +++ /dev/null @@ -1,54 +0,0 @@ -setAfsenderAdresse($afsenderAdresse); - } - /** - * Get AfsenderAdresse value - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType|null - */ - public function getAfsenderAdresse(): ?\Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - { - return $this->AfsenderAdresse; - } - /** - * Set AfsenderAdresse value - * @param \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType $afsenderAdresse - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseAfsenderType - */ - public function setAfsenderAdresse(?\Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType $afsenderAdresse = null): self - { - $this->AfsenderAdresse = $afsenderAdresse; - - return $this; - } -} diff --git a/src/Client/StructType/ForsendelseIType.php b/src/Client/StructType/ForsendelseIType.php deleted file mode 100644 index 3f056a7..0000000 --- a/src/Client/StructType/ForsendelseIType.php +++ /dev/null @@ -1,413 +0,0 @@ -setAfsendelseIdentifikator($afsendelseIdentifikator) - ->setForsendelseTypeIdentifikator($forsendelseTypeIdentifikator) - ->setForsendelseModtager($forsendelseModtager) - ->setFilformatNavn($filformatNavn) - ->setMeddelelseIndholdData($meddelelseIndholdData) - ->setTransaktionsParametreI($transaktionsParametreI) - ->setDokumentParametre($dokumentParametre) - ->setKanalUafhaengigeParametreI($kanalUafhaengigeParametreI) - ->setPrintParametre($printParametre) - ->setDigitalPostParametre($digitalPostParametre) - ->setPostParametre($postParametre) - ->setBilagSamling($bilagSamling); - } - /** - * Get AfsendelseIdentifikator value - * @return string|null - */ - public function getAfsendelseIdentifikator(): ?string - { - return $this->AfsendelseIdentifikator; - } - /** - * Set AfsendelseIdentifikator value - * @param string $afsendelseIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setAfsendelseIdentifikator(?string $afsendelseIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($afsendelseIdentifikator) && !is_string($afsendelseIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($afsendelseIdentifikator, true), gettype($afsendelseIdentifikator)), __LINE__); - } - // validation for constraint: maxLength(38) - if (!is_null($afsendelseIdentifikator) && mb_strlen((string) $afsendelseIdentifikator) > 38) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 38', mb_strlen((string) $afsendelseIdentifikator)), __LINE__); - } - // validation for constraint: minLength(1) - if (!is_null($afsendelseIdentifikator) && mb_strlen((string) $afsendelseIdentifikator) < 1) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be greater than or equal to 1', mb_strlen((string) $afsendelseIdentifikator)), __LINE__); - } - $this->AfsendelseIdentifikator = $afsendelseIdentifikator; - - return $this; - } - /** - * Get ForsendelseTypeIdentifikator value - * @return int|null - */ - public function getForsendelseTypeIdentifikator(): ?int - { - return $this->ForsendelseTypeIdentifikator; - } - /** - * Set ForsendelseTypeIdentifikator value - * @param int $forsendelseTypeIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setForsendelseTypeIdentifikator(?int $forsendelseTypeIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($forsendelseTypeIdentifikator) && !(is_int($forsendelseTypeIdentifikator) || ctype_digit($forsendelseTypeIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($forsendelseTypeIdentifikator, true), gettype($forsendelseTypeIdentifikator)), __LINE__); - } - $this->ForsendelseTypeIdentifikator = $forsendelseTypeIdentifikator; - - return $this; - } - /** - * Get ForsendelseModtager value - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseModtagerType|null - */ - public function getForsendelseModtager(): ?\Drupal\os2forms_digital_post\Client\StructType\ForsendelseModtagerType - { - return $this->ForsendelseModtager; - } - /** - * Set ForsendelseModtager value - * @param \Drupal\os2forms_digital_post\Client\StructType\ForsendelseModtagerType $forsendelseModtager - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setForsendelseModtager(?\Drupal\os2forms_digital_post\Client\StructType\ForsendelseModtagerType $forsendelseModtager = null): self - { - $this->ForsendelseModtager = $forsendelseModtager; - - return $this; - } - /** - * Get FilformatNavn value - * @return string|null - */ - public function getFilformatNavn(): ?string - { - return $this->FilformatNavn; - } - /** - * Set FilformatNavn value - * @param string $filformatNavn - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setFilformatNavn(?string $filformatNavn = null): self - { - // validation for constraint: string - if (!is_null($filformatNavn) && !is_string($filformatNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($filformatNavn, true), gettype($filformatNavn)), __LINE__); - } - // validation for constraint: maxLength(10) - if (!is_null($filformatNavn) && mb_strlen((string) $filformatNavn) > 10) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 10', mb_strlen((string) $filformatNavn)), __LINE__); - } - $this->FilformatNavn = $filformatNavn; - - return $this; - } - /** - * Get MeddelelseIndholdData value - * @return string|null - */ - public function getMeddelelseIndholdData(): ?string - { - return $this->MeddelelseIndholdData; - } - /** - * Set MeddelelseIndholdData value - * @param string $meddelelseIndholdData - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setMeddelelseIndholdData(?string $meddelelseIndholdData = null): self - { - // validation for constraint: string - if (!is_null($meddelelseIndholdData) && !is_string($meddelelseIndholdData)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($meddelelseIndholdData, true), gettype($meddelelseIndholdData)), __LINE__); - } - $this->MeddelelseIndholdData = $meddelelseIndholdData; - - return $this; - } - /** - * Get TransaktionsParametreI value - * @return \Drupal\os2forms_digital_post\Client\StructType\TransaktionsParametreIType|null - */ - public function getTransaktionsParametreI(): ?\Drupal\os2forms_digital_post\Client\StructType\TransaktionsParametreIType - { - return $this->TransaktionsParametreI; - } - /** - * Set TransaktionsParametreI value - * @param \Drupal\os2forms_digital_post\Client\StructType\TransaktionsParametreIType $transaktionsParametreI - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setTransaktionsParametreI(?\Drupal\os2forms_digital_post\Client\StructType\TransaktionsParametreIType $transaktionsParametreI = null): self - { - $this->TransaktionsParametreI = $transaktionsParametreI; - - return $this; - } - /** - * Get DokumentParametre value - * @return \Drupal\os2forms_digital_post\Client\StructType\DokumentParametreType|null - */ - public function getDokumentParametre(): ?\Drupal\os2forms_digital_post\Client\StructType\DokumentParametreType - { - return $this->DokumentParametre; - } - /** - * Set DokumentParametre value - * @param \Drupal\os2forms_digital_post\Client\StructType\DokumentParametreType $dokumentParametre - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setDokumentParametre(?\Drupal\os2forms_digital_post\Client\StructType\DokumentParametreType $dokumentParametre = null): self - { - $this->DokumentParametre = $dokumentParametre; - - return $this; - } - /** - * Get KanalUafhaengigeParametreI value - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType|null - */ - public function getKanalUafhaengigeParametreI(): ?\Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - { - return $this->KanalUafhaengigeParametreI; - } - /** - * Set KanalUafhaengigeParametreI value - * @param \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType $kanalUafhaengigeParametreI - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setKanalUafhaengigeParametreI(?\Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType $kanalUafhaengigeParametreI = null): self - { - $this->KanalUafhaengigeParametreI = $kanalUafhaengigeParametreI; - - return $this; - } - /** - * Get PrintParametre value - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintParametreType|null - */ - public function getPrintParametre(): ?\Drupal\os2forms_digital_post\Client\StructType\PrintParametreType - { - return $this->PrintParametre; - } - /** - * Set PrintParametre value - * @param \Drupal\os2forms_digital_post\Client\StructType\PrintParametreType $printParametre - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setPrintParametre(?\Drupal\os2forms_digital_post\Client\StructType\PrintParametreType $printParametre = null): self - { - $this->PrintParametre = $printParametre; - - return $this; - } - /** - * Get DigitalPostParametre value - * @return \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType|null - */ - public function getDigitalPostParametre(): ?\Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType - { - return $this->DigitalPostParametre; - } - /** - * Set DigitalPostParametre value - * @param \Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType $digitalPostParametre - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setDigitalPostParametre(?\Drupal\os2forms_digital_post\Client\StructType\DigitalPostParametreType $digitalPostParametre = null): self - { - $this->DigitalPostParametre = $digitalPostParametre; - - return $this; - } - /** - * Get PostParametre value - * @return \Drupal\os2forms_digital_post\Client\StructType\PostParametreType|null - */ - public function getPostParametre(): ?\Drupal\os2forms_digital_post\Client\StructType\PostParametreType - { - return $this->PostParametre; - } - /** - * Set PostParametre value - * @param \Drupal\os2forms_digital_post\Client\StructType\PostParametreType $postParametre - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setPostParametre(?\Drupal\os2forms_digital_post\Client\StructType\PostParametreType $postParametre = null): self - { - $this->PostParametre = $postParametre; - - return $this; - } - /** - * Get BilagSamling value - * @return \Drupal\os2forms_digital_post\Client\StructType\BilagSamlingType|null - */ - public function getBilagSamling(): ?\Drupal\os2forms_digital_post\Client\StructType\BilagSamlingType - { - return $this->BilagSamling; - } - /** - * Set BilagSamling value - * @param \Drupal\os2forms_digital_post\Client\StructType\BilagSamlingType $bilagSamling - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseIType - */ - public function setBilagSamling(?\Drupal\os2forms_digital_post\Client\StructType\BilagSamlingType $bilagSamling = null): self - { - $this->BilagSamling = $bilagSamling; - - return $this; - } -} diff --git a/src/Client/StructType/ForsendelseModtagerType.php b/src/Client/StructType/ForsendelseModtagerType.php deleted file mode 100644 index 406e005..0000000 --- a/src/Client/StructType/ForsendelseModtagerType.php +++ /dev/null @@ -1,85 +0,0 @@ -setAfsendelseModtager($afsendelseModtager) - ->setModtagerAdresse($modtagerAdresse); - } - /** - * Get AfsendelseModtager value - * @return \Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType|null - */ - public function getAfsendelseModtager(): ?\Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType - { - return $this->AfsendelseModtager; - } - /** - * Set AfsendelseModtager value - * @param \Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType $afsendelseModtager - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseModtagerType - */ - public function setAfsendelseModtager(?\Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType $afsendelseModtager = null): self - { - $this->AfsendelseModtager = $afsendelseModtager; - - return $this; - } - /** - * Get ModtagerAdresse value - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType|null - */ - public function getModtagerAdresse(): ?\Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - { - return $this->ModtagerAdresse; - } - /** - * Set ModtagerAdresse value - * @param \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType $modtagerAdresse - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseModtagerType - */ - public function setModtagerAdresse(?\Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType $modtagerAdresse = null): self - { - $this->ModtagerAdresse = $modtagerAdresse; - - return $this; - } -} diff --git a/src/Client/StructType/InvocationContextType.php b/src/Client/StructType/InvocationContextType.php deleted file mode 100644 index a754943..0000000 --- a/src/Client/StructType/InvocationContextType.php +++ /dev/null @@ -1,310 +0,0 @@ -setServiceAgreementUUID($serviceAgreementUUID) - ->setUserSystemUUID($userSystemUUID) - ->setUserUUID($userUUID) - ->setServiceUUID($serviceUUID) - ->setOnBehalfOfUser($onBehalfOfUser) - ->setCallersServiceCallIdentifier($callersServiceCallIdentifier) - ->setAccountingInfo($accountingInfo); - } - /** - * Get ServiceAgreementUUID value - * @return string - */ - public function getServiceAgreementUUID(): string - { - return $this->ServiceAgreementUUID; - } - /** - * Set ServiceAgreementUUID value - * @param string $serviceAgreementUUID - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - */ - public function setServiceAgreementUUID(string $serviceAgreementUUID): self - { - // validation for constraint: string - if (!is_null($serviceAgreementUUID) && !is_string($serviceAgreementUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceAgreementUUID, true), gettype($serviceAgreementUUID)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($serviceAgreementUUID) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $serviceAgreementUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($serviceAgreementUUID, true)), __LINE__); - } - $this->ServiceAgreementUUID = $serviceAgreementUUID; - - return $this; - } - /** - * Get UserSystemUUID value - * @return string - */ - public function getUserSystemUUID(): string - { - return $this->UserSystemUUID; - } - /** - * Set UserSystemUUID value - * @param string $userSystemUUID - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - */ - public function setUserSystemUUID(string $userSystemUUID): self - { - // validation for constraint: string - if (!is_null($userSystemUUID) && !is_string($userSystemUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($userSystemUUID, true), gettype($userSystemUUID)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($userSystemUUID) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $userSystemUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($userSystemUUID, true)), __LINE__); - } - $this->UserSystemUUID = $userSystemUUID; - - return $this; - } - /** - * Get UserUUID value - * @return string - */ - public function getUserUUID(): string - { - return $this->UserUUID; - } - /** - * Set UserUUID value - * @param string $userUUID - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - */ - public function setUserUUID(string $userUUID): self - { - // validation for constraint: string - if (!is_null($userUUID) && !is_string($userUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($userUUID, true), gettype($userUUID)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($userUUID) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $userUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($userUUID, true)), __LINE__); - } - $this->UserUUID = $userUUID; - - return $this; - } - /** - * Get ServiceUUID value - * @return string - */ - public function getServiceUUID(): string - { - return $this->ServiceUUID; - } - /** - * Set ServiceUUID value - * @param string $serviceUUID - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - */ - public function setServiceUUID(string $serviceUUID): self - { - // validation for constraint: string - if (!is_null($serviceUUID) && !is_string($serviceUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceUUID, true), gettype($serviceUUID)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($serviceUUID) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $serviceUUID)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($serviceUUID, true)), __LINE__); - } - $this->ServiceUUID = $serviceUUID; - - return $this; - } - /** - * Get OnBehalfOfUser value - * @return string|null - */ - public function getOnBehalfOfUser(): ?string - { - return $this->OnBehalfOfUser; - } - /** - * Set OnBehalfOfUser value - * @param string $onBehalfOfUser - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - */ - public function setOnBehalfOfUser(?string $onBehalfOfUser = null): self - { - // validation for constraint: string - if (!is_null($onBehalfOfUser) && !is_string($onBehalfOfUser)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($onBehalfOfUser, true), gettype($onBehalfOfUser)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($onBehalfOfUser) && mb_strlen((string) $onBehalfOfUser) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $onBehalfOfUser)), __LINE__); - } - $this->OnBehalfOfUser = $onBehalfOfUser; - - return $this; - } - /** - * Get CallersServiceCallIdentifier value - * @return string|null - */ - public function getCallersServiceCallIdentifier(): ?string - { - return $this->CallersServiceCallIdentifier; - } - /** - * Set CallersServiceCallIdentifier value - * @param string $callersServiceCallIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - */ - public function setCallersServiceCallIdentifier(?string $callersServiceCallIdentifier = null): self - { - // validation for constraint: string - if (!is_null($callersServiceCallIdentifier) && !is_string($callersServiceCallIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($callersServiceCallIdentifier, true), gettype($callersServiceCallIdentifier)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($callersServiceCallIdentifier) && mb_strlen((string) $callersServiceCallIdentifier) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $callersServiceCallIdentifier)), __LINE__); - } - $this->CallersServiceCallIdentifier = $callersServiceCallIdentifier; - - return $this; - } - /** - * Get AccountingInfo value - * @return string|null - */ - public function getAccountingInfo(): ?string - { - return $this->AccountingInfo; - } - /** - * Set AccountingInfo value - * @param string $accountingInfo - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - */ - public function setAccountingInfo(?string $accountingInfo = null): self - { - // validation for constraint: string - if (!is_null($accountingInfo) && !is_string($accountingInfo)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accountingInfo, true), gettype($accountingInfo)), __LINE__); - } - // validation for constraint: maxLength(255) - if (!is_null($accountingInfo) && mb_strlen((string) $accountingInfo) > 255) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 255', mb_strlen((string) $accountingInfo)), __LINE__); - } - $this->AccountingInfo = $accountingInfo; - - return $this; - } -} diff --git a/src/Client/StructType/KanalUafhaengigeParametreIType.php b/src/Client/StructType/KanalUafhaengigeParametreIType.php deleted file mode 100644 index 5bf10a1..0000000 --- a/src/Client/StructType/KanalUafhaengigeParametreIType.php +++ /dev/null @@ -1,350 +0,0 @@ -setEnhedTekst($enhedTekst) - ->setBrugerNavn($brugerNavn) - ->setKonteringsGruppeTekst($konteringsGruppeTekst) - ->setForsendelseAfsender($forsendelseAfsender) - ->setPaatrykAfsenderAdresseIndikator($paatrykAfsenderAdresseIndikator) - ->setPaatrykModtagerAdresseIndikator($paatrykModtagerAdresseIndikator) - ->setPaatrykBrevdatoIndikator($paatrykBrevdatoIndikator) - ->setKanalKode($kanalKode) - ->setHasteBrevIndikator($hasteBrevIndikator); - } - /** - * Get EnhedTekst value - * @return string|null - */ - public function getEnhedTekst(): ?string - { - return $this->EnhedTekst; - } - /** - * Set EnhedTekst value - * @param string $enhedTekst - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setEnhedTekst(?string $enhedTekst = null): self - { - // validation for constraint: string - if (!is_null($enhedTekst) && !is_string($enhedTekst)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($enhedTekst, true), gettype($enhedTekst)), __LINE__); - } - // validation for constraint: maxLength(2000) - if (!is_null($enhedTekst) && mb_strlen((string) $enhedTekst) > 2000) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 2000', mb_strlen((string) $enhedTekst)), __LINE__); - } - $this->EnhedTekst = $enhedTekst; - - return $this; - } - /** - * Get BrugerNavn value - * @return string|null - */ - public function getBrugerNavn(): ?string - { - return $this->BrugerNavn; - } - /** - * Set BrugerNavn value - * @param string $brugerNavn - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setBrugerNavn(?string $brugerNavn = null): self - { - // validation for constraint: string - if (!is_null($brugerNavn) && !is_string($brugerNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($brugerNavn, true), gettype($brugerNavn)), __LINE__); - } - // validation for constraint: maxLength(2000) - if (!is_null($brugerNavn) && mb_strlen((string) $brugerNavn) > 2000) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 2000', mb_strlen((string) $brugerNavn)), __LINE__); - } - // validation for constraint: minLength(1) - if (!is_null($brugerNavn) && mb_strlen((string) $brugerNavn) < 1) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be greater than or equal to 1', mb_strlen((string) $brugerNavn)), __LINE__); - } - $this->BrugerNavn = $brugerNavn; - - return $this; - } - /** - * Get KonteringsGruppeTekst value - * @return string|null - */ - public function getKonteringsGruppeTekst(): ?string - { - return $this->KonteringsGruppeTekst; - } - /** - * Set KonteringsGruppeTekst value - * @param string $konteringsGruppeTekst - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setKonteringsGruppeTekst(?string $konteringsGruppeTekst = null): self - { - // validation for constraint: string - if (!is_null($konteringsGruppeTekst) && !is_string($konteringsGruppeTekst)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($konteringsGruppeTekst, true), gettype($konteringsGruppeTekst)), __LINE__); - } - // validation for constraint: maxLength(2000) - if (!is_null($konteringsGruppeTekst) && mb_strlen((string) $konteringsGruppeTekst) > 2000) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 2000', mb_strlen((string) $konteringsGruppeTekst)), __LINE__); - } - $this->KonteringsGruppeTekst = $konteringsGruppeTekst; - - return $this; - } - /** - * Get ForsendelseAfsender value - * @return \Drupal\os2forms_digital_post\Client\StructType\ForsendelseAfsenderType|null - */ - public function getForsendelseAfsender(): ?\Drupal\os2forms_digital_post\Client\StructType\ForsendelseAfsenderType - { - return $this->ForsendelseAfsender; - } - /** - * Set ForsendelseAfsender value - * @param \Drupal\os2forms_digital_post\Client\StructType\ForsendelseAfsenderType $forsendelseAfsender - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setForsendelseAfsender(?\Drupal\os2forms_digital_post\Client\StructType\ForsendelseAfsenderType $forsendelseAfsender = null): self - { - $this->ForsendelseAfsender = $forsendelseAfsender; - - return $this; - } - /** - * Get PaatrykAfsenderAdresseIndikator value - * @return bool|null - */ - public function getPaatrykAfsenderAdresseIndikator(): ?bool - { - return $this->PaatrykAfsenderAdresseIndikator; - } - /** - * Set PaatrykAfsenderAdresseIndikator value - * @param bool $paatrykAfsenderAdresseIndikator - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setPaatrykAfsenderAdresseIndikator(?bool $paatrykAfsenderAdresseIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($paatrykAfsenderAdresseIndikator) && !is_bool($paatrykAfsenderAdresseIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($paatrykAfsenderAdresseIndikator, true), gettype($paatrykAfsenderAdresseIndikator)), __LINE__); - } - $this->PaatrykAfsenderAdresseIndikator = $paatrykAfsenderAdresseIndikator; - - return $this; - } - /** - * Get PaatrykModtagerAdresseIndikator value - * @return bool|null - */ - public function getPaatrykModtagerAdresseIndikator(): ?bool - { - return $this->PaatrykModtagerAdresseIndikator; - } - /** - * Set PaatrykModtagerAdresseIndikator value - * @param bool $paatrykModtagerAdresseIndikator - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setPaatrykModtagerAdresseIndikator(?bool $paatrykModtagerAdresseIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($paatrykModtagerAdresseIndikator) && !is_bool($paatrykModtagerAdresseIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($paatrykModtagerAdresseIndikator, true), gettype($paatrykModtagerAdresseIndikator)), __LINE__); - } - $this->PaatrykModtagerAdresseIndikator = $paatrykModtagerAdresseIndikator; - - return $this; - } - /** - * Get PaatrykBrevdatoIndikator value - * @return bool|null - */ - public function getPaatrykBrevdatoIndikator(): ?bool - { - return $this->PaatrykBrevdatoIndikator; - } - /** - * Set PaatrykBrevdatoIndikator value - * @param bool $paatrykBrevdatoIndikator - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setPaatrykBrevdatoIndikator(?bool $paatrykBrevdatoIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($paatrykBrevdatoIndikator) && !is_bool($paatrykBrevdatoIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($paatrykBrevdatoIndikator, true), gettype($paatrykBrevdatoIndikator)), __LINE__); - } - $this->PaatrykBrevdatoIndikator = $paatrykBrevdatoIndikator; - - return $this; - } - /** - * Get KanalKode value - * @return string|null - */ - public function getKanalKode(): ?string - { - return $this->KanalKode; - } - /** - * Set KanalKode value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\KanalKodeType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\KanalKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $kanalKode - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setKanalKode(?string $kanalKode = null): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\KanalKodeType::valueIsValid($kanalKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\KanalKodeType', is_array($kanalKode) ? implode(', ', $kanalKode) : var_export($kanalKode, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\KanalKodeType::getValidValues())), __LINE__); - } - $this->KanalKode = $kanalKode; - - return $this; - } - /** - * Get HasteBrevIndikator value - * @return bool|null - */ - public function getHasteBrevIndikator(): ?bool - { - return $this->HasteBrevIndikator; - } - /** - * Set HasteBrevIndikator value - * @param bool $hasteBrevIndikator - * @return \Drupal\os2forms_digital_post\Client\StructType\KanalUafhaengigeParametreIType - */ - public function setHasteBrevIndikator(?bool $hasteBrevIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($hasteBrevIndikator) && !is_bool($hasteBrevIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($hasteBrevIndikator, true), gettype($hasteBrevIndikator)), __LINE__); - } - $this->HasteBrevIndikator = $hasteBrevIndikator; - - return $this; - } -} diff --git a/src/Client/StructType/KontaktOplysningType.php b/src/Client/StructType/KontaktOplysningType.php deleted file mode 100644 index 16de6be..0000000 --- a/src/Client/StructType/KontaktOplysningType.php +++ /dev/null @@ -1,1475 +0,0 @@ -setPersonName($personName) - ->setCoNavn($coNavn) - ->setStreetName($streetName) - ->setStreetBuildingIdentifier($streetBuildingIdentifier) - ->setFloorIdentifier($floorIdentifier) - ->setSuiteIdentifier($suiteIdentifier) - ->setMailDeliverySublocationIdentifier($mailDeliverySublocationIdentifier) - ->setPostCodeIdentifier($postCodeIdentifier) - ->setDistrictSubdivisionIdentifier($districtSubdivisionIdentifier) - ->setPostOfficeBoxIdentifier($postOfficeBoxIdentifier) - ->setPostalAddressFirstLineText($postalAddressFirstLineText) - ->setPostalAddressSecondLineText($postalAddressSecondLineText) - ->setPostalAddressThirdLineText($postalAddressThirdLineText) - ->setPostalAddressFourthLineText($postalAddressFourthLineText) - ->setPostalAddressFifthLineText($postalAddressFifthLineText) - ->setPostalAddressSixthLineText($postalAddressSixthLineText) - ->setCountryIdentificationCode($countryIdentificationCode); - } - /** - * Get PersonName value - * @return string|null - */ - public function getPersonName(): ?string - { - return $this->PersonName; - } - /** - * Set PersonName value - * @param string $personName - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPersonName(?string $personName = null): self - { - // validation for constraint: string - if (!is_null($personName) && !is_string($personName)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($personName, true), gettype($personName)), __LINE__); - } - $this->PersonName = $personName; - - return $this; - } - /** - * Get CoNavn value - * @return string|null - */ - public function getCoNavn(): ?string - { - return isset($this->CoNavn) ? $this->CoNavn : null; - } - /** - * This method is responsible for validating the value passed to the setCoNavn method - * This method is willingly generated in order to preserve the one-line inline validation within the setCoNavn method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateCoNavnForChoiceConstraintsFromSetCoNavn($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property CoNavn can\'t be set as the property %s is already set. Only one property must be set among these properties: CoNavn, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set CoNavn value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $coNavn - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setCoNavn(?string $coNavn = null): self - { - // validation for constraint: string - if (!is_null($coNavn) && !is_string($coNavn)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($coNavn, true), gettype($coNavn)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($coNavnChoiceErrorMessage = self::validateCoNavnForChoiceConstraintsFromSetCoNavn($coNavn))) { - //throw new InvalidArgumentException($coNavnChoiceErrorMessage, __LINE__); - } - if (is_null($coNavn) || (is_array($coNavn) && empty($coNavn))) { - unset($this->CoNavn); - } else { - $this->CoNavn = $coNavn; - } - - return $this; - } - /** - * Get StreetName value - * @return string|null - */ - public function getStreetName(): ?string - { - return isset($this->StreetName) ? $this->StreetName : null; - } - /** - * This method is responsible for validating the value passed to the setStreetName method - * This method is willingly generated in order to preserve the one-line inline validation within the setStreetName method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateStreetNameForChoiceConstraintsFromSetStreetName($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property StreetName can\'t be set as the property %s is already set. Only one property must be set among these properties: StreetName, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set StreetName value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $streetName - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setStreetName(?string $streetName = null): self - { - // validation for constraint: string - if (!is_null($streetName) && !is_string($streetName)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($streetName, true), gettype($streetName)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($streetNameChoiceErrorMessage = self::validateStreetNameForChoiceConstraintsFromSetStreetName($streetName))) { - //throw new InvalidArgumentException($streetNameChoiceErrorMessage, __LINE__); - } - if (is_null($streetName) || (is_array($streetName) && empty($streetName))) { - unset($this->StreetName); - } else { - $this->StreetName = $streetName; - } - - return $this; - } - /** - * Get StreetBuildingIdentifier value - * @return string|null - */ - public function getStreetBuildingIdentifier(): ?string - { - return isset($this->StreetBuildingIdentifier) ? $this->StreetBuildingIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setStreetBuildingIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setStreetBuildingIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateStreetBuildingIdentifierForChoiceConstraintsFromSetStreetBuildingIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property StreetBuildingIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: StreetBuildingIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set StreetBuildingIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $streetBuildingIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setStreetBuildingIdentifier(?string $streetBuildingIdentifier = null): self - { - // validation for constraint: string - if (!is_null($streetBuildingIdentifier) && !is_string($streetBuildingIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($streetBuildingIdentifier, true), gettype($streetBuildingIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($streetBuildingIdentifierChoiceErrorMessage = self::validateStreetBuildingIdentifierForChoiceConstraintsFromSetStreetBuildingIdentifier($streetBuildingIdentifier))) { - //throw new InvalidArgumentException($streetBuildingIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($streetBuildingIdentifier) || (is_array($streetBuildingIdentifier) && empty($streetBuildingIdentifier))) { - unset($this->StreetBuildingIdentifier); - } else { - $this->StreetBuildingIdentifier = $streetBuildingIdentifier; - } - - return $this; - } - /** - * Get FloorIdentifier value - * @return string|null - */ - public function getFloorIdentifier(): ?string - { - return isset($this->FloorIdentifier) ? $this->FloorIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setFloorIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setFloorIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateFloorIdentifierForChoiceConstraintsFromSetFloorIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property FloorIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: FloorIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set FloorIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $floorIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setFloorIdentifier(?string $floorIdentifier = null): self - { - // validation for constraint: string - if (!is_null($floorIdentifier) && !is_string($floorIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($floorIdentifier, true), gettype($floorIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($floorIdentifierChoiceErrorMessage = self::validateFloorIdentifierForChoiceConstraintsFromSetFloorIdentifier($floorIdentifier))) { - //throw new InvalidArgumentException($floorIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($floorIdentifier) || (is_array($floorIdentifier) && empty($floorIdentifier))) { - unset($this->FloorIdentifier); - } else { - $this->FloorIdentifier = $floorIdentifier; - } - - return $this; - } - /** - * Get SuiteIdentifier value - * @return string|null - */ - public function getSuiteIdentifier(): ?string - { - return isset($this->SuiteIdentifier) ? $this->SuiteIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setSuiteIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setSuiteIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateSuiteIdentifierForChoiceConstraintsFromSetSuiteIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property SuiteIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: SuiteIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set SuiteIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $suiteIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setSuiteIdentifier(?string $suiteIdentifier = null): self - { - // validation for constraint: string - if (!is_null($suiteIdentifier) && !is_string($suiteIdentifier)) { - //throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($suiteIdentifier, true), gettype($suiteIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($suiteIdentifierChoiceErrorMessage = self::validateSuiteIdentifierForChoiceConstraintsFromSetSuiteIdentifier($suiteIdentifier))) { - throw new InvalidArgumentException($suiteIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($suiteIdentifier) || (is_array($suiteIdentifier) && empty($suiteIdentifier))) { - unset($this->SuiteIdentifier); - } else { - $this->SuiteIdentifier = $suiteIdentifier; - } - - return $this; - } - /** - * Get MailDeliverySublocationIdentifier value - * @return string|null - */ - public function getMailDeliverySublocationIdentifier(): ?string - { - return isset($this->MailDeliverySublocationIdentifier) ? $this->MailDeliverySublocationIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setMailDeliverySublocationIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setMailDeliverySublocationIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateMailDeliverySublocationIdentifierForChoiceConstraintsFromSetMailDeliverySublocationIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property MailDeliverySublocationIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: MailDeliverySublocationIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set MailDeliverySublocationIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $mailDeliverySublocationIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setMailDeliverySublocationIdentifier(?string $mailDeliverySublocationIdentifier = null): self - { - // validation for constraint: string - if (!is_null($mailDeliverySublocationIdentifier) && !is_string($mailDeliverySublocationIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mailDeliverySublocationIdentifier, true), gettype($mailDeliverySublocationIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($mailDeliverySublocationIdentifierChoiceErrorMessage = self::validateMailDeliverySublocationIdentifierForChoiceConstraintsFromSetMailDeliverySublocationIdentifier($mailDeliverySublocationIdentifier))) { - //throw new InvalidArgumentException($mailDeliverySublocationIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($mailDeliverySublocationIdentifier) || (is_array($mailDeliverySublocationIdentifier) && empty($mailDeliverySublocationIdentifier))) { - unset($this->MailDeliverySublocationIdentifier); - } else { - $this->MailDeliverySublocationIdentifier = $mailDeliverySublocationIdentifier; - } - - return $this; - } - /** - * Get PostCodeIdentifier value - * @return string|null - */ - public function getPostCodeIdentifier(): ?string - { - return isset($this->PostCodeIdentifier) ? $this->PostCodeIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setPostCodeIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostCodeIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostCodeIdentifierForChoiceConstraintsFromSetPostCodeIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostCodeIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: PostCodeIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostCodeIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postCodeIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPostCodeIdentifier(?string $postCodeIdentifier = null): self - { - // validation for constraint: string - if (!is_null($postCodeIdentifier) && !is_string($postCodeIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postCodeIdentifier, true), gettype($postCodeIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postCodeIdentifierChoiceErrorMessage = self::validatePostCodeIdentifierForChoiceConstraintsFromSetPostCodeIdentifier($postCodeIdentifier))) { - //throw new InvalidArgumentException($postCodeIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($postCodeIdentifier) || (is_array($postCodeIdentifier) && empty($postCodeIdentifier))) { - unset($this->PostCodeIdentifier); - } else { - $this->PostCodeIdentifier = $postCodeIdentifier; - } - - return $this; - } - /** - * Get DistrictSubdivisionIdentifier value - * @return string|null - */ - public function getDistrictSubdivisionIdentifier(): ?string - { - return isset($this->DistrictSubdivisionIdentifier) ? $this->DistrictSubdivisionIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setDistrictSubdivisionIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setDistrictSubdivisionIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateDistrictSubdivisionIdentifierForChoiceConstraintsFromSetDistrictSubdivisionIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property DistrictSubdivisionIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: DistrictSubdivisionIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set DistrictSubdivisionIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $districtSubdivisionIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setDistrictSubdivisionIdentifier(?string $districtSubdivisionIdentifier = null): self - { - // validation for constraint: string - if (!is_null($districtSubdivisionIdentifier) && !is_string($districtSubdivisionIdentifier)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($districtSubdivisionIdentifier, true), gettype($districtSubdivisionIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($districtSubdivisionIdentifierChoiceErrorMessage = self::validateDistrictSubdivisionIdentifierForChoiceConstraintsFromSetDistrictSubdivisionIdentifier($districtSubdivisionIdentifier))) { - //throw new InvalidArgumentException($districtSubdivisionIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($districtSubdivisionIdentifier) || (is_array($districtSubdivisionIdentifier) && empty($districtSubdivisionIdentifier))) { - unset($this->DistrictSubdivisionIdentifier); - } else { - $this->DistrictSubdivisionIdentifier = $districtSubdivisionIdentifier; - } - - return $this; - } - /** - * Get PostOfficeBoxIdentifier value - * @return int|null - */ - public function getPostOfficeBoxIdentifier(): ?int - { - return isset($this->PostOfficeBoxIdentifier) ? $this->PostOfficeBoxIdentifier : null; - } - /** - * This method is responsible for validating the value passed to the setPostOfficeBoxIdentifier method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostOfficeBoxIdentifier method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostOfficeBoxIdentifierForChoiceConstraintsFromSetPostOfficeBoxIdentifier($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostOfficeBoxIdentifier can\'t be set as the property %s is already set. Only one property must be set among these properties: PostOfficeBoxIdentifier, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostOfficeBoxIdentifier value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param int $postOfficeBoxIdentifier - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPostOfficeBoxIdentifier(?int $postOfficeBoxIdentifier = null): self - { - // validation for constraint: int - if (!is_null($postOfficeBoxIdentifier) && !(is_int($postOfficeBoxIdentifier) || ctype_digit($postOfficeBoxIdentifier))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($postOfficeBoxIdentifier, true), gettype($postOfficeBoxIdentifier)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postOfficeBoxIdentifierChoiceErrorMessage = self::validatePostOfficeBoxIdentifierForChoiceConstraintsFromSetPostOfficeBoxIdentifier($postOfficeBoxIdentifier))) { - //throw new InvalidArgumentException($postOfficeBoxIdentifierChoiceErrorMessage, __LINE__); - } - if (is_null($postOfficeBoxIdentifier) || (is_array($postOfficeBoxIdentifier) && empty($postOfficeBoxIdentifier))) { - unset($this->PostOfficeBoxIdentifier); - } else { - $this->PostOfficeBoxIdentifier = $postOfficeBoxIdentifier; - } - - return $this; - } - /** - * Get PostalAddressFirstLineText value - * @return string|null - */ - public function getPostalAddressFirstLineText(): ?string - { - return isset($this->PostalAddressFirstLineText) ? $this->PostalAddressFirstLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressFirstLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressFirstLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressFirstLineTextForChoiceConstraintsFromSetPostalAddressFirstLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressFirstLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressFirstLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressFirstLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressFirstLineText - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPostalAddressFirstLineText(?string $postalAddressFirstLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressFirstLineText) && !is_string($postalAddressFirstLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressFirstLineText, true), gettype($postalAddressFirstLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressFirstLineTextChoiceErrorMessage = self::validatePostalAddressFirstLineTextForChoiceConstraintsFromSetPostalAddressFirstLineText($postalAddressFirstLineText))) { - //throw new InvalidArgumentException($postalAddressFirstLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressFirstLineText) || (is_array($postalAddressFirstLineText) && empty($postalAddressFirstLineText))) { - unset($this->PostalAddressFirstLineText); - } else { - $this->PostalAddressFirstLineText = $postalAddressFirstLineText; - } - - return $this; - } - /** - * Get PostalAddressSecondLineText value - * @return string|null - */ - public function getPostalAddressSecondLineText(): ?string - { - return isset($this->PostalAddressSecondLineText) ? $this->PostalAddressSecondLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressSecondLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressSecondLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressSecondLineTextForChoiceConstraintsFromSetPostalAddressSecondLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressSecondLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressSecondLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressSecondLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressSecondLineText - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPostalAddressSecondLineText(?string $postalAddressSecondLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressSecondLineText) && !is_string($postalAddressSecondLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressSecondLineText, true), gettype($postalAddressSecondLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressSecondLineTextChoiceErrorMessage = self::validatePostalAddressSecondLineTextForChoiceConstraintsFromSetPostalAddressSecondLineText($postalAddressSecondLineText))) { - //throw new InvalidArgumentException($postalAddressSecondLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressSecondLineText) || (is_array($postalAddressSecondLineText) && empty($postalAddressSecondLineText))) { - unset($this->PostalAddressSecondLineText); - } else { - $this->PostalAddressSecondLineText = $postalAddressSecondLineText; - } - - return $this; - } - /** - * Get PostalAddressThirdLineText value - * @return string|null - */ - public function getPostalAddressThirdLineText(): ?string - { - return isset($this->PostalAddressThirdLineText) ? $this->PostalAddressThirdLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressThirdLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressThirdLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressThirdLineTextForChoiceConstraintsFromSetPostalAddressThirdLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressThirdLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressThirdLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressThirdLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressThirdLineText - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPostalAddressThirdLineText(?string $postalAddressThirdLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressThirdLineText) && !is_string($postalAddressThirdLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressThirdLineText, true), gettype($postalAddressThirdLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressThirdLineTextChoiceErrorMessage = self::validatePostalAddressThirdLineTextForChoiceConstraintsFromSetPostalAddressThirdLineText($postalAddressThirdLineText))) { - //throw new InvalidArgumentException($postalAddressThirdLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressThirdLineText) || (is_array($postalAddressThirdLineText) && empty($postalAddressThirdLineText))) { - unset($this->PostalAddressThirdLineText); - } else { - $this->PostalAddressThirdLineText = $postalAddressThirdLineText; - } - - return $this; - } - /** - * Get PostalAddressFourthLineText value - * @return string|null - */ - public function getPostalAddressFourthLineText(): ?string - { - return isset($this->PostalAddressFourthLineText) ? $this->PostalAddressFourthLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressFourthLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressFourthLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressFourthLineTextForChoiceConstraintsFromSetPostalAddressFourthLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFifthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressFourthLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressFourthLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressFourthLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressFourthLineText - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPostalAddressFourthLineText(?string $postalAddressFourthLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressFourthLineText) && !is_string($postalAddressFourthLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressFourthLineText, true), gettype($postalAddressFourthLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressFourthLineTextChoiceErrorMessage = self::validatePostalAddressFourthLineTextForChoiceConstraintsFromSetPostalAddressFourthLineText($postalAddressFourthLineText))) { - //throw new InvalidArgumentException($postalAddressFourthLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressFourthLineText) || (is_array($postalAddressFourthLineText) && empty($postalAddressFourthLineText))) { - unset($this->PostalAddressFourthLineText); - } else { - $this->PostalAddressFourthLineText = $postalAddressFourthLineText; - } - - return $this; - } - /** - * Get PostalAddressFifthLineText value - * @return string|null - */ - public function getPostalAddressFifthLineText(): ?string - { - return isset($this->PostalAddressFifthLineText) ? $this->PostalAddressFifthLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressFifthLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressFifthLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressFifthLineTextForChoiceConstraintsFromSetPostalAddressFifthLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressSixthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressFifthLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressFifthLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressFifthLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressFifthLineText - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPostalAddressFifthLineText(?string $postalAddressFifthLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressFifthLineText) && !is_string($postalAddressFifthLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressFifthLineText, true), gettype($postalAddressFifthLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressFifthLineTextChoiceErrorMessage = self::validatePostalAddressFifthLineTextForChoiceConstraintsFromSetPostalAddressFifthLineText($postalAddressFifthLineText))) { - //throw new InvalidArgumentException($postalAddressFifthLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressFifthLineText) || (is_array($postalAddressFifthLineText) && empty($postalAddressFifthLineText))) { - unset($this->PostalAddressFifthLineText); - } else { - $this->PostalAddressFifthLineText = $postalAddressFifthLineText; - } - - return $this; - } - /** - * Get PostalAddressSixthLineText value - * @return string|null - */ - public function getPostalAddressSixthLineText(): ?string - { - return isset($this->PostalAddressSixthLineText) ? $this->PostalAddressSixthLineText : null; - } - /** - * This method is responsible for validating the value passed to the setPostalAddressSixthLineText method - * This method is willingly generated in order to preserve the one-line inline validation within the setPostalAddressSixthLineText method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validatePostalAddressSixthLineTextForChoiceConstraintsFromSetPostalAddressSixthLineText($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CoNavn', - 'StreetName', - 'StreetBuildingIdentifier', - 'FloorIdentifier', - 'SuiteIdentifier', - 'MailDeliverySublocationIdentifier', - 'PostCodeIdentifier', - 'DistrictSubdivisionIdentifier', - 'PostOfficeBoxIdentifier', - 'PostalAddressFirstLineText', - 'PostalAddressSecondLineText', - 'PostalAddressThirdLineText', - 'PostalAddressFourthLineText', - 'PostalAddressFifthLineText', - 'PostCodeIdentifier', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property PostalAddressSixthLineText can\'t be set as the property %s is already set. Only one property must be set among these properties: PostalAddressSixthLineText, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set PostalAddressSixthLineText value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $postalAddressSixthLineText - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setPostalAddressSixthLineText(?string $postalAddressSixthLineText = null): self - { - // validation for constraint: string - if (!is_null($postalAddressSixthLineText) && !is_string($postalAddressSixthLineText)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalAddressSixthLineText, true), gettype($postalAddressSixthLineText)), __LINE__); - } - // validation for constraint: choice(CoNavn, StreetName, StreetBuildingIdentifier, FloorIdentifier, SuiteIdentifier, MailDeliverySublocationIdentifier, PostCodeIdentifier, DistrictSubdivisionIdentifier, PostOfficeBoxIdentifier, PostalAddressFirstLineText, PostalAddressSecondLineText, PostalAddressThirdLineText, PostalAddressFourthLineText, PostalAddressFifthLineText, PostalAddressSixthLineText) - if ('' !== ($postalAddressSixthLineTextChoiceErrorMessage = self::validatePostalAddressSixthLineTextForChoiceConstraintsFromSetPostalAddressSixthLineText($postalAddressSixthLineText))) { - //throw new InvalidArgumentException($postalAddressSixthLineTextChoiceErrorMessage, __LINE__); - } - if (is_null($postalAddressSixthLineText) || (is_array($postalAddressSixthLineText) && empty($postalAddressSixthLineText))) { - unset($this->PostalAddressSixthLineText); - } else { - $this->PostalAddressSixthLineText = $postalAddressSixthLineText; - } - - return $this; - } - /** - * Get CountryIdentificationCode value - * @return \Drupal\os2forms_digital_post\Client\StructType\CountryIdentificationCodeType|null - */ - public function getCountryIdentificationCode(): ?\Drupal\os2forms_digital_post\Client\StructType\CountryIdentificationCodeType - { - return $this->CountryIdentificationCode; - } - /** - * Set CountryIdentificationCode value - * @param \Drupal\os2forms_digital_post\Client\StructType\CountryIdentificationCodeType $countryIdentificationCode - * @return \Drupal\os2forms_digital_post\Client\StructType\KontaktOplysningType - */ - public function setCountryIdentificationCode(?\Drupal\os2forms_digital_post\Client\StructType\CountryIdentificationCodeType $countryIdentificationCode = null): self - { - $this->CountryIdentificationCode = $countryIdentificationCode; - - return $this; - } -} diff --git a/src/Client/StructType/MeddelelseFESDmetadataType.php b/src/Client/StructType/MeddelelseFESDmetadataType.php deleted file mode 100644 index f933c6f..0000000 --- a/src/Client/StructType/MeddelelseFESDmetadataType.php +++ /dev/null @@ -1,183 +0,0 @@ -setFESDdokumentIdentifikator($fESDdokumentIdentifikator) - ->setFESDaktoerIdentifikator($fESDaktoerIdentifikator) - ->setFESDsagIdentifikator($fESDsagIdentifikator) - ->setFESDsagsklassifikationIdentifikator($fESDsagsklassifikationIdentifikator); - } - /** - * Get FESDdokumentIdentifikator value - * @return string|null - */ - public function getFESDdokumentIdentifikator(): ?string - { - return $this->FESDdokumentIdentifikator; - } - /** - * Set FESDdokumentIdentifikator value - * @param string $fESDdokumentIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\MeddelelseFESDmetadataType - */ - public function setFESDdokumentIdentifikator(?string $fESDdokumentIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fESDdokumentIdentifikator) && !is_string($fESDdokumentIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fESDdokumentIdentifikator, true), gettype($fESDdokumentIdentifikator)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($fESDdokumentIdentifikator) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $fESDdokumentIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($fESDdokumentIdentifikator, true)), __LINE__); - } - $this->FESDdokumentIdentifikator = $fESDdokumentIdentifikator; - - return $this; - } - /** - * Get FESDaktoerIdentifikator value - * @return string|null - */ - public function getFESDaktoerIdentifikator(): ?string - { - return $this->FESDaktoerIdentifikator; - } - /** - * Set FESDaktoerIdentifikator value - * @param string $fESDaktoerIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\MeddelelseFESDmetadataType - */ - public function setFESDaktoerIdentifikator(?string $fESDaktoerIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fESDaktoerIdentifikator) && !is_string($fESDaktoerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fESDaktoerIdentifikator, true), gettype($fESDaktoerIdentifikator)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($fESDaktoerIdentifikator) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $fESDaktoerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($fESDaktoerIdentifikator, true)), __LINE__); - } - $this->FESDaktoerIdentifikator = $fESDaktoerIdentifikator; - - return $this; - } - /** - * Get FESDsagIdentifikator value - * @return string|null - */ - public function getFESDsagIdentifikator(): ?string - { - return $this->FESDsagIdentifikator; - } - /** - * Set FESDsagIdentifikator value - * @param string $fESDsagIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\MeddelelseFESDmetadataType - */ - public function setFESDsagIdentifikator(?string $fESDsagIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fESDsagIdentifikator) && !is_string($fESDsagIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fESDsagIdentifikator, true), gettype($fESDsagIdentifikator)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($fESDsagIdentifikator) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $fESDsagIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($fESDsagIdentifikator, true)), __LINE__); - } - $this->FESDsagIdentifikator = $fESDsagIdentifikator; - - return $this; - } - /** - * Get FESDsagsklassifikationIdentifikator value - * @return string|null - */ - public function getFESDsagsklassifikationIdentifikator(): ?string - { - return $this->FESDsagsklassifikationIdentifikator; - } - /** - * Set FESDsagsklassifikationIdentifikator value - * @param string $fESDsagsklassifikationIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\MeddelelseFESDmetadataType - */ - public function setFESDsagsklassifikationIdentifikator(?string $fESDsagsklassifikationIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($fESDsagsklassifikationIdentifikator) && !is_string($fESDsagsklassifikationIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fESDsagsklassifikationIdentifikator, true), gettype($fESDsagsklassifikationIdentifikator)), __LINE__); - } - // validation for constraint: pattern([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}, [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) - if (!is_null($fESDsagsklassifikationIdentifikator) && !preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', $fESDsagsklassifikationIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/', var_export($fESDsagsklassifikationIdentifikator, true)), __LINE__); - } - $this->FESDsagsklassifikationIdentifikator = $fESDsagsklassifikationIdentifikator; - - return $this; - } -} diff --git a/src/Client/StructType/MeddelelsesFormatObjektType.php b/src/Client/StructType/MeddelelsesFormatObjektType.php deleted file mode 100644 index 1fcdd1d..0000000 --- a/src/Client/StructType/MeddelelsesFormatObjektType.php +++ /dev/null @@ -1,64 +0,0 @@ -setAny($any); - } - /** - * Get any value - * @uses \DOMDocument::loadXML() - * @param bool $asString true: returns XML string, false: returns \DOMDocument - * @return \DOMDocument|string|null - */ - public function getAny(bool $asDomDocument = false) - { - $domDocument = null; - if (!empty($this->any) && $asDomDocument) { - $domDocument = new \DOMDocument('1.0', 'UTF-8'); - $domDocument->loadXML($this->any); - } - return $asDomDocument ? $domDocument : $this->any; - } - /** - * Set any value - * @uses \DOMDocument::hasChildNodes() - * @uses \DOMDocument::saveXML() - * @uses \DOMNode::item() - * @param \DOMDocument|string|null $any - * @return \Drupal\os2forms_digital_post\Client\StructType\MeddelelsesFormatObjektType - */ - public function setAny($any = null): self - { - // validation for constraint: xml - if (!is_null($any) && !$any instanceof \DOMDocument && (!is_string($any) || (is_string($any) && (empty($any) || (($anyDoc = new \DOMDocument()) && false === $anyDoc->loadXML($any)))))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a valid XML string', var_export($any, true)), __LINE__); - } - $this->any = ($any instanceof \DOMDocument) ? $any->saveXML($any->hasChildNodes() ? $any->childNodes->item(0) : null) : $any; - - return $this; - } -} diff --git a/src/Client/StructType/PostParametreType.php b/src/Client/StructType/PostParametreType.php deleted file mode 100644 index d4df4ef..0000000 --- a/src/Client/StructType/PostParametreType.php +++ /dev/null @@ -1,202 +0,0 @@ -setPostKategoriKode($postKategoriKode) - ->setAllokeringsIdentifikator($allokeringsIdentifikator) - ->setReturposthaandteringHosLeverandoerIndikator($returposthaandteringHosLeverandoerIndikator) - ->setInformationVedAdresseAendringIndikator($informationVedAdresseAendringIndikator) - ->setSideKvantitet($sideKvantitet); - } - /** - * Get PostKategoriKode value - * @return string|null - */ - public function getPostKategoriKode(): ?string - { - return $this->PostKategoriKode; - } - /** - * Set PostKategoriKode value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\PostKategoriKodeType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\PostKategoriKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $postKategoriKode - * @return \Drupal\os2forms_digital_post\Client\StructType\PostParametreType - */ - public function setPostKategoriKode(?string $postKategoriKode = null): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\PostKategoriKodeType::valueIsValid($postKategoriKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\PostKategoriKodeType', is_array($postKategoriKode) ? implode(', ', $postKategoriKode) : var_export($postKategoriKode, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\PostKategoriKodeType::getValidValues())), __LINE__); - } - $this->PostKategoriKode = $postKategoriKode; - - return $this; - } - /** - * Get AllokeringsIdentifikator value - * @return int|null - */ - public function getAllokeringsIdentifikator(): ?int - { - return $this->AllokeringsIdentifikator; - } - /** - * Set AllokeringsIdentifikator value - * @param int $allokeringsIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\PostParametreType - */ - public function setAllokeringsIdentifikator(?int $allokeringsIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($allokeringsIdentifikator) && !(is_int($allokeringsIdentifikator) || ctype_digit($allokeringsIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($allokeringsIdentifikator, true), gettype($allokeringsIdentifikator)), __LINE__); - } - $this->AllokeringsIdentifikator = $allokeringsIdentifikator; - - return $this; - } - /** - * Get ReturposthaandteringHosLeverandoerIndikator value - * @return bool|null - */ - public function getReturposthaandteringHosLeverandoerIndikator(): ?bool - { - return $this->ReturposthaandteringHosLeverandoerIndikator; - } - /** - * Set ReturposthaandteringHosLeverandoerIndikator value - * @param bool $returposthaandteringHosLeverandoerIndikator - * @return \Drupal\os2forms_digital_post\Client\StructType\PostParametreType - */ - public function setReturposthaandteringHosLeverandoerIndikator(?bool $returposthaandteringHosLeverandoerIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($returposthaandteringHosLeverandoerIndikator) && !is_bool($returposthaandteringHosLeverandoerIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($returposthaandteringHosLeverandoerIndikator, true), gettype($returposthaandteringHosLeverandoerIndikator)), __LINE__); - } - $this->ReturposthaandteringHosLeverandoerIndikator = $returposthaandteringHosLeverandoerIndikator; - - return $this; - } - /** - * Get InformationVedAdresseAendringIndikator value - * @return bool|null - */ - public function getInformationVedAdresseAendringIndikator(): ?bool - { - return $this->InformationVedAdresseAendringIndikator; - } - /** - * Set InformationVedAdresseAendringIndikator value - * @param bool $informationVedAdresseAendringIndikator - * @return \Drupal\os2forms_digital_post\Client\StructType\PostParametreType - */ - public function setInformationVedAdresseAendringIndikator(?bool $informationVedAdresseAendringIndikator = null): self - { - // validation for constraint: boolean - if (!is_null($informationVedAdresseAendringIndikator) && !is_bool($informationVedAdresseAendringIndikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($informationVedAdresseAendringIndikator, true), gettype($informationVedAdresseAendringIndikator)), __LINE__); - } - $this->InformationVedAdresseAendringIndikator = $informationVedAdresseAendringIndikator; - - return $this; - } - /** - * Get SideKvantitet value - * @return int|null - */ - public function getSideKvantitet(): ?int - { - return $this->SideKvantitet; - } - /** - * Set SideKvantitet value - * @param int $sideKvantitet - * @return \Drupal\os2forms_digital_post\Client\StructType\PostParametreType - */ - public function setSideKvantitet(?int $sideKvantitet = null): self - { - // validation for constraint: int - if (!is_null($sideKvantitet) && !(is_int($sideKvantitet) || ctype_digit($sideKvantitet))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($sideKvantitet, true), gettype($sideKvantitet)), __LINE__); - } - // validation for constraint: minInclusive - if (!is_null($sideKvantitet) && $sideKvantitet < 0) { - throw new InvalidArgumentException(sprintf('Invalid value %s, the value must be numerically greater than or equal to 0', var_export($sideKvantitet, true)), __LINE__); - } - $this->SideKvantitet = $sideKvantitet; - - return $this; - } -} diff --git a/src/Client/StructType/PrintAfsendBrevRequestType.php b/src/Client/StructType/PrintAfsendBrevRequestType.php deleted file mode 100644 index 98adae3..0000000 --- a/src/Client/StructType/PrintAfsendBrevRequestType.php +++ /dev/null @@ -1,146 +0,0 @@ -setBrevSPBody($brevSPBody) - ->setInvocationContext($invocationContext) - ->setAuthorityContext($authorityContext) - ->setCallContext($callContext); - } - /** - * Get BrevSPBody value - * @return \Drupal\os2forms_digital_post\Client\StructType\BrevSPBodyType - */ - public function getBrevSPBody(): \Drupal\os2forms_digital_post\Client\StructType\BrevSPBodyType - { - return $this->BrevSPBody; - } - /** - * Set BrevSPBody value - * @param \Drupal\os2forms_digital_post\Client\StructType\BrevSPBodyType $brevSPBody - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintAfsendBrevRequestType - */ - public function setBrevSPBody(\Drupal\os2forms_digital_post\Client\StructType\BrevSPBodyType $brevSPBody): self - { - $this->BrevSPBody = $brevSPBody; - - return $this; - } - /** - * Get InvocationContext value - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType|null - */ - public function getInvocationContext(): ?\Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - { - return $this->InvocationContext; - } - /** - * Set InvocationContext value - * @param \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType $invocationContext - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintAfsendBrevRequestType - */ - public function setInvocationContext(?\Drupal\os2forms_digital_post\Client\StructType\InvocationContextType $invocationContext = null): self - { - $this->InvocationContext = $invocationContext; - - return $this; - } - /** - * Get AuthorityContext value - * @return \Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType|null - */ - public function getAuthorityContext(): ?\Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType - { - return $this->AuthorityContext; - } - /** - * Set AuthorityContext value - * @param \Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType $authorityContext - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintAfsendBrevRequestType - */ - public function setAuthorityContext(?\Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType $authorityContext = null): self - { - $this->AuthorityContext = $authorityContext; - - return $this; - } - /** - * Get CallContext value - * @return \Drupal\os2forms_digital_post\Client\StructType\CallContextType|null - */ - public function getCallContext(): ?\Drupal\os2forms_digital_post\Client\StructType\CallContextType - { - return $this->CallContext; - } - /** - * Set CallContext value - * @param \Drupal\os2forms_digital_post\Client\StructType\CallContextType $callContext - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintAfsendBrevRequestType - */ - public function setCallContext(?\Drupal\os2forms_digital_post\Client\StructType\CallContextType $callContext = null): self - { - $this->CallContext = $callContext; - - return $this; - } -} diff --git a/src/Client/StructType/PrintAfsendBrevResponseType.php b/src/Client/StructType/PrintAfsendBrevResponseType.php deleted file mode 100644 index 480d806..0000000 --- a/src/Client/StructType/PrintAfsendBrevResponseType.php +++ /dev/null @@ -1,57 +0,0 @@ -setResultat($resultat); - } - /** - * Get resultat value - * @return bool - */ - public function getResultat(): bool - { - return $this->resultat; - } - /** - * Set resultat value - * @param bool $resultat - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintAfsendBrevResponseType - */ - public function setResultat(bool $resultat): self - { - // validation for constraint: boolean - if (!is_null($resultat) && !is_bool($resultat)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($resultat, true), gettype($resultat)), __LINE__); - } - $this->resultat = $resultat; - - return $this; - } -} diff --git a/src/Client/StructType/PrintParametreType.php b/src/Client/StructType/PrintParametreType.php deleted file mode 100644 index b2510d7..0000000 --- a/src/Client/StructType/PrintParametreType.php +++ /dev/null @@ -1,134 +0,0 @@ -setSimplexDuplexKode($simplexDuplexKode) - ->setFarveSHKode($farveSHKode) - ->setKuvertTypeKode($kuvertTypeKode); - } - /** - * Get SimplexDuplexKode value - * @return string|null - */ - public function getSimplexDuplexKode(): ?string - { - return $this->SimplexDuplexKode; - } - /** - * Set SimplexDuplexKode value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\SimplexDuplexKodeType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\SimplexDuplexKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $simplexDuplexKode - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintParametreType - */ - public function setSimplexDuplexKode(?string $simplexDuplexKode = null): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\SimplexDuplexKodeType::valueIsValid($simplexDuplexKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\SimplexDuplexKodeType', is_array($simplexDuplexKode) ? implode(', ', $simplexDuplexKode) : var_export($simplexDuplexKode, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\SimplexDuplexKodeType::getValidValues())), __LINE__); - } - $this->SimplexDuplexKode = $simplexDuplexKode; - - return $this; - } - /** - * Get FarveSHKode value - * @return string|null - */ - public function getFarveSHKode(): ?string - { - return $this->FarveSHKode; - } - /** - * Set FarveSHKode value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\FarveSHKodeType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\FarveSHKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $farveSHKode - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintParametreType - */ - public function setFarveSHKode(?string $farveSHKode = null): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\FarveSHKodeType::valueIsValid($farveSHKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\FarveSHKodeType', is_array($farveSHKode) ? implode(', ', $farveSHKode) : var_export($farveSHKode, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\FarveSHKodeType::getValidValues())), __LINE__); - } - $this->FarveSHKode = $farveSHKode; - - return $this; - } - /** - * Get KuvertTypeKode value - * @return string|null - */ - public function getKuvertTypeKode(): ?string - { - return $this->KuvertTypeKode; - } - /** - * Set KuvertTypeKode value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\KuvertTypeKodeType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\KuvertTypeKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $kuvertTypeKode - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintParametreType - */ - public function setKuvertTypeKode(?string $kuvertTypeKode = null): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\KuvertTypeKodeType::valueIsValid($kuvertTypeKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\KuvertTypeKodeType', is_array($kuvertTypeKode) ? implode(', ', $kuvertTypeKode) : var_export($kuvertTypeKode, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\KuvertTypeKodeType::getValidValues())), __LINE__); - } - $this->KuvertTypeKode = $kuvertTypeKode; - - return $this; - } -} diff --git a/src/Client/StructType/PrintSpoergTilmeldingRequestType.php b/src/Client/StructType/PrintSpoergTilmeldingRequestType.php deleted file mode 100644 index c6f367c..0000000 --- a/src/Client/StructType/PrintSpoergTilmeldingRequestType.php +++ /dev/null @@ -1,146 +0,0 @@ -setTilmeldingRequest($tilmeldingRequest) - ->setInvocationContext($invocationContext) - ->setAuthorityContext($authorityContext) - ->setCallContext($callContext); - } - /** - * Get TilmeldingRequest value - * @return \Drupal\os2forms_digital_post\Client\StructType\TilmeldingRequestType - */ - public function getTilmeldingRequest(): \Drupal\os2forms_digital_post\Client\StructType\TilmeldingRequestType - { - return $this->TilmeldingRequest; - } - /** - * Set TilmeldingRequest value - * @param \Drupal\os2forms_digital_post\Client\StructType\TilmeldingRequestType $tilmeldingRequest - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintSpoergTilmeldingRequestType - */ - public function setTilmeldingRequest(\Drupal\os2forms_digital_post\Client\StructType\TilmeldingRequestType $tilmeldingRequest): self - { - $this->TilmeldingRequest = $tilmeldingRequest; - - return $this; - } - /** - * Get InvocationContext value - * @return \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType|null - */ - public function getInvocationContext(): ?\Drupal\os2forms_digital_post\Client\StructType\InvocationContextType - { - return $this->InvocationContext; - } - /** - * Set InvocationContext value - * @param \Drupal\os2forms_digital_post\Client\StructType\InvocationContextType $invocationContext - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintSpoergTilmeldingRequestType - */ - public function setInvocationContext(?\Drupal\os2forms_digital_post\Client\StructType\InvocationContextType $invocationContext = null): self - { - $this->InvocationContext = $invocationContext; - - return $this; - } - /** - * Get AuthorityContext value - * @return \Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType|null - */ - public function getAuthorityContext(): ?\Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType - { - return $this->AuthorityContext; - } - /** - * Set AuthorityContext value - * @param \Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType $authorityContext - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintSpoergTilmeldingRequestType - */ - public function setAuthorityContext(?\Drupal\os2forms_digital_post\Client\StructType\AuthorityContextType $authorityContext = null): self - { - $this->AuthorityContext = $authorityContext; - - return $this; - } - /** - * Get CallContext value - * @return \Drupal\os2forms_digital_post\Client\StructType\CallContextType|null - */ - public function getCallContext(): ?\Drupal\os2forms_digital_post\Client\StructType\CallContextType - { - return $this->CallContext; - } - /** - * Set CallContext value - * @param \Drupal\os2forms_digital_post\Client\StructType\CallContextType $callContext - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintSpoergTilmeldingRequestType - */ - public function setCallContext(?\Drupal\os2forms_digital_post\Client\StructType\CallContextType $callContext = null): self - { - $this->CallContext = $callContext; - - return $this; - } -} diff --git a/src/Client/StructType/PrintSpoergTilmeldingResponseType.php b/src/Client/StructType/PrintSpoergTilmeldingResponseType.php deleted file mode 100644 index d86b48f..0000000 --- a/src/Client/StructType/PrintSpoergTilmeldingResponseType.php +++ /dev/null @@ -1,57 +0,0 @@ -setTilmeldt($tilmeldt); - } - /** - * Get tilmeldt value - * @return bool - */ - public function getTilmeldt(): bool - { - return $this->tilmeldt; - } - /** - * Set tilmeldt value - * @param bool $tilmeldt - * @return \Drupal\os2forms_digital_post\Client\StructType\PrintSpoergTilmeldingResponseType - */ - public function setTilmeldt(bool $tilmeldt): self - { - // validation for constraint: boolean - if (!is_null($tilmeldt) && !is_bool($tilmeldt)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($tilmeldt, true), gettype($tilmeldt)), __LINE__); - } - $this->tilmeldt = $tilmeldt; - - return $this; - } -} diff --git a/src/Client/StructType/ServiceplatformFaultType.php b/src/Client/StructType/ServiceplatformFaultType.php deleted file mode 100644 index 586c80d..0000000 --- a/src/Client/StructType/ServiceplatformFaultType.php +++ /dev/null @@ -1,53 +0,0 @@ -setErrorList($errorList); - } - /** - * Get ErrorList value - * @return \Drupal\os2forms_digital_post\Client\StructType\ErrorListType|null - */ - public function getErrorList(): ?\Drupal\os2forms_digital_post\Client\StructType\ErrorListType - { - return $this->ErrorList; - } - /** - * Set ErrorList value - * @param \Drupal\os2forms_digital_post\Client\StructType\ErrorListType $errorList - * @return \Drupal\os2forms_digital_post\Client\StructType\ServiceplatformFaultType - */ - public function setErrorList(?\Drupal\os2forms_digital_post\Client\StructType\ErrorListType $errorList = null): self - { - $this->ErrorList = $errorList; - - return $this; - } -} diff --git a/src/Client/StructType/SlutbrugerIdentitetType.php b/src/Client/StructType/SlutbrugerIdentitetType.php deleted file mode 100644 index 7248ec5..0000000 --- a/src/Client/StructType/SlutbrugerIdentitetType.php +++ /dev/null @@ -1,187 +0,0 @@ -setCPRnummerIdentifikator($cPRnummerIdentifikator) - ->setCVRnummerIdentifikator($cVRnummerIdentifikator); - } - /** - * Get CPRnummerIdentifikator value - * @return string|null - */ - public function getCPRnummerIdentifikator(): ?string - { - return isset($this->CPRnummerIdentifikator) ? $this->CPRnummerIdentifikator : null; - } - /** - * This method is responsible for validating the value passed to the setCPRnummerIdentifikator method - * This method is willingly generated in order to preserve the one-line inline validation within the setCPRnummerIdentifikator method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateCPRnummerIdentifikatorForChoiceConstraintsFromSetCPRnummerIdentifikator($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CVRnummerIdentifikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property CPRnummerIdentifikator can\'t be set as the property %s is already set. Only one property must be set among these properties: CPRnummerIdentifikator, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set CPRnummerIdentifikator value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $cPRnummerIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType - */ - public function setCPRnummerIdentifikator(?string $cPRnummerIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($cPRnummerIdentifikator) && !is_string($cPRnummerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cPRnummerIdentifikator, true), gettype($cPRnummerIdentifikator)), __LINE__); - } - // validation for constraint: choice(CPRnummerIdentifikator, CVRnummerIdentifikator) - if ('' !== ($cPRnummerIdentifikatorChoiceErrorMessage = self::validateCPRnummerIdentifikatorForChoiceConstraintsFromSetCPRnummerIdentifikator($cPRnummerIdentifikator))) { - throw new InvalidArgumentException($cPRnummerIdentifikatorChoiceErrorMessage, __LINE__); - } - // validation for constraint: pattern(((((0[1-9]|1[0-9]|2[0-9]|3[0-1])(01|03|05|07|08|10|12))|((0[1-9]|1[0-9]|2[0-9]|30)(04|06|09|11))|((0[1-9]|1[0-9]|2[0-9])(02)))[0-9]{6})|0000000000) - if (!is_null($cPRnummerIdentifikator) && !preg_match('/((((0[1-9]|1[0-9]|2[0-9]|3[0-1])(01|03|05|07|08|10|12))|((0[1-9]|1[0-9]|2[0-9]|30)(04|06|09|11))|((0[1-9]|1[0-9]|2[0-9])(02)))[0-9]{6})|0000000000/', $cPRnummerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /((((0[1-9]|1[0-9]|2[0-9]|3[0-1])(01|03|05|07|08|10|12))|((0[1-9]|1[0-9]|2[0-9]|30)(04|06|09|11))|((0[1-9]|1[0-9]|2[0-9])(02)))[0-9]{6})|0000000000/', var_export($cPRnummerIdentifikator, true)), __LINE__); - } - if (is_null($cPRnummerIdentifikator) || (is_array($cPRnummerIdentifikator) && empty($cPRnummerIdentifikator))) { - unset($this->CPRnummerIdentifikator); - } else { - $this->CPRnummerIdentifikator = $cPRnummerIdentifikator; - } - - return $this; - } - /** - * Get CVRnummerIdentifikator value - * @return string|null - */ - public function getCVRnummerIdentifikator(): ?string - { - return isset($this->CVRnummerIdentifikator) ? $this->CVRnummerIdentifikator : null; - } - /** - * This method is responsible for validating the value passed to the setCVRnummerIdentifikator method - * This method is willingly generated in order to preserve the one-line inline validation within the setCVRnummerIdentifikator method - * This has to validate that the property which is being set is the only one among the given choices - * @param mixed $value - * @return string A non-empty message if the values does not match the validation rules - */ - public function validateCVRnummerIdentifikatorForChoiceConstraintsFromSetCVRnummerIdentifikator($value): string - { - $message = ''; - if (is_null($value)) { - return $message; - } - $properties = [ - 'CPRnummerIdentifikator', - ]; - try { - foreach ($properties as $property) { - if (isset($this->{$property})) { - throw new InvalidArgumentException(sprintf('The property CVRnummerIdentifikator can\'t be set as the property %s is already set. Only one property must be set among these properties: CVRnummerIdentifikator, %s.', $property, implode(', ', $properties)), __LINE__); - } - } - } catch (InvalidArgumentException $e) { - $message = $e->getMessage(); - } - - return $message; - } - /** - * Set CVRnummerIdentifikator value - * This property belongs to a choice that allows only one property to exist. It is - * therefore removable from the request, consequently if the value assigned to this - * property is null, the property is removed from this object - * @throws InvalidArgumentException - * @param string $cVRnummerIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType - */ - public function setCVRnummerIdentifikator(?string $cVRnummerIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($cVRnummerIdentifikator) && !is_string($cVRnummerIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cVRnummerIdentifikator, true), gettype($cVRnummerIdentifikator)), __LINE__); - } - // validation for constraint: choice(CPRnummerIdentifikator, CVRnummerIdentifikator) - if ('' !== ($cVRnummerIdentifikatorChoiceErrorMessage = self::validateCVRnummerIdentifikatorForChoiceConstraintsFromSetCVRnummerIdentifikator($cVRnummerIdentifikator))) { - throw new InvalidArgumentException($cVRnummerIdentifikatorChoiceErrorMessage, __LINE__); - } - // validation for constraint: length(8) - if (!is_null($cVRnummerIdentifikator) && mb_strlen((string) $cVRnummerIdentifikator) !== 8) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be equal to 8', mb_strlen((string) $cVRnummerIdentifikator)), __LINE__); - } - if (is_null($cVRnummerIdentifikator) || (is_array($cVRnummerIdentifikator) && empty($cVRnummerIdentifikator))) { - unset($this->CVRnummerIdentifikator); - } else { - $this->CVRnummerIdentifikator = $cVRnummerIdentifikator; - } - - return $this; - } -} diff --git a/src/Client/StructType/TilmeldingRequestType.php b/src/Client/StructType/TilmeldingRequestType.php deleted file mode 100644 index 2235073..0000000 --- a/src/Client/StructType/TilmeldingRequestType.php +++ /dev/null @@ -1,88 +0,0 @@ -setSlutbrugerIdentitet($slutbrugerIdentitet) - ->setMeddelelseIndholdstypeIdentifikator($meddelelseIndholdstypeIdentifikator); - } - /** - * Get SlutbrugerIdentitet value - * @return \Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType - */ - public function getSlutbrugerIdentitet(): \Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType - { - return $this->SlutbrugerIdentitet; - } - /** - * Set SlutbrugerIdentitet value - * @param \Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType $slutbrugerIdentitet - * @return \Drupal\os2forms_digital_post\Client\StructType\TilmeldingRequestType - */ - public function setSlutbrugerIdentitet(\Drupal\os2forms_digital_post\Client\StructType\SlutbrugerIdentitetType $slutbrugerIdentitet): self - { - $this->SlutbrugerIdentitet = $slutbrugerIdentitet; - - return $this; - } - /** - * Get MeddelelseIndholdstypeIdentifikator value - * @return int|null - */ - public function getMeddelelseIndholdstypeIdentifikator(): ?int - { - return $this->MeddelelseIndholdstypeIdentifikator; - } - /** - * Set MeddelelseIndholdstypeIdentifikator value - * @param int $meddelelseIndholdstypeIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\TilmeldingRequestType - */ - public function setMeddelelseIndholdstypeIdentifikator(?int $meddelelseIndholdstypeIdentifikator = null): self - { - // validation for constraint: int - if (!is_null($meddelelseIndholdstypeIdentifikator) && !(is_int($meddelelseIndholdstypeIdentifikator) || ctype_digit($meddelelseIndholdstypeIdentifikator))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($meddelelseIndholdstypeIdentifikator, true), gettype($meddelelseIndholdstypeIdentifikator)), __LINE__); - } - $this->MeddelelseIndholdstypeIdentifikator = $meddelelseIndholdstypeIdentifikator; - - return $this; - } -} diff --git a/src/Client/StructType/TransaktionsParametreIType.php b/src/Client/StructType/TransaktionsParametreIType.php deleted file mode 100644 index 8f002b9..0000000 --- a/src/Client/StructType/TransaktionsParametreIType.php +++ /dev/null @@ -1,183 +0,0 @@ -\(\)\[\]\\,;:@\s]{0,191}@[^>\(\)\[\]\\,;:@\s]{1,64}) - * - ref: fjernprint:KvitteringsEmail - * @var string|null - */ - protected ?string $KvitteringsEmail = null; - /** - * Constructor method for TransaktionsParametreIType - * @uses TransaktionsParametreIType::setTransaktionsDatoTid() - * @uses TransaktionsParametreIType::setMasseForsendelseIdentifikator() - * @uses TransaktionsParametreIType::setKvitteringsTypeKode() - * @uses TransaktionsParametreIType::setKvitteringsEmail() - * @param string $transaktionsDatoTid - * @param string $masseForsendelseIdentifikator - * @param string $kvitteringsTypeKode - * @param string $kvitteringsEmail - */ - public function __construct(?string $transaktionsDatoTid = null, ?string $masseForsendelseIdentifikator = null, ?string $kvitteringsTypeKode = null, ?string $kvitteringsEmail = null) - { - $this - ->setTransaktionsDatoTid($transaktionsDatoTid) - ->setMasseForsendelseIdentifikator($masseForsendelseIdentifikator) - ->setKvitteringsTypeKode($kvitteringsTypeKode) - ->setKvitteringsEmail($kvitteringsEmail); - } - /** - * Get TransaktionsDatoTid value - * @return string|null - */ - public function getTransaktionsDatoTid(): ?string - { - return $this->TransaktionsDatoTid; - } - /** - * Set TransaktionsDatoTid value - * @param string $transaktionsDatoTid - * @return \Drupal\os2forms_digital_post\Client\StructType\TransaktionsParametreIType - */ - public function setTransaktionsDatoTid(?string $transaktionsDatoTid = null): self - { - // validation for constraint: string - if (!is_null($transaktionsDatoTid) && !is_string($transaktionsDatoTid)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transaktionsDatoTid, true), gettype($transaktionsDatoTid)), __LINE__); - } - $this->TransaktionsDatoTid = $transaktionsDatoTid; - - return $this; - } - /** - * Get MasseForsendelseIdentifikator value - * @return string|null - */ - public function getMasseForsendelseIdentifikator(): ?string - { - return $this->MasseForsendelseIdentifikator; - } - /** - * Set MasseForsendelseIdentifikator value - * @param string $masseForsendelseIdentifikator - * @return \Drupal\os2forms_digital_post\Client\StructType\TransaktionsParametreIType - */ - public function setMasseForsendelseIdentifikator(?string $masseForsendelseIdentifikator = null): self - { - // validation for constraint: string - if (!is_null($masseForsendelseIdentifikator) && !is_string($masseForsendelseIdentifikator)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($masseForsendelseIdentifikator, true), gettype($masseForsendelseIdentifikator)), __LINE__); - } - // validation for constraint: maxLength(38) - if (!is_null($masseForsendelseIdentifikator) && mb_strlen((string) $masseForsendelseIdentifikator) > 38) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 38', mb_strlen((string) $masseForsendelseIdentifikator)), __LINE__); - } - // validation for constraint: minLength(1) - if (!is_null($masseForsendelseIdentifikator) && mb_strlen((string) $masseForsendelseIdentifikator) < 1) { - throw new InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be greater than or equal to 1', mb_strlen((string) $masseForsendelseIdentifikator)), __LINE__); - } - $this->MasseForsendelseIdentifikator = $masseForsendelseIdentifikator; - - return $this; - } - /** - * Get KvitteringsTypeKode value - * @return string|null - */ - public function getKvitteringsTypeKode(): ?string - { - return $this->KvitteringsTypeKode; - } - /** - * Set KvitteringsTypeKode value - * @uses \Drupal\os2forms_digital_post\Client\EnumType\KvitteringsTypeKodeType::valueIsValid() - * @uses \Drupal\os2forms_digital_post\Client\EnumType\KvitteringsTypeKodeType::getValidValues() - * @throws InvalidArgumentException - * @param string $kvitteringsTypeKode - * @return \Drupal\os2forms_digital_post\Client\StructType\TransaktionsParametreIType - */ - public function setKvitteringsTypeKode(?string $kvitteringsTypeKode = null): self - { - // validation for constraint: enumeration - if (!\Drupal\os2forms_digital_post\Client\EnumType\KvitteringsTypeKodeType::valueIsValid($kvitteringsTypeKode)) { - throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Drupal\os2forms_digital_post\Client\EnumType\KvitteringsTypeKodeType', is_array($kvitteringsTypeKode) ? implode(', ', $kvitteringsTypeKode) : var_export($kvitteringsTypeKode, true), implode(', ', \Drupal\os2forms_digital_post\Client\EnumType\KvitteringsTypeKodeType::getValidValues())), __LINE__); - } - $this->KvitteringsTypeKode = $kvitteringsTypeKode; - - return $this; - } - /** - * Get KvitteringsEmail value - * @return string|null - */ - public function getKvitteringsEmail(): ?string - { - return $this->KvitteringsEmail; - } - /** - * Set KvitteringsEmail value - * @param string $kvitteringsEmail - * @return \Drupal\os2forms_digital_post\Client\StructType\TransaktionsParametreIType - */ - public function setKvitteringsEmail(?string $kvitteringsEmail = null): self - { - // validation for constraint: string - if (!is_null($kvitteringsEmail) && !is_string($kvitteringsEmail)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($kvitteringsEmail, true), gettype($kvitteringsEmail)), __LINE__); - } - // validation for constraint: pattern(([^>\(\)\[\]\\,;:@\s]{0,191}@[^>\(\)\[\]\\,;:@\s]{1,64})) - if (!is_null($kvitteringsEmail) && !preg_match('/([^>\\(\\)\\[\\]\\\\,;:@\\s]{0,191}@[^>\\(\\)\\[\\]\\\\,;:@\\s]{1,64})/', $kvitteringsEmail)) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /([^>\\(\\)\\[\\]\\\\,;:@\\s]{0,191}@[^>\\(\\)\\[\\]\\\\,;:@\\s]{1,64})/', var_export($kvitteringsEmail, true)), __LINE__); - } - $this->KvitteringsEmail = $kvitteringsEmail; - - return $this; - } -} diff --git a/src/Commands/CreatePdf.php b/src/Commands/CreatePdf.php deleted file mode 100644 index d801b11..0000000 --- a/src/Commands/CreatePdf.php +++ /dev/null @@ -1,97 +0,0 @@ -webformHelper = $webformHelper; - $this->templateManager = $templateManager; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * Create PDF in directory relative to Drupal root directory. - * - * @param string $template - * The template name to use. - * @param array $options - * An option that takes multiple values. - * - * @command os2forms_digital_post:create_pdf - * @aliases create-pdf - * @usage os2forms_digital_post:create_pdf default --submission_id=12345 - * Create PDF using default template with data from set submission. - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - * - * @phpstan-param array $options - */ - public function create($template, array $options = [ - 'submission_id' => 0, - 'file_location' => '', - 'file_name' => 'test.pdf', - ]): void { - $webform_submission = $this->entityTypeManager->getStorage('webform_submission')->load($options['submission_id']); - - if (!$webform_submission) { - $this->output()->writeln(sprintf('Submission id %s not found.', $options['submission_id'])); - return; - } - - $cprServiceResult = new CprLookupResult(); - $cprServiceResult->setSuccessful(); - $cprServiceResult->setName('Test Testersen'); - $cprServiceResult->setStreet('Testervej'); - $cprServiceResult->setHouseNr('1'); - $cprServiceResult->setFloor('2'); - $cprServiceResult->setApartmentNr('tv'); - $cprServiceResult->setPostalCode('8000'); - $cprServiceResult->setCity('Aarhus C'); - - $context = $this->webformHelper->getTemplateContext($webform_submission, $cprServiceResult); - - $pdf = $this->templateManager->renderPdf($template, $context); - $filePath = dirname(DRUPAL_ROOT) . $options['file_location'] . '/' . $options['file_name']; - file_put_contents($filePath, $pdf); - $this->output()->writeln(sprintf('Pdf written to %s', $filePath)); - } - -} diff --git a/src/Consumer/PrintServiceConsumer.php b/src/Consumer/PrintServiceConsumer.php deleted file mode 100644 index 0940af5..0000000 --- a/src/Consumer/PrintServiceConsumer.php +++ /dev/null @@ -1,356 +0,0 @@ -config = $configFactory->get('os2forms_digital_post'); - $this->guzzleClient = $guzzleClient; - $this->lock = $lock; - $this->state = $state; - // @phpstan-ignore-next-line - $this->uuid = \Drupal::service('uuid'); - } - - /** - * Afsend brev person. - */ - public function afsendBrevPerson( - string $kanalValg = NULL, - string $prioritet = NULL, - string $cprNummerIdentifikator = NULL, - string $personName = NULL, - string $coNavn = NULL, - string $streetName = NULL, - string $streetBuildingIdentifier = NULL, - string $floorIdentifier = NULL, - string $suiteIdentifier = NULL, - string $mailDeliverySublocationIdentifier = NULL, - string $postCodeIdentifier = NULL, - string $districtSubdivisionIdentifier = NULL, - int $postOfficeBoxIdentifier = NULL, - string $countryIdentificationCode = NULL, - string $filFormatNavn = NULL, - string $meddelelseIndholdData = NULL, - string $titelTekst = NULL, - string $brevDato = NULL - ): bool { - - if (!$this->acquireLock()) { - $this->waitLock(); - } - - $invocationContext = new InvocationContextType( - $this->config->get('service_agreement_uuid'), - $this->config->get('user_system_uuid'), - $this->config->get('user_uuid'), - $this->config->get('service_uuid') - ); - - $slutBrugerIdentitetType = new SlutbrugerIdentitetType($cprNummerIdentifikator); - - $countryIdentificationCodeType = new CountryIdentificationCodeType($countryIdentificationCode); - - $kontaktOplysninger = new KontaktOplysningType( - $personName, - $coNavn, - $streetName, - $streetBuildingIdentifier, - $floorIdentifier, - $suiteIdentifier, - $mailDeliverySublocationIdentifier, - $postCodeIdentifier, - $districtSubdivisionIdentifier, - $postOfficeBoxIdentifier, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - $countryIdentificationCodeType - ); - - $forsendelsesModtager = new ForsendelseModtagerType($slutBrugerIdentitetType, $kontaktOplysninger); - - $dokumentParametre = new DokumentParametreType($titelTekst, $this->uuid->generate(), $brevDato); - $digitalPostParametre = new DigitalPostParametreType($brevDato, $this->config->get('digital_post_materiale_id')); - - $forsendelse = new ForsendelseIType( - $this->generateAfsendelseIdentifikator(), - $this->config->get('digital_post_materiale_id'), - $forsendelsesModtager, - $filFormatNavn, - $meddelelseIndholdData, - NULL, - $dokumentParametre, - NULL, - NULL, - $digitalPostParametre - ); - - $brevSPBody = new BrevSPBodyType($kanalValg, $prioritet, $forsendelse); - $request = new PrintAfsendBrevRequestType($brevSPBody, $invocationContext); - - $certificateLocator = $this->getAzureKeyVaultCertificateLocator( - $this->config->get('azure_tenant_id'), - $this->config->get('azure_application_id'), - $this->config->get('azure_client_secret'), - $this->config->get('azure_key_vault_name'), - $this->config->get('azure_key_vault_secret'), - $this->config->get('azure_key_vault_secret_version') - ); - - $client = new Afsend([ - AbstractSoapClientBase::WSDL_URL => $this->config->get('service_contract'), - AbstractSoapClientBase::WSDL_CLASSMAP => ClassMap::get(), - // @phpstan-ignore-next-line - AbstractSoapClientBase::WSDL_LOCAL_CERT => $certificateLocator->getAbsolutePathToCertificate(), - AbstractSoapClientBase::WSDL_LOCATION => $this->config->get('service_endpoint'), - ]); - - $response = $client->afsendBrev($request); - - $this->releaseLock(); - - if (FALSE === $response) { - $lastError = $client->getLastError(); - /** @var \SoapFault $soapError */ - $soapError = $lastError['Drupal\os2forms_digital_post\Client\ServiceType\Afsend::afsendBrev']; - // Should maybe log this instead! - throw new \Exception($soapError->getMessage(), $soapError->getCode()); - } - - return $response->getResultat(); - } - - /** - * Get absolute path to certificate. - */ - private function getAzureKeyVaultCertificateLocator( - string $tenantId, - string $applicationId, - string $clientSecret, - string $keyVaultName, - string $keyVaultSecret, - string $keyVaultSecretVersion - ): CertificateLocatorInterface { - $httpClient = new GuzzleAdapter($this->guzzleClient); - $requestFactory = new RequestFactory(); - - $vaultToken = new VaultToken($httpClient, $requestFactory); - - $token = $vaultToken->getToken( - $tenantId, - $applicationId, - $clientSecret - ); - - $vault = new VaultSecret( - $httpClient, - $requestFactory, - $keyVaultName, - $token->getAccessToken() - ); - - return new AzureKeyVaultCertificateLocator( - $vault, - $keyVaultSecret, - $keyVaultSecretVersion - ); - } - - /** - * Afsend digital post person. - */ - public function afsendDigitalPostPerson( - string $kanalValg = NULL, - string $prioritet = NULL, - string $cprNummerIdentifikator = NULL, - string $filFormatNavn = NULL, - string $meddelelseIndholdData = NULL, - string $titelTekst = NULL - ): bool { - - if (!$this->acquireLock()) { - $this->waitLock(); - } - - $invocationContext = new InvocationContextType( - $this->config->get('service_agreement_uuid'), - $this->config->get('user_system_uuid'), - $this->config->get('user_uuid'), - $this->config->get('service_uuid') - ); - - $slutBrugerIdentitetType = new SlutbrugerIdentitetType($cprNummerIdentifikator); - - $forsendelsesModtager = new ForsendelseModtagerType($slutBrugerIdentitetType); - - $dokumentParametre = new DokumentParametreType($titelTekst); - $digitalPostParametre = new DigitalPostParametreType(NULL, $this->config->get('digital_post_materiale_id')); - - $forsendelse = new ForsendelseIType( - $this->generateAfsendelseIdentifikator(), - NULL, - $forsendelsesModtager, - $filFormatNavn, - $meddelelseIndholdData, - NULL, - $dokumentParametre, - NULL, - NULL, - $digitalPostParametre - ); - - $brevSPBody = new BrevSPBodyType($kanalValg, $prioritet, $forsendelse); - $request = new PrintAfsendBrevRequestType($brevSPBody, $invocationContext); - - $certificateLocator = $this->getAzureKeyVaultCertificateLocator( - $this->config->get('azure_tenant_id'), - $this->config->get('azure_application_id'), - $this->config->get('azure_client_secret'), - $this->config->get('azure_key_vault_name'), - $this->config->get('azure_key_vault_secret'), - $this->config->get('azure_key_vault_secret_version') - ); - - $client = new Afsend([ - AbstractSoapClientBase::WSDL_URL => $this->config->get('service_contract'), - AbstractSoapClientBase::WSDL_CLASSMAP => ClassMap::get(), - // @phpstan-ignore-next-line - AbstractSoapClientBase::WSDL_LOCAL_CERT => $certificateLocator->getAbsolutePathToCertificate(), - AbstractSoapClientBase::WSDL_LOCATION => $this->config->get('service_endpoint'), - ]); - - $response = $client->afsendBrev($request); - - $this->releaseLock(); - - if (FALSE === $response) { - $lastError = $client->getLastError(); - /** @var \SoapFault $soapError */ - $soapError = $lastError['Drupal\os2forms_digital_post\Client\ServiceType\Afsend::afsendBrev']; - // Should maybe log this instead! - throw new \Exception($soapError->getMessage(), $soapError->getCode()); - } - - return $response->getResultat(); - } - - /** - * Generate afsendelse identifikator. - */ - protected function generateAfsendelseIdentifikator(): string { - - $stateKey = 'os2forms_digital_post_last_letter_counter'; - - $lastLetterCounter = $this->state->get($stateKey, 1); - - $nextLetterCounter = $lastLetterCounter + 1; - - $this->state->set($stateKey, $nextLetterCounter); - - $nextLetterNumber = str_pad(strval($nextLetterCounter), 21, '0', STR_PAD_LEFT); - - return $this->config->get('digital_post_system_id') - . $this->config->get('digital_post_afsender_system') - . $nextLetterNumber; - } - - /** - * Acquire lock. - */ - protected function acquireLock(): bool { - return $this->lock->acquire($this->lockName); - } - - /** - * Release lock. - */ - protected function releaseLock(): void { - $this->lock->release($this->lockName); - } - - /** - * Wait lock. - */ - protected function waitLock(): bool { - return $this->lock->wait($this->lockName); - } - -} diff --git a/src/Exception/CprElementNotFoundInSubmissionException.php b/src/Exception/CprElementNotFoundInSubmissionException.php deleted file mode 100644 index 42f7f83..0000000 --- a/src/Exception/CprElementNotFoundInSubmissionException.php +++ /dev/null @@ -1,10 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->renderer = $renderer; - $this->dataLookupManager = $dataLookupManager; - $this->printServiceConsumer = $printServiceConsumer; - $this->templateManager = $templateManager; - $this->logger = $loggerChannelFactory->get('os2forms_digital_post'); - } - - /** - * Get template context. - * - * @phpstan-return array - */ - public function getTemplateContext(WebformSubmissionInterface $webformSubmission, CprLookupResult $cprLookupResult): array { - $webform = $webformSubmission->getWebform(); - - $view_builder = $this->entityTypeManager->getViewBuilder('webform_submission'); - $pre_render = $view_builder->view($webformSubmission, 'HTML'); - $webformSubmissionRendered = $this->renderer->renderPlain($pre_render); - - // We cannot use “side” (from address lookup via cpr) as “suiteIdentifier” - // when sending digital port. Therefore we append it to “floor” instead. - $floor = $cprLookupResult->getFloor(); - if (!empty($cprLookupResult->getApartmentNr())) { - $floor .= ' ' . $cprLookupResult->getApartmentNr(); - } - - $recipient = [ - 'name' => $cprLookupResult->getName(), - 'streetName' => $cprLookupResult->getStreet(), - 'streetNumber' => $cprLookupResult->getHouseNr(), - 'floor' => $floor, - 'side' => NULL, - 'postalCode' => $cprLookupResult->getPostalCode(), - 'city' => $cprLookupResult->getCity(), - ]; - - return [ - 'label' => $webform->label(), - 'recipient' => $recipient, - 'submission' => $webformSubmissionRendered, - ]; - } - - /** - * Send digital post. - * - * @param string $submissionId - * The submission ID. - * @param array $handlerConfiguration - * Handler config. - * - * @throws \Drupal\os2forms_digital_post\Exception\CprElementNotFoundInSubmissionException - * An CprElementNotFoundInSubmissionException. - * @throws \Drupal\os2forms_digital_post\Exception\SubmissionNotFoundException - * A SubmissionNotFoundException. - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * An InvalidPluginDefinitionException. - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - * A PluginNotFoundException. - * @throws \ItkDev\Serviceplatformen\Service\Exception\ServiceException - * A ServiceException. - * - * @phpstan-param array $handlerConfiguration - */ - public function sendDigitalPost(string $submissionId, array $handlerConfiguration): void { - $webform_submission = $this->getSubmission($submissionId); - if (empty($webform_submission)) { - $this->logger->error( - 'Cannot load submission @submissionId', - ['@submissionId' => $submissionId] - ); - - throw new SubmissionNotFoundException(sprintf('Submission %s not found', $submissionId)); - } - - $submissionData = $webform_submission->getData(); - - if (!array_key_exists($handlerConfiguration['cpr_element'], $submissionData)) { - $this->logger->error( - 'The chosen CPR element not found in submission!' - ); - - throw new CprElementNotFoundInSubmissionException(); - } - - $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cpr_lookup'); - if (!($instance instanceof DataLookupInterfaceCpr)) { - throw new RuntimeException('Cannot get CPR data lookup instance'); - } - $cprLookupResult = $instance->lookup($submissionData[$handlerConfiguration['cpr_element']]); - $context = $this->getTemplateContext($webform_submission, $cprLookupResult); - $result = FALSE; - - switch ($handlerConfiguration['channel']) { - case 'A': - $result = $this->printServiceConsumer->afsendBrevPerson( - $handlerConfiguration['channel'], - $handlerConfiguration['priority'], - $submissionData[$handlerConfiguration['cpr_element']], - $cprLookupResult->getName(), - NULL, - $cprLookupResult->getStreet(), - $cprLookupResult->getHouseNr(), - $cprLookupResult->getFloor(), - NULL, - NULL, - $cprLookupResult->getPostalCode(), - NULL, - NULL, - 'DK', - 'PDF', - $this->templateManager->renderPdf($handlerConfiguration['template'], $context), - $handlerConfiguration['document_title'] - ); - break; - - case 'D': - $result = $this->printServiceConsumer->afsendDigitalPostPerson( - $handlerConfiguration['channel'], - $handlerConfiguration['priority'], - $submissionData[$handlerConfiguration['cpr_element']], - 'PDF', - $this->templateManager->renderPdf($handlerConfiguration['template'], $context), - $handlerConfiguration['document_title'] - ); - break; - } - - if (FALSE === $result) { - // Throw an error? - } - } - - /** - * Gets WebformSubmission from id. - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - private function getSubmission(string $submissionId): ?WebformSubmissionInterface { - $storage = $this->entityTypeManager->getStorage('webform_submission'); - return $storage->load($submissionId); - } - -} diff --git a/src/Manager/TemplateManager.php b/src/Manager/TemplateManager.php deleted file mode 100644 index 06ee062..0000000 --- a/src/Manager/TemplateManager.php +++ /dev/null @@ -1,132 +0,0 @@ -config = $configFactory->get('os2forms_digital_post'); - $filesystemLoader->addPath($this->config->get('path_to_templates')); - $this->twigEnvironment = $twigEnvironment; - } - - /** - * {@inheritDoc} - */ - public function getAvailableTemplates(): array { - $pathToTemplates = $this->config->get('path_to_templates'); - - $listOfTemplates = []; - - // This list of directory names will not be showed as available templates - // in the handlers settings page. - $ignoredDirectories = ['.git']; - - $directoryIterator = new \DirectoryIterator($pathToTemplates); - foreach ($directoryIterator as $fileInfo) { - if (!$fileInfo->isDir() || $fileInfo->isDot() || in_array($fileInfo->getBasename(), $ignoredDirectories)) { - continue; - } - - $listOfTemplates[$fileInfo->getBasename()] = $fileInfo->getBasename(); - } - - return $listOfTemplates; - } - - /** - * {@inheritDoc} - * - * @phpstan-param array $context - */ - public function renderHtml(string $template, array $context = []): string { - - $context['logo'] = $this->getPathToBase64EncodedLogo($template); - $pathToTemplate = $template . '/index.html.twig'; - - return $this->twigEnvironment->render($pathToTemplate, $context); - } - - /** - * {@inheritDoc} - * - * @phpstan-param array $context - */ - public function renderPdf(string $template, array $context = [], bool $stream = FALSE): string { - - $html = $this->renderHtml($template, $context); - - $domPdf = new Dompdf(); - $domPdf->setPaper('A4', 'portrait'); - - $pathToCss = $this->getPathToTemplate($template) . '/styles.css'; - $cssAsString = file_get_contents($pathToCss); - - $stylesheet = new Stylesheet($domPdf); - $stylesheet->load_css($cssAsString); - $domPdf->setCss($stylesheet); - - $domPdf->loadHtml($html); - $domPdf->render(); - - if (TRUE === $stream) { - // Streams PDF to browser. - $domPdf->stream(); - return ''; - } - - // Returns PDF as string. - return $domPdf->output(); - } - - /** - * Get path to base64encoded logo. - */ - private function getPathToBase64EncodedLogo(string $template): string { - $pathToLogo = $this->getPathToTemplate($template) . '/logo.png'; - - if (!file_exists($pathToLogo)) { - return 'Logo not found!'; - } - - $extension = pathinfo($pathToLogo, PATHINFO_EXTENSION); - $data = file_get_contents($pathToLogo); - $logoBase64 = base64_encode($data); - - return 'data:image/' . $extension . ';base64,' . $logoBase64; - } - - /** - * Get path to template. - */ - private function getPathToTemplate(string $template): string { - return $this->config->get('path_to_templates') . '/' . $template; - } - -} diff --git a/src/Manager/TemplateManagerInterface.php b/src/Manager/TemplateManagerInterface.php deleted file mode 100644 index 2471fcc..0000000 --- a/src/Manager/TemplateManagerInterface.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - public function getAvailableTemplates(): array; - -} diff --git a/src/Plugin/AdvancedQueue/JobType/SendDigitalPost.php b/src/Plugin/AdvancedQueue/JobType/SendDigitalPost.php deleted file mode 100644 index a8cf919..0000000 --- a/src/Plugin/AdvancedQueue/JobType/SendDigitalPost.php +++ /dev/null @@ -1,73 +0,0 @@ - $configuration - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('os2forms_digital_post.webform_helper') - ); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $configuration - */ - public function __construct( - array $configuration, - $plugin_id, - $plugin_definition, - WebformHelper $helper - ) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->helper = $helper; - } - - /** - * Processes the send digital post job. - */ - public function process(Job $job): JobResult { - $payload = $job->getPayload(); - - try { - $this->helper->sendDigitalPost($payload['submissionId'], $payload['handlerConfiguration']); - - return JobResult::success(); - } - catch (\Exception $e) { - return JobResult::failure($e->getMessage()); - } - } - -} diff --git a/src/Plugin/WebformHandler/DigitalPostWebformHandler.php b/src/Plugin/WebformHandler/DigitalPostWebformHandler.php deleted file mode 100644 index cc04d5f..0000000 --- a/src/Plugin/WebformHandler/DigitalPostWebformHandler.php +++ /dev/null @@ -1,397 +0,0 @@ - $configuration - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $instance = new static($configuration, $plugin_id, $plugin_definition); - - $instance->loggerFactory = $container->get('logger.factory'); - $instance->configFactory = $container->get('config.factory'); - $instance->renderer = $container->get('renderer'); - $instance->entityTypeManager = $container->get('entity_type.manager'); - $instance->conditionsValidator = $container->get('webform_submission.conditions_validator'); - $instance->templateManager = $container->get('os2forms_digital_post.template_manager'); - - $instance->setConfiguration($configuration); - - return $instance; - } - - /** - * {@inheritdoc} - * - * @phpstan-return array - */ - public function defaultConfiguration(): array { - return [ - 'message' => 'This is a custom message.', - 'debug' => FALSE, - ]; - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $form - * @phpstan-return array - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state): array { - $this->getLogger()->debug('This was the form: ' . print_r($this->getWebform()->getElementsDecoded(), TRUE)); - - $availableElements = $this->getAvailableElements($this->getWebform()->getElementsDecoded()); - - $form['blacklist_elements_for_template'] = [ - '#type' => 'select', - '#title' => $this->t('Prevent elements displayed in template'), - '#options' => $availableElements, - '#default_value' => $this->configuration['blacklist_elements_for_template'], - '#multiple' => TRUE, - '#size' => 10, - ]; - - $listOfTemplates = $this->templateManager->getAvailableTemplates(); - - $form['template'] = [ - '#type' => 'select', - '#title' => $this->t('Select template'), - '#options' => $listOfTemplates, - '#default_value' => $this->configuration['template'], - '#required' => TRUE, - ]; - - // The channels available here are required by the - // Digital Post service. For more information see the - // specification for the PrintService (SF1600) on - // Serviceplatformen. - $form['channel'] = [ - '#type' => 'select', - '#title' => $this->t('Select channel'), - '#options' => [ - // Only send the letter as Digital Post. - 'D' => $this->t('Digital Post'), - // Serviceplatformen decides if a citizen should have digital or - // physical mail based on the citizens registration. - 'A' => $this->t('Automatisk'), - ], - '#default_value' => $this->configuration['channel'], - ]; - - $form['priority'] = [ - '#type' => 'select', - '#title' => $this->t('Priority'), - '#options' => [ - 'D' => $this->t('Direkte'), - ], - '#default_value' => $this->configuration['priority'], - ]; - - $form['cpr_element'] = [ - '#type' => 'select', - '#title' => $this->t('Element in form that contains the CPR number of the recipient'), - '#required' => TRUE, - '#default_value' => $this->configuration['cpr_element'], - '#options' => $availableElements, - ]; - - $form['document_title'] = [ - '#type' => 'textfield', - '#title' => $this->t('Title of document'), - '#required' => TRUE, - '#default_value' => $this->configuration['document_title'], - '#maxlength' => self::DOCUMENT_TITLE_MAX_LENGTH, - '#description' => $this->t('Note that the document title can contain at most @max_length characters.', ['@max_length' => self::DOCUMENT_TITLE_MAX_LENGTH]), - ]; - - // Development. - $form['development'] = [ - '#type' => 'details', - '#title' => $this->t('Development settings'), - ]; - $form['development']['debug'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enable debugging'), - '#description' => $this->t('If checked, every handler method invoked will be displayed onscreen to all users.'), - '#return_value' => TRUE, - '#default_value' => $this->configuration['debug'], - ]; - - return $this->setSettingsParents($form); - } - - /** - * Get available elements. - * - * @phpstan-param array $elements - * @phpstan-return array - */ - private function getAvailableElements(array $elements): array { - $availableElements = []; - - foreach ($elements as $key => $element) { - - $children = Element::children($element); - - if (!empty($children)) { - - $availableElements = array_merge($availableElements, $this->getAvailableElements(array_intersect_key($element, array_flip($children)))); - continue; - } - - $availableElements[$key] = $element['#title']; - } - - return $availableElements; - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $form - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state): void { - parent::submitConfigurationForm($form, $form_state); - $this->configuration['channel'] = $form_state->getValue('channel'); - $this->configuration['priority'] = $form_state->getValue('priority'); - $this->configuration['cpr_element'] = $form_state->getValue('cpr_element'); - $this->configuration['document_title'] = $form_state->getValue('document_title'); - $this->configuration['template'] = $form_state->getValue('template'); - $this->configuration['blacklist_elements_for_template'] = $form_state->getValue('blacklist_elements_for_template'); - $this->configuration['debug'] = (bool) $form_state->getValue('debug'); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $elements - */ - public function alterElements(array &$elements, WebformInterface $webform): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $settings - */ - public function overrideSettings(array &$settings, WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $form - */ - public function alterForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $form - */ - public function validateForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - if ($value = $form_state->getValue('element')) { - $form_state->setErrorByName('element', $this->t('The element must be empty. You entered %value.', ['%value' => $value])); - } - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $form - */ - public function submitForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $form - */ - public function confirmForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function preCreate(array &$values): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function postCreate(WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function postLoad(WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function preDelete(WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function postDelete(WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function preSave(WebformSubmissionInterface $webform_submission): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE): void { - $queueStorage = $this->entityTypeManager->getStorage('advancedqueue_queue'); - /** @var \Drupal\advancedqueue\Entity\Queue $queue */ - $queue = $queueStorage->load('os2forms_digital_post'); - $job = Job::create(SendDigitalPost::class, [ - 'formId' => $webform_submission->getWebform()->id(), - 'submissionId' => $webform_submission->id(), - 'handlerConfiguration' => $this->configuration, - ]); - $queue->enqueueJob($job); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $variables - */ - public function preprocessConfirmation(array &$variables): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function createHandler(): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function updateHandler(): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function deleteHandler(): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $element - */ - public function createElement($key, array $element): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $element - * @phpstan-param array $original_element - */ - public function updateElement($key, array $element, array $original_element): void { - $this->debug(__FUNCTION__); - } - - /** - * {@inheritdoc} - * - * @phpstan-param array $element - */ - public function deleteElement($key, array $element): void { - $this->debug(__FUNCTION__); - } - - /** - * Display the invoked plugin method to end user. - * - * @param string $method_name - * The invoked method name. - * @param string $context1 - * Additional parameter passed to the invoked method name. - */ - protected function debug($method_name, $context1 = NULL): void { - if (!empty($this->configuration['debug'])) { - $t_args = [ - '@id' => $this->getHandlerId(), - '@class_name' => get_class($this), - '@method_name' => $method_name, - '@context1' => $context1, - ]; - $this->messenger()->addWarning($this->t('Invoked @id: @class_name:@method_name @context1', $t_args), TRUE); - } - } - -} From 39c97dd1d11128648bd5ec51c23a35bb03e4f969 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Thu, 20 Jul 2023 10:31:11 +0200 Subject: [PATCH 18/26] FORDRIF-167: Applied coding standards --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1468fdf..7f2d23a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### Removed + - Removed support for [SF-1600](https://digitaliseringskataloget.dk/integration/sf1600). ### Added From f5b6d90765857902aba5dc1d3b560099d88ef636 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 3 May 2023 13:17:15 +0200 Subject: [PATCH 19/26] FORMS-821: Used OS2Web datalookup for CPR and CVR data --- src/Helper/WebformHelperSF1601.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helper/WebformHelperSF1601.php b/src/Helper/WebformHelperSF1601.php index 4dcbc5e..b5eba1c 100644 --- a/src/Helper/WebformHelperSF1601.php +++ b/src/Helper/WebformHelperSF1601.php @@ -46,7 +46,7 @@ final class WebformHelperSF1601 implements LoggerInterface { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected EntityStorageInterface $queueStorage; + protected ConfigEntityStorage $queueStorage; /** * The logger. From 85cbf6249ebb4e09820bb2bf9d3088abe0549381 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 8 May 2023 11:33:35 +0200 Subject: [PATCH 20/26] FORMS-821: Guzzle 7 --- src/Helper/CertificateLocatorHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helper/CertificateLocatorHelper.php b/src/Helper/CertificateLocatorHelper.php index c14be13..09098a5 100644 --- a/src/Helper/CertificateLocatorHelper.php +++ b/src/Helper/CertificateLocatorHelper.php @@ -4,7 +4,7 @@ use Drupal\os2forms_digital_post\Exception\CertificateLocatorException; use GuzzleHttp\Client; -use Http\Adapter\Guzzle6\Client as GuzzleAdapter; +use Http\Adapter\Guzzle7\Client as GuzzleAdapter; use Http\Factory\Guzzle\RequestFactory; use ItkDev\AzureKeyVault\Authorisation\VaultToken; use ItkDev\AzureKeyVault\KeyVault\VaultSecret; From 0ca753d65a7110628ea4c24cda98920a78f0618e Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 9 May 2023 12:52:57 +0200 Subject: [PATCH 21/26] FORMS-821: Cleaned up (after code analysis) --- src/Helper/WebformHelperSF1601.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helper/WebformHelperSF1601.php b/src/Helper/WebformHelperSF1601.php index b5eba1c..4dcbc5e 100644 --- a/src/Helper/WebformHelperSF1601.php +++ b/src/Helper/WebformHelperSF1601.php @@ -46,7 +46,7 @@ final class WebformHelperSF1601 implements LoggerInterface { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected ConfigEntityStorage $queueStorage; + protected EntityStorageInterface $queueStorage; /** * The logger. From 7dc72467139651c359e491f5855c20cec12640bd Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Fri, 2 Jun 2023 15:39:29 +0200 Subject: [PATCH 22/26] FORMS-774: Added API for sending digital post --- CHANGELOG.md | 2 + os2forms_digital_post.services.yml | 17 +- src/Commands/CommandsSF1601.php | 12 +- src/Exception/InvalidForsendelseException.php | 10 ++ ...essage.php => InvalidMessageException.php} | 2 +- src/Form/SettingsForm.php | 16 +- src/Helper/AbstractMessageHelper.php | 33 +--- src/Helper/BeskedfordelerHelper.php | 4 +- src/Helper/DigitalPostHelper.php | 147 ++++++++++++++++++ src/Helper/ForsendelseHelper.php | 37 +++-- src/Helper/MeMoHelper.php | 64 +++++--- src/Helper/Settings.php | 4 + src/Helper/WebformHelperSF1601.php | 49 ++---- src/Model/Document.php | 31 ++++ 14 files changed, 307 insertions(+), 121 deletions(-) create mode 100644 src/Exception/InvalidForsendelseException.php rename src/Exception/{InvalidMessage.php => InvalidMessageException.php} (63%) create mode 100644 src/Helper/DigitalPostHelper.php create mode 100644 src/Model/Document.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f2d23a..b791a56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Added the `CPR / Navn validering` element to allowed recipient element names [PR-43](https://github.com/itk-dev/os2forms_digital_post/pull/43) +- Added API for sending digital post + [PR-40](https://github.com/itk-dev/os2forms_digital_post/pull/40) ## Changed diff --git a/os2forms_digital_post.services.yml b/os2forms_digital_post.services.yml index 2b7a0ad..910570b 100644 --- a/os2forms_digital_post.services.yml +++ b/os2forms_digital_post.services.yml @@ -13,14 +13,27 @@ services: Drupal\os2forms_digital_post\Helper\MeMoHelper: arguments: + - "@Drupal\\os2forms_digital_post\\Helper\\Settings" - "@plugin.manager.webform.element" - "@webform.token_manager" Drupal\os2forms_digital_post\Helper\ForsendelseHelper: arguments: + - "@Drupal\\os2forms_digital_post\\Helper\\Settings" - "@plugin.manager.webform.element" - "@webform.token_manager" + Drupal\os2forms_digital_post\Helper\DigitalPostHelper: + arguments: + - "@Drupal\\os2forms_digital_post\\Helper\\Settings" + - "@Drupal\\os2forms_digital_post\\Helper\\CertificateLocatorHelper" + - "@plugin.manager.os2web_datalookup" + - "@Drupal\\os2forms_digital_post\\Helper\\MeMoHelper" + - "@Drupal\\os2forms_digital_post\\Helper\\ForsendelseHelper" + - "@Drupal\\os2forms_digital_post\\Helper\\BeskedfordelerHelper" + - "@logger.channel.os2forms_digital_post" + - "@logger.channel.os2forms_digital_post_submission" + Drupal\os2forms_digital_post\Helper\WebformHelperSF1601: arguments: - "@Drupal\\os2forms_digital_post\\Helper\\Settings" @@ -30,7 +43,9 @@ services: - "@Drupal\\os2forms_digital_post\\Helper\\MeMoHelper" - "@Drupal\\os2forms_digital_post\\Helper\\ForsendelseHelper" - "@Drupal\\os2forms_digital_post\\Helper\\BeskedfordelerHelper" - - "@logger.factory" + - "@logger.channel.os2forms_digital_post" + - "@logger.channel.os2forms_digital_post_submission" + - "@Drupal\\os2forms_digital_post\\Helper\\DigitalPostHelper" Drupal\os2forms_digital_post\Helper\SF1461Helper: diff --git a/src/Commands/CommandsSF1601.php b/src/Commands/CommandsSF1601.php index 976a74b..53dc270 100644 --- a/src/Commands/CommandsSF1601.php +++ b/src/Commands/CommandsSF1601.php @@ -3,9 +3,9 @@ namespace Drupal\os2forms_digital_post\Commands; use DigitalPost\MeMo\Message; -use Drupal\os2forms_digital_post\Form\SettingsForm; use Drupal\os2forms_digital_post\Helper\ForsendelseHelper; use Drupal\os2forms_digital_post\Helper\MeMoHelper; +use Drupal\os2forms_digital_post\Helper\Settings; use Drupal\os2forms_digital_post\Helper\WebformHelperSF1601; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drush\Commands\DrushCommands; @@ -109,13 +109,13 @@ public function meMoShow(int $submissionId, string $handlerId, array $options = WebformHelperSF1601::RECIPIENT_IDENTIFIER_TYPE => 'test', WebformHelperSF1601::RECIPIENT_IDENTIFIER => 'test', - SettingsForm::SENDER_IDENTIFIER_TYPE => 'test', - SettingsForm::SENDER_IDENTIFIER => 'test', + Settings::SENDER_IDENTIFIER_TYPE => 'test', + Settings::SENDER_IDENTIFIER => 'test', WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], ]; - $message = $this->meMoHelper->buildMessage($submission, $messageOptions, $handlerSettings); + $message = $this->meMoHelper->buildWebformSubmissionMessage($submission, $messageOptions, $handlerSettings); if (isset($options['dump'])) { if (TRUE === $options['dump']) { @@ -167,9 +167,9 @@ public function forsendelseShow(int $submissionId, string $handlerId, array $opt $messageOptions = [ WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], - ForsendelseHelper::FORSENDELSES_TYPE_IDENTIFIKATOR => 'test', + Settings::FORSENDELSES_TYPE_IDENTIFIKATOR => 'test', ]; - $message = $this->forsendelseHelper->buildForsendelse($submission, $messageOptions, $handlerSettings); + $message = $this->forsendelseHelper->buildSubmissionForsendelse($submission, $messageOptions, $handlerSettings); if (isset($options['dump'])) { if (TRUE === $options['dump']) { diff --git a/src/Exception/InvalidForsendelseException.php b/src/Exception/InvalidForsendelseException.php new file mode 100644 index 0000000..bae012a --- /dev/null +++ b/src/Exception/InvalidForsendelseException.php @@ -0,0 +1,10 @@ + $this->t('Sender'), '#tree' => TRUE, - self::SENDER_IDENTIFIER_TYPE => [ + Settings::SENDER_IDENTIFIER_TYPE => [ '#type' => 'select', '#title' => $this->t('Identifier type'), '#options' => [ 'CVR' => $this->t('CVR'), ], - '#default_value' => $sender[self::SENDER_IDENTIFIER_TYPE] ?? 'CVR', + '#default_value' => $sender[Settings::SENDER_IDENTIFIER_TYPE] ?? 'CVR', '#required' => TRUE, ], - self::SENDER_IDENTIFIER => [ + Settings::SENDER_IDENTIFIER => [ '#type' => 'textfield', '#title' => $this->t('Identifier'), - '#default_value' => $sender[self::SENDER_IDENTIFIER] ?? NULL, + '#default_value' => $sender[Settings::SENDER_IDENTIFIER] ?? NULL, '#required' => TRUE, ], - self::FORSENDELSES_TYPE_IDENTIFIKATOR => [ + Settings::FORSENDELSES_TYPE_IDENTIFIKATOR => [ '#type' => 'textfield', '#title' => $this->t('Forsendelsestypeidentifikator'), - '#default_value' => $sender[self::FORSENDELSES_TYPE_IDENTIFIKATOR] ?? NULL, + '#default_value' => $sender[Settings::FORSENDELSES_TYPE_IDENTIFIKATOR] ?? NULL, '#required' => TRUE, ], ]; diff --git a/src/Helper/AbstractMessageHelper.php b/src/Helper/AbstractMessageHelper.php index 0de0ada..1b0f0fd 100644 --- a/src/Helper/AbstractMessageHelper.php +++ b/src/Helper/AbstractMessageHelper.php @@ -4,6 +4,7 @@ use DigitalPost\MeMo\Message; use Drupal\os2forms_digital_post\Exception\InvalidAttachmentElementException; +use Drupal\os2forms_digital_post\Model\Document; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drupal\webform\Plugin\WebformElementManagerInterface; use Drupal\webform\WebformSubmissionInterface; @@ -16,19 +17,12 @@ * Abstract message helper. */ abstract class AbstractMessageHelper { - public const DOCUMENT_CONTENT = 'content'; - public const DOCUMENT_SIZE = 'size'; - public const DOCUMENT_MIME_TYPE = 'mime-type'; - public const DOCUMENT_FILENAME = 'filename'; - public const DOCUMENT_LANGUAGE = 'language'; - public const DOCUMENT_LANGUAGE_DEFAULT = 'da'; - - protected const MIME_TYPE_PDF = 'application/pdf'; /** * Constructor. */ public function __construct( + readonly protected Settings $settings, readonly protected WebformElementManagerInterface $elementInfoManager, readonly protected WebformTokenManagerInterface $webformTokenManager ) { @@ -42,7 +36,7 @@ public function __construct( * @phpstan-param array $handlerSettings * @phpstan-return array */ - protected function getMainDocument(WebformSubmissionInterface $submission, array $handlerSettings): array { + protected function getMainDocument(WebformSubmissionInterface $submission, array $handlerSettings): Document { // Lifted from Drupal\webform_attachment\Controller\WebformAttachmentController::download. $element = $handlerSettings[WebformHandlerSF1601::MEMO_MESSAGE][WebformHandlerSF1601::ATTACHMENT_ELEMENT]; $element = $submission->getWebform()->getElement($element) ?: []; @@ -56,13 +50,11 @@ protected function getMainDocument(WebformSubmissionInterface $submission, array $mimeType = $instance::getFileMimeType($element, $submission); $content = $instance::getFileContent($element, $submission); - return [ - self::DOCUMENT_CONTENT => $content, - self::DOCUMENT_SIZE => strlen($content), - self::DOCUMENT_MIME_TYPE => $mimeType, - self::DOCUMENT_FILENAME => $fileName, - self::DOCUMENT_LANGUAGE => self::DOCUMENT_LANGUAGE_DEFAULT, - ]; + return new Document( + $content, + $mimeType, + $fileName + ); } /** @@ -72,15 +64,6 @@ protected function replaceTokens(string $text, WebformSubmissionInterface $submi return $this->webformTokenManager->replace($text, $submission); } - /** - * Check if a document is a PDF document. - * - * @phpstan-param array $document - */ - protected function isPdf(array $document): bool { - return self::MIME_TYPE_PDF === $document[self::DOCUMENT_MIME_TYPE]; - } - /** * Convert MeMo message to DOM document. */ diff --git a/src/Helper/BeskedfordelerHelper.php b/src/Helper/BeskedfordelerHelper.php index ab3c249..ddb8206 100644 --- a/src/Helper/BeskedfordelerHelper.php +++ b/src/Helper/BeskedfordelerHelper.php @@ -4,7 +4,7 @@ use DigitalPost\MeMo\Message as MeMoMessage; use Drupal\Core\Database\Connection; -use Drupal\os2forms_digital_post\Exception\InvalidMessage; +use Drupal\os2forms_digital_post\Exception\InvalidMessageException; use Drupal\os2forms_digital_post\Model\Message; use Drupal\webform\WebformSubmissionInterface; use Psr\Log\LoggerAwareTrait; @@ -85,7 +85,7 @@ public function addBeskedfordelerMessage(string $messageUUID, string $beskedford $message = $this->loadMessage($messageUUID); if (NULL === $message) { - throw new InvalidMessage(sprintf('Invalid message UUID: %s', $messageUUID)); + throw new InvalidMessageException(sprintf('Invalid message UUID: %s', $messageUUID)); } return $this->database diff --git a/src/Helper/DigitalPostHelper.php b/src/Helper/DigitalPostHelper.php new file mode 100644 index 0000000..d9fe0be --- /dev/null +++ b/src/Helper/DigitalPostHelper.php @@ -0,0 +1,147 @@ + $handlerSettings + * @phpstan-param array $submissionData + * @phpstan-return array + */ + public function sendDigitalPost(string $type, Message $message, ?ForsendelseI $forsendelse, WebformSubmissionInterface $submission): array { + $senderSettings = $this->settings->getSender(); + $options = [ + 'test_mode' => (bool) $this->settings->getTestMode(), + 'authority_cvr' => $senderSettings[Settings::SENDER_IDENTIFIER], + 'certificate_locator' => $this->certificateLocatorHelper->getCertificateLocator(), + ]; + $service = new SF1601($options); + $transactionId = Serializer::createUuid(); + $response = $service->kombiPostAfsend($transactionId, $type, $message, $forsendelse); + + $this->beskedfordelerHelper->createMessage($submission->id(), $message, (string) $response->getContent()); + + return [$response, $service->getLastKombiMeMoMessage()]; + } + + /** + * {@inheritdoc} + */ + public function log($level, $message, array $context = []): void { + $this->logger->log($level, $message, $context); + // @see https://www.drupal.org/node/3020595 + if (isset($context['webform_submission']) && $context['webform_submission'] instanceof WebformSubmissionInterface) { + $this->submissionLogger->log($level, $message, $context); + } + } + + /** + * Look up CPR. + */ + public function lookupCpr(string $cpr): CprLookupResult { + $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cpr_lookup'); + if (!($instance instanceof DataLookupInterfaceCpr)) { + throw new RuntimeException('Cannot get CPR data lookup instance'); + } + $lookupResult = $instance->lookup($cpr); + if (!$lookupResult->isSuccessful()) { + throw new RuntimeException('Cannot lookup CPR'); + } + + return $lookupResult; + } + + /** + * Look up CVR. + */ + public function lookupCvr(string $cvr): CompanyLookupResult { + $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cvr_lookup'); + if (!($instance instanceof DataLookupInterfaceCompany)) { + throw new RuntimeException('Cannot get CVR data lookup instance'); + } + $lookupResult = $instance->lookup($cvr); + if (!$lookupResult->isSuccessful()) { + throw new RuntimeException('Cannot lookup CVR'); + } + + return $lookupResult; + } + + /** + * Look up recipient. + */ + public function lookupRecipient(string $recipient): CprLookupResult|CompanyLookupResult { + try { + return preg_match('/^\d{8}$/', $recipient) + ? $this->lookupCvr($recipient) + : $this->lookupCpr($recipient); + } + catch (\Exception) { + throw new RuntimeException('Cannot lookup recipient'); + } + } + + /** + * Get MeMeHelper. + */ + public function getMeMoHelper(): MeMoHelper { + return $this->meMoHelper; + } + + /** + * Get ForsendelseHelper. + */ + public function getForsendelseHelper(): ForsendelseHelper { + return $this->forsendelseHelper; + } + +} diff --git a/src/Helper/ForsendelseHelper.php b/src/Helper/ForsendelseHelper.php index 743c138..42cbbea 100644 --- a/src/Helper/ForsendelseHelper.php +++ b/src/Helper/ForsendelseHelper.php @@ -2,6 +2,8 @@ namespace Drupal\os2forms_digital_post\Helper; +use Drupal\os2forms_digital_post\Exception\InvalidForsendelseException; +use Drupal\os2forms_digital_post\Model\Document; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drupal\os2web_datalookup\LookupResult\CompanyLookupResult; use Drupal\os2web_datalookup\LookupResult\CprLookupResult; @@ -19,42 +21,49 @@ * Forsendelse helper. */ class ForsendelseHelper extends AbstractMessageHelper { - public const FORSENDELSES_TYPE_IDENTIFIKATOR = 'forsendelses_type_identifikator'; - // PostKategoriKode. public const POST_KATEGORI_KODE_PRIORITAIRE = 'Prioritaire'; /** * Build forsendelse. - * - * @phpstan-param array $options - * @phpstan-param array $handlerSettings */ - public function buildForsendelse(WebformSubmissionInterface $submission, array $options, array $handlerSettings, CprLookupResult|CompanyLookupResult|null $recipientData = NULL): ForsendelseI { + public function buildForsendelse(CprLookupResult|CompanyLookupResult $recipientData, string $messageLabel, Document $document): ForsendelseI { $forsendelse = new ForsendelseI(); - $label = $this->replaceTokens($options[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], $submission); + $senderOptions = $this->settings->getSender(); $forsendelse ->setPostParametre((new PostParametre()) ->setPostKategoriKode(self::POST_KATEGORI_KODE_PRIORITAIRE)) ->setForsendelseModtager($this->createModtager($recipientData)) - ->setForsendelseTypeIdentifikator($options[self::FORSENDELSES_TYPE_IDENTIFIKATOR]) + ->setForsendelseTypeIdentifikator($senderOptions[Settings::FORSENDELSES_TYPE_IDENTIFIKATOR]) ->setAfsendelseIdentifikator(Serializer::createUuid()) ->setTransaktionsParametreI() ->setDokumentParametre((new DokumentParametre()) - ->setTitelTekst($label)); + ->setTitelTekst($messageLabel)); - $document = $this->getMainDocument($submission, $handlerSettings); - if (!$this->isPdf($document)) { - // This should never happen. - // @todo We cannot to handle non-PDF content. + if (!$document->isPdf()) { + throw new InvalidForsendelseException('Document must be a PDF'); } $forsendelse ->setFilformatNavn('PDF') - ->setMeddelelseIndholdData($document[self::DOCUMENT_CONTENT]); + ->setMeddelelseIndholdData($document->content); return $forsendelse; + + } + + /** + * Build forsendelse form a webform submission. + * + * @phpstan-param array $options + * @phpstan-param array $handlerSettings + */ + public function buildSubmissionForsendelse(WebformSubmissionInterface $submission, array $options, array $handlerSettings, CprLookupResult|CompanyLookupResult $recipientData): ForsendelseI { + $label = $this->replaceTokens($options[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], $submission); + $document = $this->getMainDocument($submission, $handlerSettings); + + return $this->buildForsendelse($recipientData, $label, $document); } /** diff --git a/src/Helper/MeMoHelper.php b/src/Helper/MeMoHelper.php index 38ec89e..c025261 100644 --- a/src/Helper/MeMoHelper.php +++ b/src/Helper/MeMoHelper.php @@ -14,7 +14,7 @@ use DigitalPost\MeMo\MessageHeader; use DigitalPost\MeMo\Recipient; use DigitalPost\MeMo\Sender; -use Drupal\os2forms_digital_post\Form\SettingsForm; +use Drupal\os2forms_digital_post\Model\Document; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drupal\os2web_datalookup\LookupResult\CompanyLookupResult; use Drupal\os2web_datalookup\LookupResult\CprLookupResult; @@ -28,35 +28,35 @@ class MeMoHelper extends AbstractMessageHelper { /** - * Build MeMo message. - * - * @phpstan-param array $options - * @phpstan-param array $handlerSettings + * Build message. */ - public function buildMessage(WebformSubmissionInterface $submission, array $options, array $handlerSettings, CprLookupResult|CompanyLookupResult|null $recipientData = NULL): Message { + public function buildMessage(CprLookupResult|CompanyLookupResult $recipientData, string $senderLabel, string $messageLabel, Document $document, array $actions): Message { $messageUUID = Serializer::createUuid(); $messageID = Serializer::createUuid(); $message = new Message(); - $label = $this->replaceTokens($options[WebformHandlerSF1601::SENDER_LABEL], $submission); + $senderOptions = $this->settings->getSender(); $sender = (new Sender()) - ->setIdType($options[SettingsForm::SENDER_IDENTIFIER_TYPE]) - ->setSenderID($options[SettingsForm::SENDER_IDENTIFIER]) - ->setLabel($label); + ->setIdType($senderOptions[Settings::SENDER_IDENTIFIER_TYPE]) + ->setSenderID($senderOptions[Settings::SENDER_IDENTIFIER]) + ->setLabel($senderLabel); + + [$recipientIdType, $recipientID] = $recipientData instanceof CompanyLookupResult + ? ['CVR', $recipientData->getCvr()] + : ['CPR', $recipientData->getCpr()]; $recipient = (new Recipient()) - ->setIdType($options[WebformHelperSF1601::RECIPIENT_IDENTIFIER_TYPE]) - ->setRecipientID($options[WebformHelperSF1601::RECIPIENT_IDENTIFIER]); + ->setIdType($recipientIdType) + ->setRecipientID($recipientID); $this->enrichRecipient($recipient, $recipientData); - $label = $this->replaceTokens($options[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], $submission); $messageHeader = (new MessageHeader()) ->setMessageType(SF1601::MESSAGE_TYPE_DIGITAL_POST) ->setMessageUUID($messageUUID) ->setMessageID($messageID) - ->setLabel($label) + ->setLabel($messageLabel) ->setMandatory(FALSE) ->setLegalNotification(FALSE) ->setSender($sender) @@ -67,21 +67,17 @@ public function buildMessage(WebformSubmissionInterface $submission, array $opti $body = (new MessageBody()) ->setCreatedDateTime(new \DateTime()); - $document = $this->getMainDocument($submission, $handlerSettings); - $mainDocument = (new MainDocument()) ->setFile([ (new File()) - ->setEncodingFormat($document[self::DOCUMENT_MIME_TYPE]) - ->setLanguage($document[self::DOCUMENT_LANGUAGE]) - ->setFilename($document[self::DOCUMENT_FILENAME]) - ->setContent($document[self::DOCUMENT_CONTENT]), + ->setEncodingFormat($document->mimeType) + ->setLanguage($document->language) + ->setFilename($document->filename) + ->setContent($document->content), ]); - if (isset($handlerSettings[WebformHandlerSF1601::MEMO_ACTIONS]['actions'])) { - foreach ($handlerSettings[WebformHandlerSF1601::MEMO_ACTIONS]['actions'] as $spec) { - $mainDocument->addToAction($this->buildAction($spec, $submission)); - } + foreach ($actions as $action) { + $mainDocument->addToAction($action); } $body->setMainDocument($mainDocument); @@ -91,6 +87,26 @@ public function buildMessage(WebformSubmissionInterface $submission, array $opti return $message; } + /** + * Build MeMo message from a webform submission. + * + * @phpstan-param array $options + * @phpstan-param array $handlerSettings + */ + public function buildWebformSubmissionMessage(WebformSubmissionInterface $submission, array $options, array $handlerSettings, CprLookupResult|CompanyLookupResult|null $recipientData = NULL): Message { + $senderLabel = $this->replaceTokens($options[WebformHandlerSF1601::SENDER_LABEL], $submission); + $messageLabel = $this->replaceTokens($options[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], $submission); + $document = $this->getMainDocument($submission, $handlerSettings); + $actions = []; + if (isset($handlerSettings[WebformHandlerSF1601::MEMO_ACTIONS]['actions'])) { + foreach ($handlerSettings[WebformHandlerSF1601::MEMO_ACTIONS]['actions'] as $spec) { + $actions[] = $this->buildAction($spec, $submission); + } + } + + return $this->buildMessage($recipientData, $senderLabel, $messageLabel, $document, $actions); + } + /** * Enrich recipient with additional data from a lookup. */ diff --git a/src/Helper/Settings.php b/src/Helper/Settings.php index 7f65e3b..e64be73 100644 --- a/src/Helper/Settings.php +++ b/src/Helper/Settings.php @@ -11,6 +11,10 @@ * General settings for os2forms_digital_post. */ final class Settings { + public const SENDER_IDENTIFIER_TYPE = 'sender_identifier_type'; + public const SENDER_IDENTIFIER = 'sender_identifier'; + public const FORSENDELSES_TYPE_IDENTIFIKATOR = 'forsendelses_type_identifikator'; + /** * The store. * diff --git a/src/Helper/WebformHelperSF1601.php b/src/Helper/WebformHelperSF1601.php index 4dcbc5e..50502d3 100644 --- a/src/Helper/WebformHelperSF1601.php +++ b/src/Helper/WebformHelperSF1601.php @@ -7,12 +7,10 @@ use Drupal\advancedqueue\JobResult; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\os2forms_digital_post\Exception\InvalidRecipientIdentifierElementException; use Drupal\os2forms_digital_post\Exception\RuntimeException; use Drupal\os2forms_digital_post\Exception\SubmissionNotFoundException; -use Drupal\os2forms_digital_post\Form\SettingsForm; use Drupal\os2forms_digital_post\Plugin\AdvancedQueue\JobType\SendDigitalPostSF1601; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drupal\os2web_datalookup\Plugin\DataLookupManager; @@ -20,7 +18,6 @@ use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr; use Drupal\webform\WebformSubmissionInterface; use Drupal\webform\WebformSubmissionStorageInterface; -use ItkDev\Serviceplatformen\Service\SF1601\Serializer; use ItkDev\Serviceplatformen\Service\SF1601\SF1601; use Psr\Log\LoggerInterface; use Psr\Log\LoggerTrait; @@ -48,20 +45,6 @@ final class WebformHelperSF1601 implements LoggerInterface { */ protected EntityStorageInterface $queueStorage; - /** - * The logger. - * - * @var \Drupal\Core\Logger\LoggerChannelInterface - */ - protected LoggerChannelInterface $logger; - - /** - * The submission logger. - * - * @var \Drupal\Core\Logger\LoggerChannelInterface - */ - protected LoggerChannelInterface $submissionLogger; - /** * Constructor. */ @@ -73,12 +56,12 @@ public function __construct( readonly private MeMoHelper $meMoHelper, readonly private ForsendelseHelper $forsendelseHelper, readonly private BeskedfordelerHelper $beskedfordelerHelper, - LoggerChannelFactoryInterface $loggerChannelFactory + readonly private LoggerChannelInterface $logger, + readonly private LoggerChannelInterface $submissionLogger, + readonly private DigitalPostHelper $digitalPostHelper ) { $this->webformSubmissionStorage = $entityTypeManager->getStorage('webform_submission'); $this->queueStorage = $entityTypeManager->getStorage('advancedqueue_queue'); - $this->logger = $loggerChannelFactory->get('os2forms_digital_post'); - $this->submissionLogger = $loggerChannelFactory->get('webform_submission'); } /** @@ -171,39 +154,29 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h self::RECIPIENT_IDENTIFIER_TYPE => $recipientIdentifierType, self::RECIPIENT_IDENTIFIER => $recipientIdentifier, - SettingsForm::SENDER_IDENTIFIER_TYPE => $senderSettings[SettingsForm::SENDER_IDENTIFIER_TYPE], - SettingsForm::SENDER_IDENTIFIER => $senderSettings[SettingsForm::SENDER_IDENTIFIER], + Settings::SENDER_IDENTIFIER_TYPE => $senderSettings[Settings::SENDER_IDENTIFIER_TYPE], + Settings::SENDER_IDENTIFIER => $senderSettings[Settings::SENDER_IDENTIFIER], WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], ]; - $message = $this->meMoHelper->buildMessage($submission, $messageOptions, $handlerSettings, $lookupResult); + $message = $this->meMoHelper->buildWebformSubmissionMessage($submission, $messageOptions, $handlerSettings, $lookupResult); $forsendelseOptions = [ self::RECIPIENT_IDENTIFIER_TYPE => $recipientIdentifierType, self::RECIPIENT_IDENTIFIER => $recipientIdentifier, - SettingsForm::SENDER_IDENTIFIER_TYPE => $senderSettings[SettingsForm::SENDER_IDENTIFIER_TYPE], - SettingsForm::SENDER_IDENTIFIER => $senderSettings[SettingsForm::SENDER_IDENTIFIER], - SettingsForm::FORSENDELSES_TYPE_IDENTIFIKATOR => $senderSettings[SettingsForm::FORSENDELSES_TYPE_IDENTIFIKATOR], + Settings::SENDER_IDENTIFIER_TYPE => $senderSettings[Settings::SENDER_IDENTIFIER_TYPE], + Settings::SENDER_IDENTIFIER => $senderSettings[Settings::SENDER_IDENTIFIER], + Settings::FORSENDELSES_TYPE_IDENTIFIKATOR => $senderSettings[Settings::FORSENDELSES_TYPE_IDENTIFIKATOR], WebformHandlerSF1601::SENDER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::SENDER_LABEL], WebformHandlerSF1601::MESSAGE_HEADER_LABEL => $handlerMessageSettings[WebformHandlerSF1601::MESSAGE_HEADER_LABEL], ]; - $forsendelse = $this->forsendelseHelper->buildForsendelse($submission, $forsendelseOptions, $handlerSettings, $lookupResult); + $forsendelse = $this->forsendelseHelper->buildSubmissionForsendelse($submission, $forsendelseOptions, $handlerSettings, $lookupResult); - $options = [ - 'test_mode' => (bool) $this->settings->getTestMode(), - 'authority_cvr' => $senderSettings[SettingsForm::SENDER_IDENTIFIER], - 'certificate_locator' => $this->certificateLocatorHelper->getCertificateLocator(), - ]; - $service = new SF1601($options); - $transactionId = Serializer::createUuid(); $type = $handlerMessageSettings[WebformHandlerSF1601::TYPE] ?? SF1601::TYPE_DIGITAL_POST; - $response = $service->kombiPostAfsend($transactionId, $type, $message, $forsendelse); - - $this->beskedfordelerHelper->createMessage($submission->id(), $message, (string) $response->getContent()); - return [$response, $service->getLastKombiMeMoMessage()]; + return $this->digitalPostHelper->sendDigitalPost($type, $message, $forsendelse, $submission); } /** diff --git a/src/Model/Document.php b/src/Model/Document.php new file mode 100644 index 0000000..42768ad --- /dev/null +++ b/src/Model/Document.php @@ -0,0 +1,31 @@ +mimeType; + } + +} From 0b9bec77ce78a3c5a7b4025dd15b8f052091b730 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Fri, 14 Jul 2023 12:40:28 +0200 Subject: [PATCH 23/26] FORMS-821: Guzzle 6 --- src/Helper/CertificateLocatorHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helper/CertificateLocatorHelper.php b/src/Helper/CertificateLocatorHelper.php index 09098a5..c14be13 100644 --- a/src/Helper/CertificateLocatorHelper.php +++ b/src/Helper/CertificateLocatorHelper.php @@ -4,7 +4,7 @@ use Drupal\os2forms_digital_post\Exception\CertificateLocatorException; use GuzzleHttp\Client; -use Http\Adapter\Guzzle7\Client as GuzzleAdapter; +use Http\Adapter\Guzzle6\Client as GuzzleAdapter; use Http\Factory\Guzzle\RequestFactory; use ItkDev\AzureKeyVault\Authorisation\VaultToken; use ItkDev\AzureKeyVault\KeyVault\VaultSecret; From 7758a62d16f23d06432b9e656b97b025be4f30f8 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Fri, 4 Aug 2023 10:11:11 +0200 Subject: [PATCH 24/26] Allowed Drush 12 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c358775..0a04a00 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "dompdf/dompdf": "^2.0", "drupal/advancedqueue": "^1.0", "drupal/webform": "^6.0", - "drush/drush": "^10 || ^11", + "drush/drush": "^11 || ^12", "http-interop/http-factory-guzzle": "^1.0.0", "itk-dev/beskedfordeler-drupal": "^1.0", "itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5", From e775f9bd05f3ef8e52b54143b0b8041ead11e72d Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 7 Aug 2023 11:32:11 +0200 Subject: [PATCH 25/26] Added missing logger --- os2forms_digital_post.services.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os2forms_digital_post.services.yml b/os2forms_digital_post.services.yml index 910570b..2697889 100644 --- a/os2forms_digital_post.services.yml +++ b/os2forms_digital_post.services.yml @@ -3,6 +3,10 @@ services: parent: logger.channel_base arguments: [ 'os2forms_digital_post' ] + logger.channel.os2forms_digital_post_submission: + parent: logger.channel_base + arguments: [ 'os2forms_digital_post_submission' ] + Drupal\os2forms_digital_post\Helper\Settings: arguments: - "@keyvalue" From 1357304e08b7fb686fdbf65be8caa8726e73c685 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 14 Aug 2023 12:35:36 +0200 Subject: [PATCH 26/26] Fixed CHANGELOG --- CHANGELOG.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e35b877..268e02b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,17 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + +- Added API for sending digital post + [PR-40](https://github.com/itk-dev/os2forms_digital_post/pull/40) + +### Changed + +- Changed dependency on CPR and CVR lookup modules. Handled physical post + (“forsendelse”) + [PR-37](https://github.com/itk-dev/os2forms_digital_post/pull/37) + ### Removed - Removed support for [SF-1600](https://digitaliseringskataloget.dk/integration/sf1600). @@ -19,16 +30,11 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Added the `CPR / Navn validering` element to allowed recipient element names [PR-43](https://github.com/itk-dev/os2forms_digital_post/pull/43) -- Added API for sending digital post - [PR-40](https://github.com/itk-dev/os2forms_digital_post/pull/40) ## Changed - Changed composer name to `os2forms/os2forms_digital_post` [PR-47](https://github.com/itk-dev/os2forms_digital_post/pull/47) -- Changed dependency on CPR and CVR lookup modules. Handled physical post - (“forsendelse”) - [PR-37](https://github.com/itk-dev/os2forms_digital_post/pull/37) ## [2.0.1]