From c0425812c4765da17c1fbc94e755fcb965ec7f6f Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 14:30:35 +0100 Subject: [PATCH 01/37] Update friendsofphp/php-cs-fixer --- .gitignore | 2 +- .php_cs.dist => .php-cs-fixer.dist.php | 28 +- Makefile | 4 +- composer.json | 2 +- composer.lock | 808 ++++++++++++------------- 5 files changed, 407 insertions(+), 437 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (55%) diff --git a/.gitignore b/.gitignore index 0cd1724..d65c30c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .idea vendor -.php_cs.cache \ No newline at end of file +.php-cs-fixer.cache \ No newline at end of file diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 55% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index 47774ef..b8e7c17 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -1,35 +1,39 @@ setRiskyAllowed(false) ->setRules([ '@PSR2' => true, '@Symfony' => true, '@PhpCsFixer' => true, + '@DoctrineAnnotation' => true, 'array_syntax' => ['syntax' => 'short'], 'cast_spaces' => ['space' => 'none'], 'concat_space' => ['spacing' => 'one'], - 'yoda_style' => null, - 'ordered_class_elements' => null, - 'ordered_imports' => null, + 'yoda_style' => false, + 'ordered_class_elements' => false, + 'ordered_imports' => false, //'method_argument_space' => null, //'no_whitespace_in_blank_line' => null, //'no_extra_blank_lines' => null, //'braces' => null, - 'blank_line_before_statement' => null, + 'blank_line_before_statement' => false, 'phpdoc_align' => ['align' => 'left'], - 'phpdoc_var_without_name' => null, - 'phpdoc_types_order' => null, - 'phpdoc_order' => null, - 'phpdoc_separation' => null, + 'phpdoc_var_without_name' => false, + 'phpdoc_types_order' => false, + 'phpdoc_order' => false, + 'phpdoc_separation' => false, + 'phpdoc_no_empty_return' => false, + 'phpdoc_add_missing_param_annotation' => false, //'no_superfluous_elseif' => null, - 'class_definition' => null, + 'class_definition' => false, 'ternary_to_null_coalescing' => true, 'php_unit_test_class_requires_covers' => false, 'php_unit_internal_class' => false, + 'phpdoc_to_comment' => false, + 'single_line_comment_style' => false, ]) ->setFinder( PhpCsFixer\Finder::create() ->in(__DIR__ . '/src') - ) -; + ); diff --git a/Makefile b/Makefile index 844e3f7..aab442f 100644 --- a/Makefile +++ b/Makefile @@ -5,5 +5,5 @@ make: composer dump-autoload cs-fix: - ./vendor/bin/php-cs-fixer fix ./src --config .php_cs.dist - ./vendor/bin/php-cs-fixer fix ./examples --config .php_cs.dist \ No newline at end of file + ./vendor/bin/php-cs-fixer fix ./src --config .php-cs-fixer.dist.php + ./vendor/bin/php-cs-fixer fix ./examples --config .php-cs-fixer.dist.php \ No newline at end of file diff --git a/composer.json b/composer.json index a3cd163..b9c6274 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,6 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17" + "friendsofphp/php-cs-fixer": "^3.4" } } diff --git a/composer.lock b/composer.lock index 5f6fb86..1aa636c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e38a24289b54d2f99c8f4ade62eebec7", + "content-hash": "968c520525062e84d749b2e9d450a610", "packages": [ { "name": "guzzlehttp/guzzle", @@ -390,18 +390,89 @@ } ], "packages-dev": [ + { + "name": "composer/pcre", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-12-06T15:17:27+00:00" + }, { "name": "composer/semver", - "version": "3.2.4", + "version": "3.2.6", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" + "reference": "83e511e247de329283478496f7a1e114c9517506" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", - "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", + "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", + "reference": "83e511e247de329283478496f7a1e114c9517506", "shasum": "" }, "require": { @@ -453,7 +524,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.4" + "source": "https://github.com/composer/semver/tree/3.2.6" }, "funding": [ { @@ -469,29 +540,31 @@ "type": "tidelift" } ], - "time": "2020-11-13T08:59:24+00:00" + "time": "2021-10-25T11:34:17+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.6", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c" + "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6555461e76962fd0379c444c46fd558a0fcfb65e", + "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e", "shasum": "" }, "require": { + "composer/pcre": "^1", "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" }, "type": "library", "autoload": { @@ -517,7 +590,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.3" }, "funding": [ { @@ -533,32 +606,34 @@ "type": "tidelift" } ], - "time": "2021-03-25T17:01:18+00:00" + "time": "2021-12-08T13:07:32+00:00" }, { "name": "doctrine/annotations", - "version": "1.12.1", + "version": "1.13.2", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b" + "reference": "5b668aef16090008790395c02c893b1ba13f7e08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/b17c5014ef81d212ac539f07a1001832df1b6d3b", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08", "shasum": "" }, "require": { "doctrine/lexer": "1.*", "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { - "doctrine/cache": "1.*", + "doctrine/cache": "^1.11 || ^2.0", "doctrine/coding-standard": "^6.0 || ^8.1", "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" }, "type": "library", "autoload": { @@ -601,9 +676,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.12.1" + "source": "https://github.com/doctrine/annotations/tree/1.13.2" }, - "time": "2021-02-21T21:00:45+00:00" + "time": "2021-08-05T19:00:23+00:00" }, { "name": "doctrine/lexer", @@ -687,58 +762,56 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.18.5", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "e0f6d05c8b157f50029ca6c65c19ed2694f475bf" + "reference": "47177af1cfb9dab5d1cc4daf91b7179c2efe7fad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/e0f6d05c8b157f50029ca6c65c19ed2694f475bf", - "reference": "e0f6d05c8b157f50029ca6c65c19ed2694f475bf", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/47177af1cfb9dab5d1cc4daf91b7179c2efe7fad", + "reference": "47177af1cfb9dab5d1cc4daf91b7179c2efe7fad", "shasum": "" }, "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2", - "doctrine/annotations": "^1.2", + "composer/semver": "^3.2", + "composer/xdebug-handler": "^2.0", + "doctrine/annotations": "^1.12", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + "php": "^7.2.5 || ^8.0", + "php-cs-fixer/diff": "^2.0", + "symfony/console": "^4.4.20 || ^5.1.3 || ^6.0", + "symfony/event-dispatcher": "^4.4.20 || ^5.0 || ^6.0", + "symfony/filesystem": "^4.4.20 || ^5.0 || ^6.0", + "symfony/finder": "^4.4.20 || ^5.0 || ^6.0", + "symfony/options-resolver": "^4.4.20 || ^5.0 || ^6.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.23", + "symfony/polyfill-php81": "^1.23", + "symfony/process": "^4.4.20 || ^5.0 || ^6.0", + "symfony/stopwatch": "^4.4.20 || ^5.0 || ^6.0" }, "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^1.5", + "mikey179/vfsstream": "^1.6.8", + "php-coveralls/php-coveralls": "^2.5.2", + "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.15", "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", + "phpunit/phpunit": "^8.5.21 || ^9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + "symfony/phpunit-bridge": "^5.2.4 || ^6.0", + "symfony/yaml": "^4.4.20 || ^5.0 || ^6.0" }, "suggest": { "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + "ext-mbstring": "For handling non-UTF8 characters." }, "bin": [ "php-cs-fixer" @@ -747,20 +820,7 @@ "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -779,7 +839,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.5" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.4.0" }, "funding": [ { @@ -787,20 +847,20 @@ "type": "github" } ], - "time": "2021-04-06T18:37:33+00:00" + "time": "2021-12-11T16:25:08+00:00" }, { "name": "php-cs-fixer/diff", - "version": "v1.3.1", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", "shasum": "" }, "require": { @@ -828,40 +888,91 @@ { "name": "Kore Nordmann", "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" } ], - "description": "sebastian/diff v2 backport support for PHP5.6", + "description": "sebastian/diff v3 backport support for PHP 5.6+", "homepage": "https://github.com/PHP-CS-Fixer", "keywords": [ "diff" ], "support": { "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + }, + "time": "2020-10-14T08:32:19+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } }, - "time": "2020-10-14T08:39:05+00:00" + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" }, { "name": "psr/container", - "version": "1.1.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -888,9 +999,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/event-dispatcher", @@ -944,30 +1055,30 @@ }, { "name": "psr/log", - "version": "1.1.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -977,7 +1088,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -988,50 +1099,48 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2020-03-23T09:12:05+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "symfony/console", - "version": "v5.2.6", + "version": "v6.0.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d" + "reference": "fafd9802d386bf1c267e0249ddb7ceb14dcfdad4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/35f039df40a3b335ebf310f244cb242b3a83ac8d", - "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d", + "url": "https://api.github.com/repos/symfony/console/zipball/fafd9802d386bf1c267e0249ddb7ceb14dcfdad4", + "reference": "fafd9802d386bf1c267e0249ddb7ceb14dcfdad4", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" }, "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -1071,7 +1180,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.2.6" + "source": "https://github.com/symfony/console/tree/v6.0.1" }, "funding": [ { @@ -1087,29 +1196,29 @@ "type": "tidelift" } ], - "time": "2021-03-28T09:42:18+00:00" + "time": "2021-12-09T12:47:37+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.2.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1138,7 +1247,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/master" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" }, "funding": [ { @@ -1154,44 +1263,42 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-11-01T23:48:49+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.2.4", + "version": "v6.0.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d08d6ec121a425897951900ab692b612a61d6240" + "reference": "4f06d19a5f78087061f9de6df3269c139c3d289d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d08d6ec121a425897951900ab692b612a61d6240", - "reference": "d08d6ec121a425897951900ab692b612a61d6240", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4f06d19a5f78087061f9de6df3269c139c3d289d", + "reference": "4f06d19a5f78087061f9de6df3269c139c3d289d", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/event-dispatcher-contracts": "^2", - "symfony/polyfill-php80": "^1.15" + "php": ">=8.0.2", + "symfony/event-dispatcher-contracts": "^2|^3" }, "conflict": { - "symfony/dependency-injection": "<4.4" + "symfony/dependency-injection": "<5.4" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/error-handler": "^4.4|^5.0", - "symfony/expression-language": "^4.4|^5.0", - "symfony/http-foundation": "^4.4|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^4.4|^5.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^5.4|^6.0" }, "suggest": { "symfony/dependency-injection": "", @@ -1223,7 +1330,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.4" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.1" }, "funding": [ { @@ -1239,24 +1346,24 @@ "type": "tidelift" } ], - "time": "2021-02-18T17:12:37+00:00" + "time": "2021-12-08T15:13:44+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.2.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2" + "reference": "aa5422287b75594b90ee9cd807caf8f0df491385" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2", - "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/aa5422287b75594b90ee9cd807caf8f0df491385", + "reference": "aa5422287b75594b90ee9cd807caf8f0df491385", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "psr/event-dispatcher": "^1" }, "suggest": { @@ -1265,7 +1372,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1302,7 +1409,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.2.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.0" }, "funding": [ { @@ -1318,25 +1425,26 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-07-15T12:33:35+00:00" }, { "name": "symfony/filesystem", - "version": "v5.2.6", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "8c86a82f51658188119e62cff0a050a12d09836f" + "reference": "52b3c9cce673b014915445a432339f282e002ce6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8c86a82f51658188119e62cff0a050a12d09836f", - "reference": "8c86a82f51658188119e62cff0a050a12d09836f", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/52b3c9cce673b014915445a432339f282e002ce6", + "reference": "52b3c9cce673b014915445a432339f282e002ce6", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, "type": "library", "autoload": { @@ -1364,7 +1472,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.2.6" + "source": "https://github.com/symfony/filesystem/tree/v6.0.0" }, "funding": [ { @@ -1380,24 +1488,24 @@ "type": "tidelift" } ], - "time": "2021-03-28T14:30:26+00:00" + "time": "2021-10-29T07:35:21+00:00" }, { "name": "symfony/finder", - "version": "v5.2.4", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0d639a0943822626290d169965804f79400e6a04" + "reference": "07debda41a4d32d33e59e6ab302af1701e15f173" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04", - "reference": "0d639a0943822626290d169965804f79400e6a04", + "url": "https://api.github.com/repos/symfony/finder/zipball/07debda41a4d32d33e59e6ab302af1701e15f173", + "reference": "07debda41a4d32d33e59e6ab302af1701e15f173", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -1425,7 +1533,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.4" + "source": "https://github.com/symfony/finder/tree/v6.0.0" }, "funding": [ { @@ -1441,27 +1549,25 @@ "type": "tidelift" } ], - "time": "2021-02-15T18:55:04+00:00" + "time": "2021-11-28T15:34:37+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.2.4", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce" + "reference": "be0facf48a42a232d6c0daadd76e4eb5657a4798" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", - "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/be0facf48a42a232d6c0daadd76e4eb5657a4798", + "reference": "be0facf48a42a232d6c0daadd76e4eb5657a4798", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.15" + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" }, "type": "library", "autoload": { @@ -1494,7 +1600,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.2.4" + "source": "https://github.com/symfony/options-resolver/tree/v6.0.0" }, "funding": [ { @@ -1510,20 +1616,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T12:56:27+00:00" + "time": "2021-11-23T19:05:29+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -1535,7 +1641,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1573,7 +1679,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -1589,20 +1695,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170" + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170", - "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "shasum": "" }, "require": { @@ -1614,7 +1720,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1654,7 +1760,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" }, "funding": [ { @@ -1670,20 +1776,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { @@ -1695,7 +1801,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1738,7 +1844,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" }, "funding": [ { @@ -1754,20 +1860,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -1779,7 +1885,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1818,7 +1924,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -1834,164 +1940,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.22.1", + "name": "symfony/polyfill-php80", + "version": "v1.23.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -2000,7 +1962,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2009,7 +1971,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, "files": [ "bootstrap.php" @@ -2023,6 +1985,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2032,7 +1998,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2041,7 +2007,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -2057,20 +2023,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.22.1", + "name": "symfony/polyfill-php81", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "e66119f3de95efc359483f810c4c3e6436279436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", + "reference": "e66119f3de95efc359483f810c4c3e6436279436", "shasum": "" }, "require": { @@ -2079,7 +2045,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2088,7 +2054,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Polyfill\\Php81\\": "" }, "files": [ "bootstrap.php" @@ -2102,10 +2068,6 @@ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2115,7 +2077,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2124,7 +2086,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" }, "funding": [ { @@ -2140,25 +2102,24 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-05-21T13:25:03+00:00" }, { "name": "symfony/process", - "version": "v5.2.4", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f" + "reference": "d970c45c2186aa4331d1656950a82df64e232580" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f", + "url": "https://api.github.com/repos/symfony/process/zipball/d970c45c2186aa4331d1656950a82df64e232580", + "reference": "d970c45c2186aa4331d1656950a82df64e232580", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -2186,7 +2147,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.2.4" + "source": "https://github.com/symfony/process/tree/v6.0.0" }, "funding": [ { @@ -2202,25 +2163,28 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-11-28T15:34:37+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.2.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603", + "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.0" + "php": ">=8.0.2", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -2228,7 +2192,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -2265,7 +2229,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/master" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.0" }, "funding": [ { @@ -2281,25 +2245,25 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-11-04T17:53:12+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.2.4", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c" + "reference": "0e0ed55d1ffdfadd03af180443fbdca9876483b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b12274acfab9d9850c52583d136a24398cdf1a0c", - "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/0e0ed55d1ffdfadd03af180443fbdca9876483b3", + "reference": "0e0ed55d1ffdfadd03af180443fbdca9876483b3", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1.0|^2" + "php": ">=8.0.2", + "symfony/service-contracts": "^1|^2|^3" }, "type": "library", "autoload": { @@ -2327,7 +2291,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.2.4" + "source": "https://github.com/symfony/stopwatch/tree/v6.0.0" }, "funding": [ { @@ -2343,35 +2307,37 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-11-23T19:05:29+00:00" }, { "name": "symfony/string", - "version": "v5.2.6", + "version": "v6.0.1", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572" + "reference": "0cfed595758ec6e0a25591bdc8ca733c1896af32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", - "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", + "url": "https://api.github.com/repos/symfony/string/zipball/0cfed595758ec6e0a25591bdc8ca733c1896af32", + "reference": "0cfed595758ec6e0a25591bdc8ca733c1896af32", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -2410,7 +2376,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.2.6" + "source": "https://github.com/symfony/string/tree/v6.0.1" }, "funding": [ { @@ -2426,7 +2392,7 @@ "type": "tidelift" } ], - "time": "2021-03-17T17:12:15+00:00" + "time": "2021-12-08T15:13:44+00:00" } ], "aliases": [], @@ -2439,5 +2405,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } From e1ec7f9dfe5d1db223257f0b34860edd7a603183 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 14:36:49 +0100 Subject: [PATCH 02/37] Improve php-cs-fixer call --- .php-cs-fixer.dist.php | 1 + Makefile | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index b8e7c17..2252fdf 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -36,4 +36,5 @@ ->setFinder( PhpCsFixer\Finder::create() ->in(__DIR__ . '/src') + ->in(__DIR__ . '/examples') ); diff --git a/Makefile b/Makefile index aab442f..ace7d59 100644 --- a/Makefile +++ b/Makefile @@ -5,5 +5,4 @@ make: composer dump-autoload cs-fix: - ./vendor/bin/php-cs-fixer fix ./src --config .php-cs-fixer.dist.php - ./vendor/bin/php-cs-fixer fix ./examples --config .php-cs-fixer.dist.php \ No newline at end of file + ./vendor/bin/php-cs-fixer fix \ No newline at end of file From 2714d649b8d1c6802e886a57f1ce9220e273c494 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 14:37:37 +0100 Subject: [PATCH 03/37] Update guzzlehttp/guzzle 7.3.0 to 7.4.1 --- composer.json | 2 +- composer.lock | 365 +++++++++++++++++++++++++++++++++++--------------- 2 files changed, 256 insertions(+), 111 deletions(-) diff --git a/composer.json b/composer.json index b9c6274..d960326 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require": { "php": "^7.4 || ^8.0", "ext-json": "*", - "guzzlehttp/guzzle": "^7.3" + "guzzlehttp/guzzle": "^7.4" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 1aa636c..f12f8e1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,28 +4,29 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "968c520525062e84d749b2e9d450a610", + "content-hash": "969b4f78a86ed50329ef699f6a1d7383", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "7.3.0", + "version": "7.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "7008573787b430c1c1f650e3722d9bba59967628" + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628", - "reference": "7008573787b430c1c1f650e3722d9bba59967628", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.7 || ^2.0", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0" + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" }, "provide": { "psr/http-client-implementation": "1.0" @@ -35,7 +36,7 @@ "ext-curl": "*", "php-http/client-integration-tests": "^3.0", "phpunit/phpunit": "^8.5.5 || ^9.3.5", - "psr/log": "^1.1" + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { "ext-curl": "Required for CURL handler support", @@ -45,7 +46,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.3-dev" + "dev-master": "7.4-dev" } }, "autoload": { @@ -61,19 +62,43 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, { "name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", @@ -87,7 +112,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.3.0" + "source": "https://github.com/guzzle/guzzle/tree/7.4.1" }, "funding": [ { @@ -99,28 +124,24 @@ "type": "github" }, { - "url": "https://github.com/alexeyshockov", - "type": "github" - }, - { - "url": "https://github.com/gmponos", - "type": "github" + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" } ], - "time": "2021-03-23T11:33:13+00:00" + "time": "2021-12-06T18:43:05+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.4.1", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { @@ -132,7 +153,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -148,10 +169,25 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", @@ -160,35 +196,52 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.1" + "source": "https://github.com/guzzle/promises/tree/1.5.1" }, - "time": "2021-03-07T09:25:29+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.8.1", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", - "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -196,30 +249,53 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "2.1-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -235,9 +311,23 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.1" + "source": "https://github.com/guzzle/psr7/tree/2.1.0" }, - "time": "2021-03-21T16:25:00+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-06T17:43:30+00:00" }, { "name": "psr/http-client", @@ -291,6 +381,61 @@ }, "time": "2020-06-29T06:28:15+00:00" }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" + }, { "name": "psr/http-message", "version": "1.0.1", @@ -387,6 +532,73 @@ "source": "https://github.com/ralouphie/getallheaders/tree/develop" }, "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-01T23:48:49+00:00" } ], "packages-dev": [ @@ -1198,73 +1410,6 @@ ], "time": "2021-12-09T12:47:37+00:00" }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-01T23:48:49+00:00" - }, { "name": "symfony/event-dispatcher", "version": "v6.0.1", From bb66c08807ee0577646923a8ced038502838724b Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 14:45:06 +0100 Subject: [PATCH 04/37] Update examples and ause api key from env --- README.md | 6 +++++- examples/customers_02_create.php | 6 ++++-- examples/customers_03_update.php | 6 ++++-- examples/customers_04_delete.php | 6 ++++-- examples/documents_01_load-list.php | 6 ++++-- examples/documents_02_filter-by-number.php | 6 ++++-- examples/documents_03_load-page-2.php | 6 ++++-- examples/documents_04_create.php | 6 ++++-- examples/documents_05_pdf_download.php | 8 +++++--- 9 files changed, 38 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index a4a49b7..5235c10 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,11 @@ print_r($result); ## More examples -Check the **examples** folder. +Check the **examples** folder and run: + +```shell +API_KEY= php examples/customers_01_load-list.php +``` ## Documentation diff --git a/examples/customers_02_create.php b/examples/customers_02_create.php index bfcd293..582555b 100644 --- a/examples/customers_02_create.php +++ b/examples/customers_02_create.php @@ -1,11 +1,13 @@ request('POST', 'customers', [ 'first_name' => 'Foo', diff --git a/examples/customers_03_update.php b/examples/customers_03_update.php index f42f878..df29ac0 100644 --- a/examples/customers_03_update.php +++ b/examples/customers_03_update.php @@ -1,11 +1,13 @@ request('GET', 'documents'); diff --git a/examples/documents_02_filter-by-number.php b/examples/documents_02_filter-by-number.php index 3fff4bf..e61655b 100644 --- a/examples/documents_02_filter-by-number.php +++ b/examples/documents_02_filter-by-number.php @@ -1,11 +1,13 @@ request( 'GET', diff --git a/examples/documents_03_load-page-2.php b/examples/documents_03_load-page-2.php index cf5faa7..6b887d7 100644 --- a/examples/documents_03_load-page-2.php +++ b/examples/documents_03_load-page-2.php @@ -1,11 +1,13 @@ request( 'GET', diff --git a/examples/documents_04_create.php b/examples/documents_04_create.php index 8d8e526..630e971 100644 --- a/examples/documents_04_create.php +++ b/examples/documents_04_create.php @@ -1,11 +1,13 @@ request('POST', 'documents', [ 'title' => 'Example Title', diff --git a/examples/documents_05_pdf_download.php b/examples/documents_05_pdf_download.php index 33b7ecc..81c2ffe 100644 --- a/examples/documents_05_pdf_download.php +++ b/examples/documents_05_pdf_download.php @@ -1,13 +1,15 @@ request('GET', "documents/{$docID}/pdf", null, true); From 0e66a34304a824af97b4365a7612ba8b91e9de67 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 14:45:19 +0100 Subject: [PATCH 05/37] Update examples and ause api key from env --- examples/customers_01_load-list.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/customers_01_load-list.php b/examples/customers_01_load-list.php index 22fb5e4..131f65d 100644 --- a/examples/customers_01_load-list.php +++ b/examples/customers_01_load-list.php @@ -1,11 +1,13 @@ request('GET', 'customers'); From d53c4dac19310acc7b342c3294bef2e4405d989f Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 18:46:33 +0100 Subject: [PATCH 06/37] Use nette/php-generator to generate models from swagger file --- composer.json | 5 +- composer.lock | 157 +- generators/models.php | 78 + generators/swagger.1.68.0.json | 6910 ++++++++++++++++++++++++++++++++ src/Models/.gitkeep | 0 5 files changed, 7146 insertions(+), 4 deletions(-) create mode 100644 generators/models.php create mode 100644 generators/swagger.1.68.0.json create mode 100644 src/Models/.gitkeep diff --git a/composer.json b/composer.json index d960326..91a71e2 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.0 || ^8.1", "ext-json": "*", "guzzlehttp/guzzle": "^7.4" }, @@ -29,6 +29,7 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4" + "friendsofphp/php-cs-fixer": "^3.4", + "nette/php-generator": "^3.6" } } diff --git a/composer.lock b/composer.lock index f12f8e1..20bd8c0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "969b4f78a86ed50329ef699f6a1d7383", + "content-hash": "6b9ab6148f5672f5e6e5499363ca6add", "packages": [ { "name": "guzzlehttp/guzzle", @@ -1061,6 +1061,159 @@ ], "time": "2021-12-11T16:25:08+00:00" }, + { + "name": "nette/php-generator", + "version": "v3.6.5", + "source": { + "type": "git", + "url": "https://github.com/nette/php-generator.git", + "reference": "9370403f9d9c25b51c4596ded1fbfe70347f7c82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/php-generator/zipball/9370403f9d9c25b51c4596ded1fbfe70347f7c82", + "reference": "9370403f9d9c25b51c4596ded1fbfe70347f7c82", + "shasum": "" + }, + "require": { + "nette/utils": "^3.1.2", + "php": ">=7.2 <8.2" + }, + "require-dev": { + "nette/tester": "^2.4", + "nikic/php-parser": "^4.13", + "phpstan/phpstan": "^0.12", + "tracy/tracy": "^2.8" + }, + "suggest": { + "nikic/php-parser": "to use ClassType::withBodiesFrom() & GlobalFunction::withBodyFrom()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.6-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.1 features.", + "homepage": "https://nette.org", + "keywords": [ + "code", + "nette", + "php", + "scaffolding" + ], + "support": { + "issues": "https://github.com/nette/php-generator/issues", + "source": "https://github.com/nette/php-generator/tree/v3.6.5" + }, + "time": "2021-11-24T16:23:44+00:00" + }, + { + "name": "nette/utils", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "2f261e55bd6a12057442045bf2c249806abc1d02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/2f261e55bd6a12057442045bf2c249806abc1d02", + "reference": "2f261e55bd6a12057442045bf2c249806abc1d02", + "shasum": "" + }, + "require": { + "php": ">=7.2 <8.2" + }, + "conflict": { + "nette/di": "<3.0.6" + }, + "require-dev": { + "nette/tester": "~2.0", + "phpstan/phpstan": "^1.0", + "tracy/tracy": "^2.3" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", + "ext-xml": "to use Strings::length() etc. when mbstring is not available" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v3.2.6" + }, + "time": "2021-11-24T15:47:23+00:00" + }, { "name": "php-cs-fixer/diff", "version": "v2.0.2", @@ -2546,7 +2699,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.4 || ^8.0", + "php": "^7.4 || ^8.0 || ^8.1", "ext-json": "*" }, "platform-dev": [], diff --git a/generators/models.php b/generators/models.php new file mode 100644 index 0000000..02d43e9 --- /dev/null +++ b/generators/models.php @@ -0,0 +1,78 @@ + $classInfo) { + if ( + $className === 'List' + || array_key_exists('allOf', $classInfo) + || !array_key_exists('properties', $classInfo) + ) { + // List dont supported. + continue; + } + + + $file = new Nette\PhpGenerator\PhpFile; + $file->setStrictTypes(); + $class = $file->addClass('easybill\SDK\Models\\' . $className); + + $construct = $class->addMethod('__construct'); + $construct->addPromotedParameter('data', [])->setPublic(); + + $errors = []; + + foreach ($classInfo['properties'] as $propertyName => $propertyInfo) { + + echo "==> " . $className . '::' . $propertyName . "\n"; + + $type = match ($propertyInfo['type']) { + 'integer' => 'int', + 'number' => 'float', + 'boolean' => 'bool', + default => $propertyInfo['type'], + }; + + $methodeName = str_replace('_', '', ucwords($propertyName, '_')); + + if (!($propertyInfo['readOnly'] ?? false)) { + $setter = $class->addMethod('set' . $methodeName); + if (trim($propertyInfo['description'] ?? '') !== '') { + $setter->addComment($propertyInfo['description']); + } + $setter->setReturnType('void'); + $setter->setBody('$this->data[\'' . $propertyName . '\'] = $' . $propertyName . ';'); + + $property = $setter->addParameter($propertyName); + $property->setType($type); + if ($propertyInfo['x-nullable'] ?? false) { + $property->setNullable(); + } + + } + + + $getter = $class->addMethod('get' . $methodeName); + $getter->setReturnType($type); + if ($propertyInfo['x-nullable'] ?? false) { + $getter->setReturnNullable(); + } + $getter->setBody('return $this->data[\'' . $propertyName . '\'];'); + + } + + file_put_contents(__DIR__ . '/../src/Models/' . $className . '.php', $file); + +} \ No newline at end of file diff --git a/generators/swagger.1.68.0.json b/generators/swagger.1.68.0.json new file mode 100644 index 0000000..8ce3fdf --- /dev/null +++ b/generators/swagger.1.68.0.json @@ -0,0 +1,6910 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.68.0", + "title": "easybill REST API", + "description": "\nThe first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md)\n\n## Authentication\n\nYou can choose between two available methods: `Basic Auth` or `Bearer Token`.\n\nIn each HTTP request, one of the following HTTP headers is required:\n\n```\n# Basic Auth\nAuthorization: Basic base64_encode(':')\n# Bearer Token\nAuthorization: Bearer \n```\n\n## Limitations\n\n### Request Limit\n\n* PLUS: 10 requests per minute\n* BUSINESS: 60 requests per minute\n\nIf the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests`\n\n### Result Limit\n\nAll result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000.\n\n## Query filter\n\nMany list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`.\n\n**Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large`\n\n### Escape commas in query\n\nYou can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request.\n\n## Property login_id\n\nThis is the login of your admin or employee account.\n\n## Date and Date-Time format\nPlease use the timezone `Europe/Berlin`.\n* **date** = *Y-m-d* = `2016-12-31`\n* **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37`\n\nDate or datetime can be `null` because the attributes have been added later and the entry is older." + }, + "tags": [ + { + "name": "customer", + "description": "Everything about your customers" + }, + { + "name": "customer group", + "description": "Groups for customer" + }, + { + "name": "discount", + "description": "Discounts for positions and position groups" + }, + { + "name": "document", + "description": "Invoices, offers, etc." + }, + { + "name": "document payment" + }, + { + "name": "position" + }, + { + "name": "position group" + }, + { + "name": "project" + }, + { + "name": "task" + }, + { + "name": "text template" + }, + { + "name": "time tracking" + }, + { + "name": "sepa payment" + }, + { + "name": "serial number" + }, + { + "name": "stock" + }, + { + "name": "webhook" + }, + { + "name": "pdf templates", + "description": "PDF Templates for documents" + }, + { + "name": "logins", + "description": "Informations regarding the logins / employees" + } + ], + "host": "api.easybill.de", + "basePath": "/rest/v1", + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "securityDefinitions": { + "Bearer": { + "type": "apiKey", + "name": "Authorization", + "in": "header", + "description": "Please use the following Format: **Bearer **" + }, + "basicAuth": { + "type": "basic" + } + }, + "security": [ + { + "Bearer": [] + }, + { + "basicAuth": [] + } + ], + "parameters": { + "LIMIT": { + "in": "query", + "name": "limit", + "description": "Limited the result. Default is 100. Maximum can be 1000.", + "type": "integer", + "required": false, + "minimum": 1, + "maximum": 1000 + }, + "PAGE": { + "in": "query", + "name": "page", + "description": "Set current Page. Default is 1.", + "type": "integer", + "required": false, + "minimum": 1 + } + }, + "paths": { + "/stocks": { + "get": { + "summary": "Fetch a list of stock entries for positions", + "tags": [ + "stock" + ], + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "position_id", + "description": "Filter stock entries by position id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "document_id", + "description": "Filter stock entries by document id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Stocks" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "summary": "Create a stock entry for a position", + "tags": [ + "stock" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Stock" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Stock" + } + }, + "400": { + "description": "Invalid position_id or stock_count" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/stocks/{id}": { + "get": { + "summary": "Fetch an stock entry for a position", + "tags": [ + "stock" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the stock entry that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Stock" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/serial-numbers": { + "get": { + "summary": "Fetch a list of serial numbers for positions", + "tags": [ + "serial number" + ], + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "position_id", + "description": "Filter serial numbers by position id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "document_id", + "description": "Filter serial numbers by document id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "in_use", + "description": "Filter serial numbers by usage.", + "required": false, + "type": "boolean" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SerialNumbers" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "summary": "Create s serial number for a position", + "tags": [ + "serial number" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/SerialNumber" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SerialNumber" + } + }, + "400": { + "description": "Invalid PositionID" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/serial-numbers/{id}": { + "get": { + "summary": "Fetch a serial number for a position", + "tags": [ + "serial number" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the serial number that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SerialNumber" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "summary": "Delete a serial number for a position", + "tags": [ + "serial number" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the serial number that needs to be deleted", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "400": { + "description": "Serial number in use. Operation failed." + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/logins": { + "get": { + "tags": [ + "logins" + ], + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Logins" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/logins/{id}": { + "get": { + "tags": [ + "logins" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the login that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Login" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customers": { + "get": { + "tags": [ + "customer" + ], + "summary": "Fetch customers list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "group_id", + "description": "Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "additional_group_id", + "description": "Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "number", + "description": "Filter customers by number. You can add multiple numbers separate by comma like no,no,no.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "country", + "description": "Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "zip_code", + "description": "Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "emails", + "description": "Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "first_name", + "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "last_name", + "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "company_name", + "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "created_at", + "description": "Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Customers" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "customer" + ], + "summary": "Create customer", + "description": "", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Customer" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "400": { + "description": "Invalid Customer" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customers/{id}": { + "get": { + "tags": [ + "customer" + ], + "summary": "Fetch customer", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "customer" + ], + "summary": "Update Customer", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer that needs to be updated", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Customer" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "400": { + "description": "Invalid Customer" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "customer" + ], + "summary": "Delete customer", + "description": "", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer that needs to be deleted", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customers/{customerId}/contacts": { + "get": { + "tags": [ + "contact" + ], + "summary": "Fetch customer contact list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "path", + "name": "customerId", + "description": "ID of customer that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Contacts" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "contact" + ], + "summary": "Create new contact", + "parameters": [ + { + "in": "path", + "name": "customerId", + "description": "ID of customer", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/Contact" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Contact" + } + }, + "400": { + "description": "Invalid contact" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customers/{customerId}/contacts/{id}": { + "get": { + "tags": [ + "contact" + ], + "summary": "Fetch contact", + "parameters": [ + { + "in": "path", + "name": "customerId", + "description": "ID of customer", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "id", + "description": "ID of contact", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Contact" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "contact" + ], + "summary": "Update Contact", + "parameters": [ + { + "in": "path", + "name": "customerId", + "description": "ID of customer", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "id", + "description": "ID of contact", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/Contact" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Contact" + } + }, + "400": { + "description": "Invalid contact" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "contact" + ], + "summary": "Delete contact", + "description": "", + "parameters": [ + { + "in": "path", + "name": "customerId", + "description": "ID of customer", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "id", + "description": "ID of contact", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/discounts/position": { + "get": { + "tags": [ + "discount" + ], + "summary": "Fetch list of position discounts", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "customer_id", + "description": "Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositions" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "discount" + ], + "summary": "Create a new position discount", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/discounts/position/{id}": { + "get": { + "tags": [ + "discount" + ], + "summary": "Fetch specified position discount by id", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the discount", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "discount" + ], + "summary": "Update a position discount", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the to be soon updated discount", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "discount" + ], + "summary": "Delete the specified position discount", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the to be soon deleted discount", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/discounts/position-group": { + "get": { + "tags": [ + "discount" + ], + "summary": "Fetch list of position-group discounts", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "customer_id", + "description": "Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositionGroups" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "discount" + ], + "summary": "Create a new position-group discount", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/discounts/position-group/{id}": { + "get": { + "tags": [ + "discount" + ], + "summary": "Fetch specified position-group discount by id", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the discount", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "discount" + ], + "summary": "Update a position-group discount", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the to be soon updated discount", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "discount" + ], + "summary": "Delete the specified position-group discount", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the to be soon deleted discount", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents": { + "get": { + "tags": [ + "document" + ], + "summary": "Fetch documents list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "type", + "description": "Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.", + "required": false, + "type": "string", + "enum": [ + "INVOICE", + "RECURRING", + "CREDIT", + "OFFER", + "REMINDER", + "DUNNING", + "STORNO", + "STORNO_CREDIT", + "DELIVERY", + "PDF", + "CHARGE", + "CHARGE_CONFIRM", + "LETTER", + "ORDER", + "PROFORMA_INVOICE", + "STORNO_PROFORMA_INVOICE" + ] + }, + { + "in": "query", + "name": "is_draft", + "description": "Filter documents by draft flag.", + "required": false, + "type": "string", + "enum": [ + "0", + "1" + ] + }, + { + "in": "query", + "name": "is_archive", + "description": "Filter documents by archive flag.", + "required": false, + "type": "string", + "enum": [ + "0", + "1" + ] + }, + { + "in": "query", + "name": "customer_id", + "description": "Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "project_id", + "description": "Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "document_date", + "description": "Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "paid_at", + "description": "Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "title", + "description": "Filter documents by title.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "number", + "description": "Filter documents by number.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "cancel_id", + "description": "Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "fulfillment_country", + "description": "Filter documents by fulfillment_country.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "vat_country", + "description": "Filter documents by vat_country.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "shipping_country", + "description": "Filter documents by shipping_country.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "status", + "description": "Filter documents by status. Keep in mind that not every document type has a status.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Documents" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "document" + ], + "summary": "Create document", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Document" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}": { + "get": { + "tags": [ + "document" + ], + "summary": "Fetch document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "document" + ], + "summary": "Update document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "query", + "name": "refresh_customer_data", + "description": "Forces refreshing of the customer data.", + "required": false, + "type": "boolean", + "enum": [ + "false", + "true" + ] + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Document" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "Invalid Document" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "document" + ], + "summary": "Delete document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/done": { + "put": { + "tags": [ + "document" + ], + "summary": "To complete a document.", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/cancel": { + "post": { + "tags": [ + "document" + ], + "summary": "Cancel document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/send/{type}": { + "post": { + "tags": [ + "document" + ], + "summary": "Send document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "type", + "required": true, + "type": "string", + "enum": [ + "email", + "fax", + "post" + ] + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostBoxRequest" + } + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/pdf": { + "get": { + "tags": [ + "document" + ], + "summary": "Fetch pdf document", + "produces": [ + "application/pdf" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "type": "string", + "format": "binary" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/jpg": { + "get": { + "tags": [ + "document" + ], + "summary": "Download a document as an jpeg-image", + "produces": [ + "image/jpeg" + ], + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "The page of the document where the image should start.", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "in": "query", + "name": "limit", + "description": "The page of the document where the image should end.", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "type": "string", + "format": "binary" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customer-groups": { + "get": { + "tags": [ + "customer group" + ], + "summary": "Fetch customer group list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/CustomerGroups" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "customer group" + ], + "summary": "Create customer group", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customer-groups/{id}": { + "get": { + "tags": [ + "customer group" + ], + "summary": "Fetch customer group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer group", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "customer group" + ], + "summary": "Update customer group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer goup", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + }, + "400": { + "description": "Invalid customer group" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "customer group" + ], + "summary": "Delete customer group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer group", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "task" + ], + "summary": "Fetch tasks list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Tasks" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "task" + ], + "summary": "Create task", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Task" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Task" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/tasks/{id}": { + "get": { + "tags": [ + "task" + ], + "summary": "Fetch task", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of task", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Task" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "task" + ], + "summary": "Update task", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of task", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Task" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Task" + } + }, + "400": { + "description": "Invalid task" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "task" + ], + "summary": "Delete task", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of task", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/projects": { + "get": { + "tags": [ + "project" + ], + "summary": "Fetch projects list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "customer_id", + "description": "Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "status", + "description": "Filter projects by status.", + "required": false, + "type": "string", + "enum": [ + "DONE", + "OPEN", + "CANCEL" + ] + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Projects" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "project" + ], + "summary": "Create project", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Project" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Project" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/projects/{id}": { + "get": { + "tags": [ + "project" + ], + "summary": "Fetch project", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of project", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Project" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "project" + ], + "summary": "Update project", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of project", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Project" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Project" + } + }, + "400": { + "description": "Invalid project" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "project" + ], + "summary": "Delete project", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of project", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/positions": { + "get": { + "tags": [ + "position" + ], + "summary": "Fetch positions list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "type", + "description": "Filter positions by type.", + "required": false, + "type": "string", + "enum": [ + "TEXT", + "PRODUCT", + "SERVICE" + ] + }, + { + "in": "query", + "name": "number", + "description": "Filter positions by number. You can add multiple numbers separate by comma like no,no,no.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Positions" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "position" + ], + "summary": "Create position", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Position" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Position" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/positions/{id}": { + "get": { + "tags": [ + "position" + ], + "summary": "Fetch position", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Position" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "position" + ], + "summary": "Update position", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Position" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Position" + } + }, + "400": { + "description": "Invalid position" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "position" + ], + "summary": "Delete position", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/position-groups": { + "get": { + "tags": [ + "position group" + ], + "summary": "Fetch position group list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PositionGroups" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "position group" + ], + "summary": "Create position group", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PositionGroup" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PositionGroup" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/position-groups/{id}": { + "get": { + "tags": [ + "position group" + ], + "summary": "Fetch position group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position group", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PositionGroup" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "position group" + ], + "summary": "Update position group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position goup", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PositionGroup" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PositionGroup" + } + }, + "400": { + "description": "Invalid position group" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "position group" + ], + "summary": "Delete position group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position group", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/time-trackings": { + "get": { + "tags": [ + "time tracking" + ], + "summary": "Fetch time trackings list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "login_id", + "description": "Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "project_id", + "description": "Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TimeTrackings" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "time tracking" + ], + "summary": "Create time tracking", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TimeTracking" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TimeTracking" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/time-trackings/{id}": { + "get": { + "tags": [ + "time tracking" + ], + "summary": "Fetch time tracking", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of time tracking", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TimeTracking" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "time tracking" + ], + "summary": "Update time tracking", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of time tracking", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TimeTracking" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TimeTracking" + } + }, + "400": { + "description": "Invalid time tracking" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "time tracking" + ], + "summary": "Delete time tracking", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of time tracking", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/text-templates": { + "get": { + "tags": [ + "text template" + ], + "summary": "Fetch text templates list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TextTemplates" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "text template" + ], + "summary": "Create text template", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TextTemplate" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TextTemplate" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/text-templates/{id}": { + "get": { + "tags": [ + "text template" + ], + "summary": "Fetch text template", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of text template", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TextTemplate" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "text template" + ], + "summary": "Update text template", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of text template", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TextTemplate" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TextTemplate" + } + }, + "400": { + "description": "Invalid text template" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "text template" + ], + "summary": "Delete text template", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of text template", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/attachments": { + "get": { + "tags": [ + "attachment" + ], + "summary": "Fetch attachments list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Attachments" + } + } + } + }, + "post": { + "tags": [ + "attachment" + ], + "summary": "Create attachment", + "consumes": [ + "multipart/form-data" + ], + "parameters": [ + { + "in": "formData", + "name": "file", + "required": true, + "type": "file" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Attachment" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/attachments/{id}": { + "get": { + "tags": [ + "attachment" + ], + "summary": "Fetch attachment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of attachment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Attachment" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "attachment" + ], + "summary": "Update attachment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of attachment", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Attachment" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Attachment" + } + }, + "400": { + "description": "Invalid attachment" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "attachment" + ], + "summary": "Delete attachment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of attachment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/attachments/{id}/content": { + "get": { + "tags": [ + "attachment" + ], + "summary": "Fetch attachment content", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of attachment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "type": "string", + "format": "binary" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/document-payments": { + "get": { + "tags": [ + "document payment" + ], + "summary": "Fetch document payments list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "document_id", + "description": "Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "payment_at", + "description": "Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "reference", + "description": "Filter payments by reference. You can add multiple references separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DocumentPayments" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "document payment" + ], + "summary": "Create document payment", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DocumentPayment" + } + }, + { + "in": "query", + "name": "paid", + "description": "Mark document as paid when amount less then payment amount.", + "required": false, + "type": "boolean" + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DocumentPayment" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/document-payments/{id}": { + "get": { + "tags": [ + "document payment" + ], + "summary": "Fetch document payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document payment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DocumentPayment" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "document payment" + ], + "summary": "Delete document payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document payment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/post-boxes": { + "get": { + "tags": [ + "post box" + ], + "summary": "Fetch post box list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "type", + "description": "Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.", + "required": false, + "type": "string", + "enum": [ + "EMAIL", + "FAX", + "POST" + ] + }, + { + "in": "query", + "name": "status", + "description": "Filter post boxes by status.", + "required": false, + "type": "string", + "enum": [ + "WAITING", + "PREPARE", + "ERROR", + "OK", + "PROCESSING" + ] + }, + { + "in": "query", + "name": "document_id", + "description": "Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PostBoxes" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/post-boxes/{id}": { + "get": { + "tags": [ + "post box" + ], + "summary": "Fetch post box", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of post box", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PostBox" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "post box" + ], + "summary": "Delete post box", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of post box", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/sepa-payments": { + "get": { + "tags": [ + "sepa payment" + ], + "summary": "Fetch SEPA payments list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "document_id", + "description": "Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SEPAPayments" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "sepa payment" + ], + "summary": "Create SEPA payment", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/sepa-payments/{id}": { + "get": { + "tags": [ + "sepa payment" + ], + "summary": "Fetch SEPA payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of SEPA payment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "sepa payment" + ], + "summary": "Update SEPA payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of SEPA payment", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + }, + "400": { + "description": "Invalid SEPA payment" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "sepa payment" + ], + "summary": "Delete SEPA payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of SPEA payment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/webhooks": { + "get": { + "tags": [ + "webhook" + ], + "summary": "Fetch WebHooks list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/WebHooks" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "webhook" + ], + "summary": "Create WebHook", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WebHook" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/WebHook" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/webhooks/{id}": { + "get": { + "tags": [ + "webhook" + ], + "summary": "Fetch WebHook", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of WebHook", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/WebHook" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "webhook" + ], + "summary": "Update WebHook", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of WebHook", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WebHook" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/WebHook" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "webhook" + ], + "summary": "Delete WebHook", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of WebHook", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/pdf-templates": { + "get": { + "tags": [ + "pdf templates" + ], + "summary": "Fetch PDF Templates list", + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PDFTemplates" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + } + }, + "definitions": { + "List": { + "type": "object", + "required": [ + "page", + "pages", + "limit", + "total" + ], + "properties": { + "page": { + "type": "integer", + "description": "The current page", + "example": 1 + }, + "pages": { + "type": "integer", + "description": "Max possible pages", + "example": 1 + }, + "limit": { + "type": "integer", + "description": "Items limitation. Max 1000", + "example": 100 + }, + "total": { + "type": "integer", + "description": "Total Items", + "example": 20 + } + } + }, + "Customer": { + "type": "object", + "required": [ + "last_name", + "company_name" + ], + "properties": { + "acquire_options": { + "type": "integer", + "description": "1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "x-nullable": true, + "example": null + }, + "additional_groups_ids": { + "type": "array", + "readOnly": true, + "example": [], + "items": { + "type": "integer", + "uniqueItems": true + } + }, + "bank_account": { + "type": "string", + "x-nullable": true, + "example": null + }, + "bank_account_owner": { + "type": "string", + "x-nullable": true, + "example": null + }, + "bank_bic": { + "type": "string", + "x-nullable": true, + "example": null + }, + "bank_code": { + "type": "string", + "x-nullable": true, + "example": null + }, + "bank_iban": { + "type": "string", + "x-nullable": true, + "example": null + }, + "bank_name": { + "type": "string", + "x-nullable": true, + "example": null + }, + "birth_date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2016-12-31" + }, + "cash_allowance": { + "type": "number", + "format": "float", + "x-nullable": true, + "example": null, + "minimum": 0, + "maximum": 100 + }, + "cash_allowance_days": { + "type": "integer", + "default": 7, + "example": 7 + }, + "cash_discount": { + "type": "number", + "format": "float", + "x-nullable": true, + "example": null + }, + "cash_discount_type": { + "type": "string", + "enum": [ + "PERCENT", + "AMOUNT" + ], + "x-nullable": true, + "example": null + }, + "city": { + "type": "string", + "x-nullable": true, + "example": "Kaarst" + }, + "state": { + "type": "string", + "example": "NRW" + }, + "company_name": { + "type": "string", + "example": "easybill GmbH", + "x-nullable": true + }, + "country": { + "type": "string", + "example": "DE" + }, + "created_at": { + "type": "string", + "format": "date", + "readOnly": true + }, + "updated_at": { + "type": "string", + "format": "datetime", + "readOnly": true + }, + "delivery_title": { + "type": "string", + "example": "Dr." + }, + "delivery_city": { + "type": "string", + "x-nullable": true, + "example": null + }, + "delivery_state": { + "type": "string", + "example": "NRW" + }, + "delivery_company_name": { + "type": "string", + "x-nullable": true, + "example": null + }, + "delivery_country": { + "type": "string", + "x-nullable": true, + "example": null + }, + "delivery_first_name": { + "type": "string", + "x-nullable": true, + "example": null + }, + "delivery_last_name": { + "type": "string", + "x-nullable": true, + "example": null + }, + "delivery_personal": { + "type": "boolean", + "example": false + }, + "delivery_salutation": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "default": 0, + "description": "0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family" + }, + "delivery_street": { + "type": "string", + "x-nullable": true, + "example": null + }, + "delivery_suffix_1": { + "type": "string", + "x-nullable": true, + "example": null + }, + "delivery_suffix_2": { + "type": "string", + "x-nullable": true, + "example": null + }, + "delivery_zip_code": { + "type": "string", + "x-nullable": true, + "example": null + }, + "display_name": { + "type": "string", + "readOnly": true + }, + "emails": { + "type": "array", + "items": { + "type": "string", + "maxItems": 3, + "uniqueItems": true + }, + "example": [ + "max.mustermann@easybill.de" + ] + }, + "fax": { + "type": "string", + "example": "+49 2154 89701 29", + "x-nullable": true + }, + "first_name": { + "type": "string", + "example": "Max", + "x-nullable": true + }, + "grace_period": { + "type": "integer", + "description": "will be replaced by its alias due_in_days.", + "x-nullable": true, + "example": null + }, + "due_in_days": { + "type": "integer", + "description": "due date in days", + "x-nullable": true, + "example": null + }, + "group_id": { + "type": "integer", + "x-nullable": true, + "example": null + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "info_1": { + "type": "string", + "x-nullable": true, + "example": null + }, + "info_2": { + "type": "string", + "x-nullable": true, + "example": null + }, + "internet": { + "type": "string", + "x-nullable": true, + "example": "https://www.easybill.de" + }, + "last_name": { + "type": "string", + "example": "Mustermann", + "x-nullable": true + }, + "login_id": { + "type": "integer", + "format": "int64" + }, + "mobile": { + "type": "string", + "example": null, + "x-nullable": true + }, + "note": { + "type": "string", + "example": null, + "x-nullable": true + }, + "number": { + "type": "string", + "description": "Automatically generated if empty." + }, + "payment_options": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 5 + ], + "description": "1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung", + "example": null, + "x-nullable": true + }, + "personal": { + "type": "boolean", + "example": false, + "default": false + }, + "phone_1": { + "type": "string", + "example": "+49 2154 89701 20", + "x-nullable": true + }, + "phone_2": { + "type": "string", + "example": null, + "x-nullable": true + }, + "postbox": { + "type": "string", + "example": null, + "x-nullable": true + }, + "postbox_city": { + "type": "string", + "example": null, + "x-nullable": true + }, + "postbox_state": { + "type": "string", + "example": "NRW" + }, + "postbox_country": { + "type": "string", + "example": null, + "x-nullable": true + }, + "postbox_zip_code": { + "type": "string", + "example": null, + "x-nullable": true + }, + "sale_price_level": { + "type": "string", + "example": null, + "x-nullable": true, + "enum": [ + "SALEPRICE2", + "SALEPRICE3", + "SALEPRICE4", + "SALEPRICE5", + "SALEPRICE6", + "SALEPRICE7", + "SALEPRICE8", + "SALEPRICE9", + "SALEPRICE10" + ] + }, + "salutation": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "default": 0, + "description": "0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family" + }, + "sepa_agreement": { + "type": "string", + "enum": [ + "BASIC", + "COR1", + "COMPANY", + "NULL" + ], + "description": "BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1, COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt", + "example": null, + "x-nullable": true + }, + "sepa_agreement_date": { + "type": "string", + "format": "date", + "example": null, + "x-nullable": true + }, + "sepa_mandate_reference": { + "type": "string", + "example": null, + "x-nullable": true + }, + "since_date": { + "type": "string", + "format": "date", + "example": null, + "x-nullable": true + }, + "street": { + "type": "string", + "example": "Düsselstr. 21", + "x-nullable": true + }, + "suffix_1": { + "type": "string", + "example": null, + "x-nullable": true + }, + "suffix_2": { + "type": "string", + "example": null, + "x-nullable": true + }, + "tax_number": { + "type": "string", + "example": null, + "x-nullable": true + }, + "court": { + "type": "string", + "example": "Berlin", + "x-nullable": true + }, + "court_registry_number": { + "type": "string", + "example": "HRB XXXXX X", + "x-nullable": true + }, + "tax_options": { + "type": "string", + "enum": [ + "nStb", + "nStbUstID", + "nStbNoneUstID", + "nStbIm", + "revc", + "IG", + "AL", + "sStfr", + "NULL" + ], + "description": "nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig", + "example": null, + "x-nullable": true + }, + "title": { + "type": "string", + "example": null, + "x-nullable": true + }, + "vat_identifier": { + "type": "string", + "example": "DE814878557", + "x-nullable": true + }, + "zip_code": { + "type": "string", + "x-nullable": true, + "example": "41564" + }, + "documentPdfType": { + "type": "string", + "enum": [ + "default", + "zugferd1", + "zugferd2", + "xrechnung", + "xrechnung_xml" + ], + "default": "default", + "description": "Type of PDF to use when sending a Document to the Customer." + }, + "buyer_reference": { + "type": "string", + "description": "Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format." + }, + "foreign_supplier_number": { + "type": "string", + "description": "The ID given to your company by the customer in his system." + } + } + }, + "CustomerSnapshot": { + "type": "object", + "description": "A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state.", + "allOf": [ + { + "$ref": "#/definitions/Customer" + } + ] + }, + "Customers": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Customer" + } + } + } + } + ] + }, + "Contact": { + "type": "object", + "required": [ + "city", + "street" + ], + "properties": { + "city": { + "type": "string", + "example": "Musterstadt" + }, + "state": { + "type": "string", + "example": "NRW" + }, + "company_name": { + "type": "string", + "example": null, + "x-nullable": true + }, + "country": { + "type": "string", + "description": "Two-letter country code", + "example": "DE" + }, + "department": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Accounting" + }, + "emails": { + "type": "array", + "default": [], + "items": { + "type": "string", + "maxItems": 3, + "uniqueItems": true, + "example": "mustermann@easybill.de" + } + }, + "fax": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "first_name": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Max" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "last_name": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Mustermann" + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "mobile": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "note": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "personal": { + "type": "boolean", + "default": false + }, + "phone_1": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "phone_2": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "salutation": { + "type": "integer", + "description": "0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie" + }, + "street": { + "type": "string", + "example": "Musterstr." + }, + "suffix_1": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "suffix_2": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "title": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "zip_code": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "created_at": { + "type": "string", + "format": "datetime", + "readOnly": true, + "example": "2018-01-01 23:23:45" + }, + "updated_at": { + "type": "string", + "format": "datetime", + "readOnly": true, + "example": "2018-01-01 23:23:45" + } + } + }, + "Contacts": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Contact" + } + } + } + } + ] + }, + "DocumentPosition": { + "type": "object", + "properties": { + "number": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "description": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "document_note": { + "type": "string", + "example": "Test Note", + "description": "This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction." + }, + "quantity": { + "type": "number", + "maxLength": 10, + "format": "float", + "default": 1, + "example": 1 + }, + "quantity_str": { + "type": "string", + "maxLength": 10, + "description": "Use quantity_str if you want to set a quantity like: 1:30 h or 3x5 m. quantity_str overwrites quantity.", + "example": null + }, + "unit": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "type": { + "type": "string", + "enum": [ + "POSITION", + "POSITION_NOCALC", + "TEXT" + ], + "default": "POSITION" + }, + "position": { + "type": "integer", + "description": "Automatic by default (first item: 1, second item: 2, ...)", + "example": null + }, + "single_price_net": { + "type": "number", + "format": "float", + "x-nullable": true, + "default": null, + "example": null + }, + "single_price_gross": { + "type": "number", + "format": "float", + "readOnly": true + }, + "vat_percent": { + "type": "number", + "format": "float", + "default": 0, + "example": 0 + }, + "discount": { + "type": "number", + "format": "float", + "x-nullable": true, + "default": null, + "example": null + }, + "discount_type": { + "type": "string", + "enum": [ + "PERCENT", + "AMOUNT" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "position_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "description": "If set, values are copied from the referenced position", + "example": null + }, + "total_price_net": { + "type": "number", + "format": "float", + "readOnly": true + }, + "total_price_gross": { + "type": "number", + "format": "float", + "readOnly": true + }, + "total_vat": { + "type": "number", + "format": "float", + "readOnly": true + }, + "serial_number_id": { + "type": "string", + "readOnly": true, + "example": null + }, + "serial_number": { + "type": "string", + "readOnly": true, + "example": null + }, + "booking_account": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "export_cost_1": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "export_cost_2": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "cost_price_net": { + "type": "number", + "format": "float", + "x-nullable": true, + "default": null, + "example": null + }, + "cost_price_total": { + "type": "number", + "format": "float", + "readOnly": true, + "example": null + }, + "cost_price_charge": { + "type": "number", + "format": "float", + "readOnly": true, + "example": null + }, + "cost_price_charge_type": { + "type": "string", + "readOnly": true, + "example": null, + "enum": [ + "PERCENT", + "AMOUNT" + ] + }, + "itemType": { + "type": "string", + "enum": [ + "PRODUCT", + "SERVICE", + "UNDEFINED" + ], + "default": "UNDEFINED" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + } + } + }, + "DocumentAddress": { + "type": "object", + "properties": { + "salutation": { + "readOnly": true, + "type": "integer", + "description": "0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie" + }, + "personal": { + "readOnly": true, + "type": "boolean", + "example": false + }, + "title": { + "readOnly": true, + "type": "string", + "example": null + }, + "first_name": { + "readOnly": true, + "type": "string", + "example": "Max" + }, + "last_name": { + "readOnly": true, + "type": "string", + "example": "Mustermann" + }, + "suffix_1": { + "readOnly": true, + "type": "string", + "example": null + }, + "suffix_2": { + "readOnly": true, + "type": "string", + "example": null + }, + "company_name": { + "readOnly": true, + "type": "string", + "example": null + }, + "street": { + "readOnly": true, + "type": "string", + "example": "Musterstr." + }, + "zip_code": { + "readOnly": true, + "type": "string", + "example": null + }, + "city": { + "readOnly": true, + "type": "string", + "example": "Musterstadt" + }, + "state": { + "readOnly": true, + "type": "string", + "example": "NRW" + }, + "country": { + "readOnly": true, + "type": "string", + "example": "DE" + } + } + }, + "DocumentRecurring": { + "type": "object", + "required": [ + "next_date" + ], + "properties": { + "next_date": { + "type": "string", + "format": "date", + "description": "Must be in the future", + "example": "2020-02-01" + }, + "frequency": { + "type": "string", + "enum": [ + "DAILY", + "WEEKLY", + "MONTHLY", + "YEARLY" + ], + "default": "MONTHLY" + }, + "frequency_special": { + "type": "string", + "enum": [ + "LASTDAYOFMONTH" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "interval": { + "type": "integer", + "default": 1, + "example": 1 + }, + "end_date_or_count": { + "type": "string", + "description": "Date of last exectution day or number of times to exectute", + "x-nullable": true, + "default": null, + "example": null + }, + "status": { + "type": "string", + "enum": [ + "RUNNING", + "PAUSE", + "STOP", + "WAITING" + ], + "default": "WAITING" + }, + "as_draft": { + "type": "boolean", + "default": false + }, + "is_notify": { + "type": "boolean", + "default": false + }, + "send_as": { + "type": "string", + "enum": [ + "EMAIL", + "FAX", + "POST" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "is_sign": { + "type": "boolean", + "default": false + }, + "is_paid": { + "type": "boolean", + "default": false + }, + "paid_date_option": { + "type": "string", + "description": "Option is used to determine what date is used for the payment if is_paid is true. \"next_valid_date\" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday.", + "default": "created_date", + "enum": [ + "created_date", + "due_date", + "next_valid_date" + ] + }, + "is_sepa": { + "type": "boolean", + "default": false + }, + "sepa_local_instrument": { + "type": "string", + "enum": [ + "CORE", + "COR1", + "B2B" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "sepa_sequence_type": { + "type": "string", + "enum": [ + "FRST", + "OOFF", + "FNAL", + "RCUR" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "sepa_reference": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "sepa_remittance_information": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "target_type": { + "type": "string", + "enum": [ + "INVOICE", + "CREDIT", + "ORDER", + "OFFER" + ], + "default": "INVOICE", + "description": "The document type that will be generated. Can not be changed on existing documents." + } + } + }, + "ServiceDate": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "DEFAULT", + "SERVICE", + "DELIVERY" + ], + "description": "With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.
For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text." + }, + "date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2019-02-01" + }, + "date_from": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": null + }, + "date_to": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": null + }, + "text": { + "type": "string", + "default": null, + "x-nullable": true, + "example": null + } + } + }, + "Document": { + "type": "object", + "properties": { + "address": { + "readOnly": true, + "description": "This information comes from the customer which can be set with customer_id.", + "$ref": "#/definitions/DocumentAddress" + }, + "attachment_ids": { + "type": "array", + "readOnly": true, + "example": [], + "items": { + "type": "integer", + "uniqueItems": true + } + }, + "label_address": { + "readOnly": true, + "description": "This information comes from the customer which can be set with customer_id.", + "$ref": "#/definitions/DocumentAddress" + }, + "amount": { + "readOnly": true, + "type": "integer", + "description": "Amount in cents (e.g. \"150\" = 1.50€)" + }, + "amount_net": { + "readOnly": true, + "type": "integer", + "description": "Amount in cents (e.g. \"150\" = 1.50€)" + }, + "bank_debit_form": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "billing_country": { + "type": "string", + "readOnly": true, + "example": null + }, + "calc_vat_from": { + "type": "integer", + "enum": [ + 0, + 1 + ], + "description": "0 === Net, 1 === Gross.", + "default": 0, + "example": 0 + }, + "cancel_id": { + "type": "integer", + "format": "int64", + "description": "ID from the cancel document. Only for document type INVOICE.", + "readOnly": true, + "example": null + }, + "cash_allowance": { + "type": "number", + "format": "float", + "x-nullable": true, + "default": null, + "example": null + }, + "cash_allowance_days": { + "type": "integer", + "x-nullable": true, + "default": null, + "example": null + }, + "cash_allowance_text": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "contact_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "contact_label": { + "type": "string", + "default": "", + "example": "" + }, + "contact_text": { + "type": "string", + "default": "", + "example": "" + }, + "created_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "example": "2019-02-01 11:16:52" + }, + "currency": { + "type": "string", + "default": "EUR", + "example": "EUR" + }, + "customer_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "customer_snapshot": { + "readOnly": true, + "$ref": "#/definitions/CustomerSnapshot" + }, + "discount": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "discount_type": { + "type": "string", + "enum": [ + "PERCENT", + "AMOUNT" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "document_date": { + "type": "string", + "format": "date", + "example": "2019-02-07" + }, + "due_date": { + "type": "string", + "format": "date", + "readOnly": true, + "description": "To change the value use grace_period.", + "example": null + }, + "edited_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "example": "2019-02-07 11:54:10" + }, + "external_id": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "replica_url": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "grace_period": { + "type": "integer", + "description": "will be replaced by its alias due_in_days.", + "x-nullable": true, + "example": null + }, + "due_in_days": { + "type": "integer", + "description": "due date in days.", + "x-nullable": true, + "example": null + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "is_archive": { + "type": "boolean", + "default": false, + "example": false + }, + "is_draft": { + "type": "boolean", + "readOnly": true, + "description": "This property is read only. To finish the document call /documents/{id}/done.", + "example": true + }, + "is_replica": { + "type": "boolean", + "description": "Marks a document as a replica from another software.", + "default": false, + "example": false + }, + "is_cold": { + "type": "boolean", + "description": "Indicates if a document is in the long term archive", + "default": false, + "example": false, + "readOnly": true + }, + "is_oss": { + "type": "boolean", + "description": "Indicates if a document is a one-stop-shop document", + "default": false, + "example": false + }, + "coldstorage_due_date": { + "type": "string", + "format": "date", + "description": "Signals when the document should be moved to the long term archive", + "example": "2019-02-07", + "x-nullable": true + }, + "item_notes": { + "description": "Field holds all unique document_note of items for the document", + "type": "array", + "readOnly": true, + "items": { + "type": "string" + } + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DocumentPosition" + } + }, + "last_postbox_id": { + "type": "integer", + "format": "int64", + "readOnly": true, + "example": null + }, + "login_id": { + "type": "integer", + "format": "int64", + "example": null, + "description": "If omitted or null, the currently active login is used." + }, + "number": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "order_number": { + "type": "string", + "default": "" + }, + "buyer_reference": { + "type": "string", + "default": "" + }, + "paid_amount": { + "type": "integer", + "readOnly": true + }, + "paid_at": { + "type": "string", + "format": "date", + "readOnly": true, + "example": null + }, + "pdf_pages": { + "type": "integer", + "readOnly": true + }, + "pdf_template": { + "type": "string", + "description": "Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID.", + "example": null + }, + "project_id": { + "type": "integer", + "x-nullable": true, + "default": null, + "example": null + }, + "recurring_options": { + "description": "This object is only available in document type RECURRING", + "$ref": "#/definitions/DocumentRecurring" + }, + "ref_id": { + "type": "integer", + "format": "int64", + "description": "Reference document id", + "x-nullable": true, + "default": null, + "example": null + }, + "service_date": { + "description": "This object is only available in document type INVOICE or CREDIT.", + "$ref": "#/definitions/ServiceDate" + }, + "shipping_country": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "status": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null, + "description": "This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set.", + "enum": [ + "ACCEPT", + "DONE", + "DROPSHIPPING", + "CANCEL" + ] + }, + "text": { + "type": "string", + "example": "Vielen Dank für Ihren Auftrag!\n\nBitte begleichen Sie den offenen Betrag bis zum %DOKUMENT.DATUM-FAELLIG%.\n\nMit freundlichen Grüßen\n\n%FIRMA.FIRMA%\n" + }, + "text_prefix": { + "type": "string", + "example": "%KUNDE.ANREDE%,\nnachfolgend berechnen wir Ihnen wie vorab besprochen:\n" + }, + "text_tax": { + "type": "string", + "x-nullable": true, + "default": null, + "description": "Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null" + }, + "title": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Invoice for Order #001" + }, + "type": { + "type": "string", + "enum": [ + "INVOICE", + "RECURRING", + "CREDIT", + "OFFER", + "REMINDER", + "DUNNING", + "STORNO", + "STORNO_CREDIT", + "DELIVERY", + "PDF", + "CHARGE", + "CHARGE_CONFIRM", + "LETTER", + "ORDER", + "PROFORMA_INVOICE", + "STORNO_PROFORMA_INVOICE" + ], + "description": "Can only set on create.", + "default": "INVOICE" + }, + "use_shipping_address": { + "type": "boolean", + "description": "If true and customer has shipping address then it will be used.", + "default": false, + "example": false + }, + "vat_country": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "vat_id": { + "type": "string", + "readOnly": true, + "default": "", + "example": "DE999999999" + }, + "fulfillment_country": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "vat_option": { + "type": "string", + "enum": [ + "NULL", + "nStb", + "nStbUstID", + "nStbNoneUstID", + "nStbIm", + "revc", + "IG", + "AL", + "sStfr", + "smallBusiness" + ], + "description": "NULL: Normal steuerbar
nStb: Nicht steuerbar (Drittland)
nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)
nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)
nStbIm: Nicht steuerbarer Innenumsatz
revc: Steuerschuldwechsel §13b (Inland)
IG: Innergemeinschaftliche Lieferung
AL: Ausfuhrlieferung
sStfr: sonstige Steuerbefreiung
smallBusiness: Kleinunternehmen (Keine MwSt.)", + "x-nullable": true, + "default": null, + "example": null + } + } + }, + "Documents": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Document" + } + } + } + } + ] + }, + "CustomerGroup": { + "type": "object", + "required": [ + "number", + "name" + ], + "properties": { + "name": { + "type": "string", + "example": "Important Customers" + }, + "description": { + "type": "string", + "example": "Our most important customers", + "x-nullable": true, + "default": null + }, + "number": { + "type": "string", + "example": "001", + "description": "Can be chosen freely" + }, + "display_name": { + "type": "string", + "readOnly": true, + "example": "001 - Important Customers" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + } + } + }, + "CustomerGroups": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomerGroup" + } + } + } + } + ] + }, + "Task": { + "type": "object", + "required": [ + "name", + "status" + ], + "properties": { + "category": { + "type": "string", + "enum": [ + "CALL", + "EMAIL", + "FAX", + "LUNCH", + "MEETING", + "TRAVEL", + "CUSTOM" + ], + "x-nullable": true, + "default": null + }, + "category_custom": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null, + "description": "The name of your custom category. Can only have a value if \"category\" is \"CUSTOM\"." + }, + "created_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "customer_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "description": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "document_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "end_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": null, + "description": "The deadline" + }, + "finish_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "x-nullable": true, + "example": null, + "description": "The time when the task was marked as done" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "login_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "example": null, + "description": "When omitted or null, the currently active login is used" + }, + "name": { + "type": "string", + "example": "Call client" + }, + "position_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "priority": { + "type": "string", + "enum": [ + "LOW", + "NORMAL", + "HIGH" + ], + "default": "NORMAL" + }, + "project_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "start_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "example": null + }, + "status": { + "type": "string", + "enum": [ + "WAITING", + "PROCESSING", + "DONE", + "CANCEL" + ], + "example": "PROCESSING" + }, + "status_percent": { + "type": "integer", + "x-nullable": true, + "default": null, + "example": 50 + } + } + }, + "Tasks": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Task" + } + } + } + } + ] + }, + "Project": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "budget_amount": { + "type": "integer", + "description": "Project budget in cents (e.g. \"150\" = 1.50€)", + "default": 0, + "example": 10000 + }, + "budget_time": { + "type": "integer", + "description": "Time budget in minutes (e.g. \"90\" = 1 hour and 30 minutes)", + "default": 0, + "example": 60 + }, + "customer_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null + }, + "hourly_rate": { + "type": "number", + "format": "float", + "description": "Hourly rate in cents (e.g. \"150\" = 1.50€)", + "example": 3000 + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "login_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "example": null, + "description": "If omitted or null, the currently active login is used" + }, + "name": { + "type": "string", + "example": "My Project" + }, + "note": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "status": { + "type": "string", + "enum": [ + "OPEN", + "DONE", + "CANCEL" + ], + "default": "OPEN" + }, + "due_at": { + "type": "string", + "format": "date", + "x-nullable": true, + "default": null, + "example": null + }, + "budget_notify_frequency": { + "type": "string", + "enum": [ + "ALWAYS", + "ONCE", + "NEVER" + ], + "default": "ALWAYS" + }, + "consumed_time": { + "type": "integer", + "readOnly": true + }, + "consumed_amount": { + "type": "integer", + "readOnly": true + } + } + }, + "Projects": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Project" + } + } + } + } + ] + }, + "Position": { + "type": "object", + "required": [ + "number", + "description", + "sale_price" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "type": { + "type": "string", + "enum": [ + "PRODUCT", + "SERVICE", + "TEXT" + ], + "default": "PRODUCT" + }, + "number": { + "type": "string", + "example": 1234 + }, + "description": { + "type": "string", + "example": "iPhone X", + "description": "The positions name or description" + }, + "document_note": { + "type": "string", + "example": "Test Note", + "description": "This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction." + }, + "note": { + "type": "string", + "example": null, + "description": "Note for internal use", + "x-nullable": true, + "default": null + }, + "unit": { + "type": "string", + "example": null, + "x-nullable": true, + "default": null + }, + "export_identifier": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "8400", + "description": "The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant." + }, + "export_identifier_extended": { + "type": "object", + "default": [], + "properties": { + "NULL": { + "example": "8400", + "description": "Umsatzsteuerpflichtig", + "x-nullable": true, + "default": null + }, + "nStb": { + "example": "8338", + "description": "Nicht steuerbar (Drittland)", + "x-nullable": true, + "default": null + }, + "nStbUstID": { + "example": "8339", + "description": "Nicht steuerbar (EU mit USt-IdNr.)", + "x-nullable": true, + "default": null + }, + "nStbNoneUstID": { + "example": "8950", + "description": "Nicht steuerbar (EU ohne USt-IdNr.)", + "x-nullable": true, + "default": null + }, + "nStbIm": { + "example": "8950", + "description": "Nicht steuerbarer Innenumsatz", + "x-nullable": true, + "default": null + }, + "revc": { + "example": "8337", + "description": "Steuerschuldwechsel §13b (Inland)", + "x-nullable": true, + "default": null + }, + "IG": { + "example": "8125", + "description": "Innergemeinschaftliche Lieferung", + "x-nullable": true, + "default": null + }, + "AL": { + "example": "8120", + "description": "Ausfuhrlieferung", + "x-nullable": true, + "default": null + }, + "sStfr": { + "example": "8100", + "description": "sonstige Steuerbefreiung", + "x-nullable": true, + "default": null + }, + "smallBusiness": { + "example": "8195", + "description": "Kleinunternehmen (Keine MwSt.)", + "x-nullable": true, + "default": null + } + } + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "price_type": { + "type": "string", + "enum": [ + "BRUTTO", + "NETTO" + ], + "default": "NETTO" + }, + "vat_percent": { + "type": "number", + "format": "float", + "default": 19, + "example": 19 + }, + "sale_price": { + "type": "number", + "format": "float", + "example": 1250, + "description": "Price in cents (e.g. \"150\" = 1.50€)" + }, + "sale_price2": { + "type": "number", + "format": "float", + "description": "Price for customers of group 2 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price3": { + "type": "number", + "format": "float", + "description": "Price for customers of group 3 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price4": { + "type": "number", + "format": "float", + "description": "Price for customers of group 4 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price5": { + "type": "number", + "format": "float", + "description": "Price for customers of group 5 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price6": { + "type": "number", + "format": "float", + "description": "Price for customers of group 6 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price7": { + "type": "number", + "format": "float", + "description": "Price for customers of group 7 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price8": { + "type": "number", + "format": "float", + "description": "Price for customers of group 8 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price9": { + "type": "number", + "format": "float", + "description": "Price for customers of group 9 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price10": { + "type": "number", + "format": "float", + "description": "Price for customers of group 10 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "cost_price": { + "type": "number", + "format": "float", + "example": 830, + "x-nullable": true, + "description": "Price in cents (e.g. \"150\" = 1.50€)" + }, + "export_cost1": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "export_cost2": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "group_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "example": null + }, + "stock": { + "type": "string", + "enum": [ + "YES", + "NO" + ], + "description": "Activates stock management for this position", + "default": "NO" + }, + "stock_count": { + "type": "integer", + "example": 100, + "default": 0, + "description": "Current stock count", + "readOnly": true + }, + "stock_limit_notify": { + "type": "boolean", + "default": false, + "description": "Notify when stock_count is lower than stock_limit" + }, + "stock_limit_notify_frequency": { + "type": "string", + "enum": [ + "ALWAYS", + "ONCE" + ], + "default": "ALWAYS", + "description": "Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE)" + }, + "stock_limit": { + "type": "integer", + "example": 50, + "default": 0 + }, + "quantity": { + "type": "number", + "format": "float", + "description": "Used as the default quantity when adding this position to a document", + "example": 10, + "x-nullable": true, + "default": null + } + } + }, + "Positions": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Position" + } + } + } + } + ] + }, + "PositionGroup": { + "type": "object", + "required": [ + "number", + "name" + ], + "properties": { + "description": { + "type": "string", + "example": null, + "x-nullable": true, + "default": null + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "name": { + "type": "string", + "example": "Mobile Phones" + }, + "number": { + "type": "string", + "example": "001" + }, + "display_name": { + "type": "string", + "readOnly": true, + "example": "001 - Mobile Phones" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + } + } + }, + "PositionGroups": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/PositionGroup" + } + } + } + } + ] + }, + "TimeTracking": { + "type": "object", + "required": [ + "description" + ], + "properties": { + "cleared_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "example": null + }, + "created_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "date_from_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "example": "2019-02-05 11:30:00" + }, + "date_thru_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "example": "2019-02-05 13:00:00" + }, + "description": { + "type": "string", + "example": "Meeting with client" + }, + "hourly_rate": { + "type": "number", + "format": "float", + "default": 0, + "description": "Hourly rate in cents (e.g. \"150\" = 1.50€)", + "example": 2000 + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "note": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "number": { + "type": "string", + "x-nullable": true, + "example": "001", + "description": "Can be chosen freely" + }, + "position_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "project_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "login_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "description": "If omitted or null, the currently active login is used.", + "example": null + }, + "timer_value": { + "type": "integer", + "x-nullable": true, + "default": null, + "description": "Tracked time in minutes", + "example": 90 + } + } + }, + "TimeTrackings": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeTracking" + } + } + } + } + ] + }, + "TextTemplate": { + "type": "object", + "required": [ + "title", + "text" + ], + "properties": { + "can_modify": { + "type": "boolean", + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "text": { + "type": "string", + "example": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." + }, + "title": { + "type": "string", + "example": "Lorem Ipsum" + } + } + }, + "TextTemplates": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/TextTemplate" + } + } + } + } + ] + }, + "Attachment": { + "type": "object", + "description": "If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination).", + "properties": { + "created_at": { + "type": "string", + "format": "date", + "readOnly": true + }, + "customer_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "document_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "file_name": { + "type": "string", + "example": "my_doc.pdf", + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "project_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "size": { + "type": "integer", + "example": 10022, + "description": "In byte", + "readOnly": true + } + } + }, + "Attachments": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" + } + } + } + } + ] + }, + "DocumentPayment": { + "type": "object", + "required": [ + "document_id", + "amount" + ], + "properties": { + "amount": { + "type": "integer", + "format": "int32" + }, + "document_id": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "is_overdue_fee": { + "type": "boolean" + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "notice": { + "type": "string", + "default": "" + }, + "payment_at": { + "type": "string", + "format": "date" + }, + "type": { + "type": "string", + "maxLength": 255, + "default": "" + }, + "provider": { + "type": "string", + "maxLength": 255, + "default": "" + }, + "reference": { + "type": "string", + "maxLength": 255, + "default": "" + } + }, + "example": { + "id": 1, + "document_id": 1, + "login_id": 1, + "amount": 1000, + "payment_at": "2007-09-17T00:00:00.000Z", + "type": "VISA", + "provider": "Stripe", + "reference": "111111-VISA-222222-6666" + } + }, + "DocumentPayments": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DocumentPayment" + } + } + } + } + ] + }, + "PostBoxRequest": { + "type": "object", + "properties": { + "to": { + "type": "string" + }, + "cc": { + "type": "string" + }, + "from": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "message": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date" + }, + "document_file_type": { + "type": "string", + "enum": [ + "default", + "zugferd1", + "zugferd2", + "xrechnung", + "xrechnung_xml" + ], + "x-nullable": true, + "description": "When set to null, the setting on the customer is used" + }, + "post_send_type": { + "type": "string", + "example": "post_send_type_standard", + "description": "This value indicates what method is used when the document is send via mail.\nThe different types are offered by the german post as additional services.\nThe registered mail options will include a tracking number which will be \nadded to the postbox when known.\n\nIf the value is omitted or empty when a postbox is created with the type \"POST\"\npost_send_type_standard will be used.\n\nFor postbox with a different type than \"POST\" this field will hold a empty string.\n", + "enum": [ + "post_send_type_standard", + "post_send_type_registered", + "post_send_type_registered_and_personal", + "post_send_type_registered_and_receipt", + "post_send_type_registered_throwin", + "post_send_type_prio" + ] + } + } + }, + "PostBox": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "document_id": { + "type": "integer", + "format": "int64" + }, + "to": { + "type": "string", + "example": "example@easybill.de" + }, + "cc": { + "type": "string", + "example": null + }, + "from": { + "type": "string", + "example": "example@easybill.de" + }, + "subject": { + "type": "string", + "example": "Invoice" + }, + "message": { + "type": "string", + "example": "Dear Mr. ..." + }, + "date": { + "type": "string", + "format": "date", + "example": "2019-02-07" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2019-02-07 11:29:28" + }, + "processed_at": { + "type": "string", + "format": "date-time", + "example": null + }, + "send_by_self": { + "type": "boolean", + "example": false + }, + "send_with_attachment": { + "type": "boolean", + "example": true + }, + "type": { + "type": "string", + "enum": [ + "FAX", + "EMAIL", + "POST" + ], + "example": "EMAIL" + }, + "status": { + "type": "string", + "enum": [ + "WAITING", + "PREPARE", + "ERROR", + "OK", + "PROCESSING" + ] + }, + "status_msg": { + "type": "string", + "example": null + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "document_file_type": { + "type": "string", + "enum": [ + "default", + "zugferd1", + "zugferd2", + "xrechnung", + "xrechnung_xml" + ], + "x-nullable": true + }, + "post_send_type": { + "type": "string", + "example": "post_send_type_standard", + "description": "This value indicates what method is used when the document is send via mail.\nThe different types are offered by the german post as additional services.\nThe registered mail options will include a tracking number which will be \nadded to the postbox when known.\n\nIf the value is omitted or empty when a postbox is created with the type \"POST\"\npost_send_type_standard will be used.\n\nFor postbox with a different type than \"POST\" this field will hold a empty string.\n", + "enum": [ + "post_send_type_standard", + "post_send_type_registered", + "post_send_type_registered_and_personal", + "post_send_type_registered_and_receipt", + "post_send_type_registered_throwin", + "post_send_type_prio" + ] + }, + "tracking_identifier": { + "readOnly": true, + "type": "string", + "example": "DE1234567890", + "description": "If the document is send with one of the registered send types stated for post_send_type, a tracking identifier\nwill be added to the postbox at a later point when the tracking identifier is provided\nby our service partner. \n" + } + } + }, + "PostBoxes": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/PostBox" + } + } + } + } + ] + }, + "SEPAPayment": { + "type": "object", + "required": [ + "document_id", + "debitor_name", + "debitor_iban", + "mandate_id", + "mandate_date_of_signature", + "local_instrument", + "sequence_type", + "amount", + "reference" + ], + "properties": { + "amount": { + "type": "integer", + "description": "Amount in cents (e.g. \"150\" = 1.50€)", + "example": 10000 + }, + "created_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "creditor_bic": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null, + "description": "If type is DEBIT, this field is overwritten with the selected bank account data on export." + }, + "creditor_iban": { + "type": "string", + "x-nullable": true, + "example": "DE12345678901234567890", + "description": "Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export." + }, + "creditor_name": { + "type": "string", + "x-nullable": true, + "example": "Easybill GmbH", + "description": "Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export." + }, + "debitor_bic": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null, + "description": "If type is CREDIT, this field is overwritten with the selected bank account data on export." + }, + "debitor_iban": { + "type": "string", + "x-nullable": true, + "example": "DE12345678901234567890", + "description": "Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export." + }, + "debitor_name": { + "type": "string", + "x-nullable": true, + "example": "Easybill GmbH", + "description": "Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export." + }, + "debitor_address_line_1": { + "type": "string", + "maxLength": 70, + "example": "Bahnhofstr. 1", + "description": "Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA" + }, + "debitor_address_line2": { + "type": "string", + "maxLength": 70, + "example": "8001 Zürich", + "description": "string" + }, + "debitor_country": { + "type": "string", + "maxLength": 2, + "example": "CH", + "description": "Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA" + }, + "document_id": { + "type": "integer", + "format": "int64" + }, + "export_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "description": "If a date is set, this record is marked as exported", + "example": null + }, + "export_error": { + "type": "string", + "example": null, + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "local_instrument": { + "type": "string", + "enum": [ + "CORE", + "COR1", + "B2B" + ], + "description": "CORE: SEPA Core Direct Debit
COR1: SEPA-Basislastschrift COR1
B2B: SEPA Business to Business Direct Debit" + }, + "mandate_date_of_signature": { + "type": "string", + "format": "date", + "example": "2019-02-01" + }, + "mandate_id": { + "type": "string", + "maxLength": 34, + "example": "001" + }, + "reference": { + "type": "string", + "maxLength": 35, + "example": "X000000001" + }, + "remittance_information": { + "type": "string", + "maxLength": 140, + "x-nullable": true, + "default": null, + "example": null + }, + "requested_at": { + "type": "string", + "format": "date", + "default": "Today's date", + "description": "Booking date" + }, + "sequence_type": { + "type": "string", + "enum": [ + "FRST", + "OOFF", + "FNAL", + "RCUR" + ], + "description": "FRST: Erstlastschrift
RCUR: Folgelastschrift
OOFF: Einmallastschrift
FNAL: Letztmalige Lastschrift" + }, + "updated_at": { + "example": "2018-01-01 23:23:45", + "type": "string", + "format": "datetime", + "readOnly": true + }, + "type": { + "type": "string", + "enum": [ + "DEBIT", + "CREDIT" + ], + "default": "DEBIT" + } + } + }, + "SEPAPayments": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/SEPAPayment" + } + } + } + } + ] + }, + "WebHook": { + "type": "object", + "required": [ + "url", + "content_type", + "secret", + "events", + "description" + ], + "properties": { + "content_type": { + "type": "string", + "enum": [ + "form", + "json" + ] + }, + "description": { + "type": "string", + "example": "My Webhook" + }, + "events": { + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "enum": [ + "document.create", + "document.update", + "document.completed", + "document.deleted", + "document.payment_add", + "document.payment_delete", + "customer.create", + "customer.update", + "customer.delete", + "contact.create", + "contact.update", + "contact.delete", + "position.create", + "position.update", + "position.delete", + "postbox.create", + "postbox.update", + "postbox.delete", + "postbox.sent" + ] + } + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "is_active": { + "type": "boolean", + "default": false + }, + "last_response": { + "readOnly": true, + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "code": { + "type": "integer", + "readOnly": true, + "example": 204 + }, + "response": { + "type": "string", + "readOnly": true, + "example": "" + } + } + }, + "secret": { + "type": "string", + "example": "" + }, + "url": { + "type": "string", + "example": "https://..." + } + } + }, + "WebHooks": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/WebHook" + } + } + } + } + ] + }, + "PDFTemplate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "default": "INVOICE-DE", + "example": "INVOICE-DE" + }, + "name": { + "type": "string", + "default": "Default template", + "example": "Default template" + }, + "pdf_template": { + "type": "string", + "default": "DE", + "example": "DE" + }, + "document_type": { + "type": "string", + "default": "INVOICE", + "example": "INVOICE" + } + } + }, + "PDFTemplates": { + "type": "object", + "allOf": [ + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/PDFTemplate" + } + } + } + } + ] + }, + "Discount": { + "type": "object", + "required": [ + "customer_id" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "customer_id": { + "type": "integer", + "format": "int64" + }, + "discount": { + "type": "integer", + "default": 0, + "example": 10, + "description": "The discount value depending on \"discount_type\"" + }, + "discount_type": { + "type": "string", + "default": "PERCENT", + "enum": [ + "AMOUNT", + "PERCENT", + "QUANTITY", + "FIX" + ], + "description": "AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price" + } + } + }, + "DiscountPosition": { + "type": "object", + "required": [ + "position_id" + ], + "properties": { + "position_id": { + "type": "integer", + "format": "int64" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Discount" + } + ] + }, + "DiscountPositions": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscountPosition" + } + } + } + } + ] + }, + "DiscountPositionGroup": { + "type": "object", + "required": [ + "position_group_id" + ], + "properties": { + "position_group_id": { + "type": "integer", + "format": "int64" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Discount" + } + ] + }, + "DiscountPositionGroups": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscountPositionGroup" + } + } + } + } + ] + }, + "Login": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "first_name": { + "type": "string", + "example": "Max" + }, + "last_name": { + "type": "string", + "example": "Musterfrau" + }, + "display_name": { + "type": "string", + "readOnly": true, + "example": "Max Musterfrau" + }, + "phone": { + "type": "string", + "example": "+4923489342" + }, + "email": { + "type": "string", + "example": "example@easybill.de" + }, + "email_signature": { + "type": "string", + "example": null + }, + "login_type": { + "type": "string", + "default": "ASSISTANT", + "enum": [ + "ADMIN", + "ASSISTANT" + ] + }, + "locale": { + "type": "string", + "example": "de" + }, + "time_zone": { + "type": "string", + "example": "Europe/Berlin" + }, + "security": { + "$ref": "#/definitions/LoginSecurity" + } + } + }, + "Logins": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Login" + } + } + } + } + ] + }, + "SerialNumber": { + "type": "object", + "required": [ + "serial_number", + "position_id" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "serial_number": { + "example": "DHEZ-DHSNR-2344D-FFW", + "type": "string" + }, + "position_id": { + "type": "integer", + "format": "int6" + }, + "document_id": { + "example": null, + "x-nullable": true, + "type": "integer", + "format": "int64", + "readOnly": true + }, + "document_position_id": { + "example": null, + "x-nullable": true, + "type": "integer", + "format": "int64", + "readOnly": true + }, + "used_at": { + "example": null, + "x-nullable": true, + "type": "string", + "format": "datetime", + "readOnly": true + }, + "created_at": { + "example": "2018-01-01 23:23:45", + "type": "string", + "format": "datetime", + "readOnly": true + } + } + }, + "SerialNumbers": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/SerialNumber" + } + } + } + } + ] + }, + "Stock": { + "type": "object", + "required": [ + "stock_count", + "position_id" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "note": { + "type": "string", + "example": "Correction for stock count of the Entry from 11/01/2017" + }, + "stock_count": { + "example": 666, + "type": "integer", + "format": "int64" + }, + "position_id": { + "type": "integer", + "format": "int64" + }, + "document_id": { + "example": null, + "x-nullable": true, + "type": "integer", + "format": "int64", + "readOnly": true + }, + "document_position_id": { + "example": null, + "x-nullable": true, + "type": "integer", + "format": "int64", + "readOnly": true + }, + "stored_at": { + "x-nullable": true, + "type": "string", + "format": "datetime", + "example": "2017-04-11 13:00:00" + }, + "created_at": { + "example": "2018-01-01 23:23:45", + "type": "string", + "format": "datetime", + "readOnly": true + }, + "updated_at": { + "example": "2018-01-01 23:23:45", + "type": "string", + "format": "datetime", + "readOnly": true + } + } + }, + "Stocks": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Stock" + } + } + } + } + ] + }, + "LoginSecurity": { + "type": "object", + "description": "This object is only displayed if your request the login resource as an admin. Otherwise this property will be null.", + "properties": { + "two_factor_enabled": { + "type": "boolean", + "readOnly": true, + "default": false, + "description": "Shows if the login has two factor enabled for the login process" + }, + "recovery_codes_enabled": { + "type": "boolean", + "readOnly": true, + "default": false, + "description": "Shows if the login has recovery codes enabled to bypass two factor" + }, + "notify_on_new_login_enabled": { + "type": "boolean", + "readOnly": true, + "default": true, + "description": "Shows if the login has enabled to be notified if a new login is made from an unknown device." + } + } + } + } +} \ No newline at end of file diff --git a/src/Models/.gitkeep b/src/Models/.gitkeep new file mode 100644 index 0000000..e69de29 From 275ec667d831402aee20e515c83bdbfdad495fdd Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 18:52:48 +0100 Subject: [PATCH 07/37] Add generators dir to cs fix --- .php-cs-fixer.dist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 2252fdf..9b3ab45 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -37,4 +37,5 @@ PhpCsFixer\Finder::create() ->in(__DIR__ . '/src') ->in(__DIR__ . '/examples') + ->in(__DIR__ . '/generators') ); From 1d0f5d7bc0498c0dd721b83a556bd194e59c2177 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 19:06:41 +0100 Subject: [PATCH 08/37] move commands from makefile to composer scripts --- Makefile | 5 +---- composer.json | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ace7d59..bf485b4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,4 @@ current_dir = $(shell pwd) make: composer install - composer dump-autoload - -cs-fix: - ./vendor/bin/php-cs-fixer fix \ No newline at end of file + composer dump-autoload \ No newline at end of file diff --git a/composer.json b/composer.json index 91a71e2..d250021 100644 --- a/composer.json +++ b/composer.json @@ -31,5 +31,9 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.4", "nette/php-generator": "^3.6" + }, + "scripts": { + "sdk:models": "php generators/models.php", + "sdk:cs-fix": "./vendor/bin/php-cs-fixer fix" } } From bb2e6beff1406903b829b081abc0d70301f1d75f Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 22:29:41 +0100 Subject: [PATCH 09/37] Add first models --- examples/customers_02_create_with_model.php | 23 + generators/models.php | 119 ++- src/Models/Attachment.php | 71 ++ src/Models/Contact.php | 249 ++++++ src/Models/Customer.php | 797 ++++++++++++++++++++ src/Models/CustomerGroup.php | 63 ++ src/Models/CustomerSnapshot.php | 22 + src/Models/Discount.php | 61 ++ src/Models/DiscountPosition.php | 31 + src/Models/DiscountPositionGroup.php | 31 + src/Models/Document.php | 597 +++++++++++++++ src/Models/DocumentAddress.php | 85 +++ src/Models/DocumentPayment.php | 110 +++ src/Models/DocumentPosition.php | 262 +++++++ src/Models/DocumentRecurring.php | 212 ++++++ src/Models/Login.php | 120 +++ src/Models/LoginSecurity.php | 36 + src/Models/PDFTemplate.php | 60 ++ src/Models/Position.php | 382 ++++++++++ src/Models/PositionGroup.php | 65 ++ src/Models/PostBox.php | 206 +++++ src/Models/PostBoxRequest.php | 114 +++ src/Models/Project.php | 147 ++++ src/Models/SEPAPayment.php | 282 +++++++ src/Models/SerialNumber.php | 65 ++ src/Models/ServiceDate.php | 73 ++ src/Models/Stock.php | 85 +++ src/Models/Task.php | 184 +++++ src/Models/TextTemplate.php | 50 ++ src/Models/TimeTracking.php | 152 ++++ src/Models/WebHook.php | 93 +++ 31 files changed, 4815 insertions(+), 32 deletions(-) create mode 100644 examples/customers_02_create_with_model.php create mode 100644 src/Models/Attachment.php create mode 100644 src/Models/Contact.php create mode 100644 src/Models/Customer.php create mode 100644 src/Models/CustomerGroup.php create mode 100644 src/Models/CustomerSnapshot.php create mode 100644 src/Models/Discount.php create mode 100644 src/Models/DiscountPosition.php create mode 100644 src/Models/DiscountPositionGroup.php create mode 100644 src/Models/Document.php create mode 100644 src/Models/DocumentAddress.php create mode 100644 src/Models/DocumentPayment.php create mode 100644 src/Models/DocumentPosition.php create mode 100644 src/Models/DocumentRecurring.php create mode 100644 src/Models/Login.php create mode 100644 src/Models/LoginSecurity.php create mode 100644 src/Models/PDFTemplate.php create mode 100644 src/Models/Position.php create mode 100644 src/Models/PositionGroup.php create mode 100644 src/Models/PostBox.php create mode 100644 src/Models/PostBoxRequest.php create mode 100644 src/Models/Project.php create mode 100644 src/Models/SEPAPayment.php create mode 100644 src/Models/SerialNumber.php create mode 100644 src/Models/ServiceDate.php create mode 100644 src/Models/Stock.php create mode 100644 src/Models/Task.php create mode 100644 src/Models/TextTemplate.php create mode 100644 src/Models/TimeTracking.php create mode 100644 src/Models/WebHook.php diff --git a/examples/customers_02_create_with_model.php b/examples/customers_02_create_with_model.php new file mode 100644 index 0000000..6da4438 --- /dev/null +++ b/examples/customers_02_create_with_model.php @@ -0,0 +1,23 @@ +setFirstName('Foo'); +$customerCreate->setLastName('Bar'); +$customerCreate->setCompanyName('FooBar GmbH'); +$customerCreate->setEmails(['foo.bar@foobar.com']); + +$result = $client->request('POST', 'customers', $customerCreate->getData()); + +$customer = new Customer($result); + +var_dump($customer); diff --git a/generators/models.php b/generators/models.php index 02d43e9..ed26bc1 100644 --- a/generators/models.php +++ b/generators/models.php @@ -6,50 +6,102 @@ $swagger = json_decode(file_get_contents(__DIR__ . '/swagger.1.68.0.json'), true); -// Todo: -// Login::security, -// Document::service_date, -// Document::recurring_options, -// Document::customer_snapshot, -// Document::label_address, -// Document::address +function classNameFromRef(string $ref): string +{ + $explodedRef = explode('/', $ref); + $className = end($explodedRef); + return $className === 'List' ? 'ResultList' : $className; +} + +function classWithNamespace(string $className): string +{ + $namespace = str_contains($className, 'ResultList') ? 'easybill\SDK\ResultLists\\' : 'easybill\SDK\Models\\'; + return $namespace . $className; +} + +function typeMap(string $type): string +{ + return match ($type) { + 'integer' => 'int', + 'number' => 'float', + 'boolean' => 'bool', + 'array' => 'array', + 'string' => 'string', + 'object' => \stdClass::class, + '' => '', + default => throw new RuntimeException('type not supported: ' . $type), + }; +} foreach ($swagger['definitions'] as $className => $classInfo) { + $className = $className === 'List' ? 'ResultList' : $className; + $classInfo['properties'] = $classInfo['properties'] ?? []; + $classInfo['allOf'] = $classInfo['allOf'] ?? []; + $classInfo['description'] = trim($classInfo['description'] ?? ''); + $classExtends = []; + + foreach ($classInfo['allOf'] as $of) { + if (array_key_exists('$ref', $of)) { + $classExtends[] = classWithNamespace(classNameFromRef($of['$ref'])); + continue; + } + if (array_key_exists('properties', $of)) { + $classInfo['properties'] = array_merge($classInfo['properties'], $of['properties']); + continue; + } + } + if ( - $className === 'List' - || array_key_exists('allOf', $classInfo) - || !array_key_exists('properties', $classInfo) + str_contains($className, 'ResultList') + || in_array(classWithNamespace('ResultList'), $classExtends, true) + || $className === 'PDFTemplates' ) { - // List dont supported. + // dont support this in first step; continue; } - - $file = new Nette\PhpGenerator\PhpFile; + $file = new Nette\PhpGenerator\PhpFile(); $file->setStrictTypes(); - $class = $file->addClass('easybill\SDK\Models\\' . $className); + $class = $file->addClass(classWithNamespace($className)); + $class->addComment('Auto-generated with `composer sdk:models`'); + $class->setExtends($classExtends); + + if ($classInfo['description'] !== '') { + $class->addComment($classInfo['description']); + } $construct = $class->addMethod('__construct'); - $construct->addPromotedParameter('data', [])->setPublic(); + $construct->addPromotedParameter('data', [])->setProtected(); + if ($classExtends) { + $construct->setBody('parent::__construct($data);'); + } + + $getterData = $class->addMethod('getData'); + $getterData->setReturnType('array'); + $getterData->setBody('return $this->data;'); $errors = []; foreach ($classInfo['properties'] as $propertyName => $propertyInfo) { + $propertyInfo['readOnly'] = $propertyInfo['readOnly'] ?? false; + $propertyInfo['description'] = trim($propertyInfo['description'] ?? ''); + $propertyInfo['type'] = trim($propertyInfo['type'] ?? ''); + $propertyInfo['x-nullable'] = $propertyInfo['x-nullable'] ?? false; + $propertyInfo['items'] = $propertyInfo['items'] ?? []; - echo "==> " . $className . '::' . $propertyName . "\n"; + echo '==> ' . $className . '::' . $propertyName . "\n"; - $type = match ($propertyInfo['type']) { - 'integer' => 'int', - 'number' => 'float', - 'boolean' => 'bool', - default => $propertyInfo['type'], - }; + $type = typeMap($propertyInfo['type']); + + if (array_key_exists('$ref', $propertyInfo)) { + $type = classWithNamespace(classNameFromRef($propertyInfo['$ref'])); + } $methodeName = str_replace('_', '', ucwords($propertyName, '_')); - if (!($propertyInfo['readOnly'] ?? false)) { + if ($propertyInfo['readOnly'] === false) { $setter = $class->addMethod('set' . $methodeName); - if (trim($propertyInfo['description'] ?? '') !== '') { + if ($propertyInfo['description'] !== '') { $setter->addComment($propertyInfo['description']); } $setter->setReturnType('void'); @@ -57,22 +109,25 @@ $property = $setter->addParameter($propertyName); $property->setType($type); - if ($propertyInfo['x-nullable'] ?? false) { + if ($propertyInfo['x-nullable']) { $property->setNullable(); } - } - $getter = $class->addMethod('get' . $methodeName); $getter->setReturnType($type); - if ($propertyInfo['x-nullable'] ?? false) { + if ($propertyInfo['x-nullable']) { $getter->setReturnNullable(); } + if ($type === 'array' && array_key_exists('type', $propertyInfo['items'])) { + $getter->addComment('@return ' . typeMap($propertyInfo['items']['type']) . '[]'); + } + if ($type === 'array' && array_key_exists('$ref', $propertyInfo['items'])) { + $getter->addComment('@return \\' . classWithNamespace(classNameFromRef($propertyInfo['items']['$ref'])) . '[]'); + } $getter->setBody('return $this->data[\'' . $propertyName . '\'];'); - } - file_put_contents(__DIR__ . '/../src/Models/' . $className . '.php', $file); - -} \ No newline at end of file + $content = (new Nette\PhpGenerator\PsrPrinter())->printFile($file); + file_put_contents(__DIR__ . '/../src/Models/' . $className . '.php', $content); +} diff --git a/src/Models/Attachment.php b/src/Models/Attachment.php new file mode 100644 index 0000000..32c8a2b --- /dev/null +++ b/src/Models/Attachment.php @@ -0,0 +1,71 @@ +data; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + public function setCustomerId(?int $customer_id): void + { + $this->data['customer_id'] = $customer_id; + } + + public function getCustomerId(): ?int + { + return $this->data['customer_id']; + } + + public function setDocumentId(?int $document_id): void + { + $this->data['document_id'] = $document_id; + } + + public function getDocumentId(): ?int + { + return $this->data['document_id']; + } + + public function getFileName(): string + { + return $this->data['file_name']; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setProjectId(?int $project_id): void + { + $this->data['project_id'] = $project_id; + } + + public function getProjectId(): ?int + { + return $this->data['project_id']; + } + + public function getSize(): int + { + return $this->data['size']; + } +} diff --git a/src/Models/Contact.php b/src/Models/Contact.php new file mode 100644 index 0000000..6964aed --- /dev/null +++ b/src/Models/Contact.php @@ -0,0 +1,249 @@ +data; + } + + public function setCity(string $city): void + { + $this->data['city'] = $city; + } + + public function getCity(): string + { + return $this->data['city']; + } + + public function setState(string $state): void + { + $this->data['state'] = $state; + } + + public function getState(): string + { + return $this->data['state']; + } + + public function setCompanyName(?string $company_name): void + { + $this->data['company_name'] = $company_name; + } + + public function getCompanyName(): ?string + { + return $this->data['company_name']; + } + + /** + * Two-letter country code. + */ + public function setCountry(string $country): void + { + $this->data['country'] = $country; + } + + public function getCountry(): string + { + return $this->data['country']; + } + + public function setDepartment(?string $department): void + { + $this->data['department'] = $department; + } + + public function getDepartment(): ?string + { + return $this->data['department']; + } + + public function setEmails(array $emails): void + { + $this->data['emails'] = $emails; + } + + /** + * @return string[] + */ + public function getEmails(): array + { + return $this->data['emails']; + } + + public function setFax(?string $fax): void + { + $this->data['fax'] = $fax; + } + + public function getFax(): ?string + { + return $this->data['fax']; + } + + public function setFirstName(?string $first_name): void + { + $this->data['first_name'] = $first_name; + } + + public function getFirstName(): ?string + { + return $this->data['first_name']; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setLastName(?string $last_name): void + { + $this->data['last_name'] = $last_name; + } + + public function getLastName(): ?string + { + return $this->data['last_name']; + } + + public function getLoginId(): int + { + return $this->data['login_id']; + } + + public function setMobile(?string $mobile): void + { + $this->data['mobile'] = $mobile; + } + + public function getMobile(): ?string + { + return $this->data['mobile']; + } + + public function setNote(?string $note): void + { + $this->data['note'] = $note; + } + + public function getNote(): ?string + { + return $this->data['note']; + } + + public function setPersonal(bool $personal): void + { + $this->data['personal'] = $personal; + } + + public function getPersonal(): bool + { + return $this->data['personal']; + } + + public function setPhone1(?string $phone_1): void + { + $this->data['phone_1'] = $phone_1; + } + + public function getPhone1(): ?string + { + return $this->data['phone_1']; + } + + public function setPhone2(?string $phone_2): void + { + $this->data['phone_2'] = $phone_2; + } + + public function getPhone2(): ?string + { + return $this->data['phone_2']; + } + + /** + * 0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie. + */ + public function setSalutation(int $salutation): void + { + $this->data['salutation'] = $salutation; + } + + public function getSalutation(): int + { + return $this->data['salutation']; + } + + public function setStreet(string $street): void + { + $this->data['street'] = $street; + } + + public function getStreet(): string + { + return $this->data['street']; + } + + public function setSuffix1(?string $suffix_1): void + { + $this->data['suffix_1'] = $suffix_1; + } + + public function getSuffix1(): ?string + { + return $this->data['suffix_1']; + } + + public function setSuffix2(?string $suffix_2): void + { + $this->data['suffix_2'] = $suffix_2; + } + + public function getSuffix2(): ?string + { + return $this->data['suffix_2']; + } + + public function setTitle(?string $title): void + { + $this->data['title'] = $title; + } + + public function getTitle(): ?string + { + return $this->data['title']; + } + + public function setZipCode(?string $zip_code): void + { + $this->data['zip_code'] = $zip_code; + } + + public function getZipCode(): ?string + { + return $this->data['zip_code']; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + public function getUpdatedAt(): string + { + return $this->data['updated_at']; + } +} diff --git a/src/Models/Customer.php b/src/Models/Customer.php new file mode 100644 index 0000000..069e47a --- /dev/null +++ b/src/Models/Customer.php @@ -0,0 +1,797 @@ +data; + } + + /** + * 1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform. + */ + public function setAcquireOptions(?int $acquire_options): void + { + $this->data['acquire_options'] = $acquire_options; + } + + public function getAcquireOptions(): ?int + { + return $this->data['acquire_options']; + } + + /** + * @return int[] + */ + public function getAdditionalGroupsIds(): array + { + return $this->data['additional_groups_ids']; + } + + public function setBankAccount(?string $bank_account): void + { + $this->data['bank_account'] = $bank_account; + } + + public function getBankAccount(): ?string + { + return $this->data['bank_account']; + } + + public function setBankAccountOwner(?string $bank_account_owner): void + { + $this->data['bank_account_owner'] = $bank_account_owner; + } + + public function getBankAccountOwner(): ?string + { + return $this->data['bank_account_owner']; + } + + public function setBankBic(?string $bank_bic): void + { + $this->data['bank_bic'] = $bank_bic; + } + + public function getBankBic(): ?string + { + return $this->data['bank_bic']; + } + + public function setBankCode(?string $bank_code): void + { + $this->data['bank_code'] = $bank_code; + } + + public function getBankCode(): ?string + { + return $this->data['bank_code']; + } + + public function setBankIban(?string $bank_iban): void + { + $this->data['bank_iban'] = $bank_iban; + } + + public function getBankIban(): ?string + { + return $this->data['bank_iban']; + } + + public function setBankName(?string $bank_name): void + { + $this->data['bank_name'] = $bank_name; + } + + public function getBankName(): ?string + { + return $this->data['bank_name']; + } + + public function setBirthDate(?string $birth_date): void + { + $this->data['birth_date'] = $birth_date; + } + + public function getBirthDate(): ?string + { + return $this->data['birth_date']; + } + + public function setCashAllowance(?float $cash_allowance): void + { + $this->data['cash_allowance'] = $cash_allowance; + } + + public function getCashAllowance(): ?float + { + return $this->data['cash_allowance']; + } + + public function setCashAllowanceDays(int $cash_allowance_days): void + { + $this->data['cash_allowance_days'] = $cash_allowance_days; + } + + public function getCashAllowanceDays(): int + { + return $this->data['cash_allowance_days']; + } + + public function setCashDiscount(?float $cash_discount): void + { + $this->data['cash_discount'] = $cash_discount; + } + + public function getCashDiscount(): ?float + { + return $this->data['cash_discount']; + } + + public function setCashDiscountType(?string $cash_discount_type): void + { + $this->data['cash_discount_type'] = $cash_discount_type; + } + + public function getCashDiscountType(): ?string + { + return $this->data['cash_discount_type']; + } + + public function setCity(?string $city): void + { + $this->data['city'] = $city; + } + + public function getCity(): ?string + { + return $this->data['city']; + } + + public function setState(string $state): void + { + $this->data['state'] = $state; + } + + public function getState(): string + { + return $this->data['state']; + } + + public function setCompanyName(?string $company_name): void + { + $this->data['company_name'] = $company_name; + } + + public function getCompanyName(): ?string + { + return $this->data['company_name']; + } + + public function setCountry(string $country): void + { + $this->data['country'] = $country; + } + + public function getCountry(): string + { + return $this->data['country']; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + public function getUpdatedAt(): string + { + return $this->data['updated_at']; + } + + public function setDeliveryTitle(string $delivery_title): void + { + $this->data['delivery_title'] = $delivery_title; + } + + public function getDeliveryTitle(): string + { + return $this->data['delivery_title']; + } + + public function setDeliveryCity(?string $delivery_city): void + { + $this->data['delivery_city'] = $delivery_city; + } + + public function getDeliveryCity(): ?string + { + return $this->data['delivery_city']; + } + + public function setDeliveryState(string $delivery_state): void + { + $this->data['delivery_state'] = $delivery_state; + } + + public function getDeliveryState(): string + { + return $this->data['delivery_state']; + } + + public function setDeliveryCompanyName(?string $delivery_company_name): void + { + $this->data['delivery_company_name'] = $delivery_company_name; + } + + public function getDeliveryCompanyName(): ?string + { + return $this->data['delivery_company_name']; + } + + public function setDeliveryCountry(?string $delivery_country): void + { + $this->data['delivery_country'] = $delivery_country; + } + + public function getDeliveryCountry(): ?string + { + return $this->data['delivery_country']; + } + + public function setDeliveryFirstName(?string $delivery_first_name): void + { + $this->data['delivery_first_name'] = $delivery_first_name; + } + + public function getDeliveryFirstName(): ?string + { + return $this->data['delivery_first_name']; + } + + public function setDeliveryLastName(?string $delivery_last_name): void + { + $this->data['delivery_last_name'] = $delivery_last_name; + } + + public function getDeliveryLastName(): ?string + { + return $this->data['delivery_last_name']; + } + + public function setDeliveryPersonal(bool $delivery_personal): void + { + $this->data['delivery_personal'] = $delivery_personal; + } + + public function getDeliveryPersonal(): bool + { + return $this->data['delivery_personal']; + } + + /** + * 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family. + */ + public function setDeliverySalutation(int $delivery_salutation): void + { + $this->data['delivery_salutation'] = $delivery_salutation; + } + + public function getDeliverySalutation(): int + { + return $this->data['delivery_salutation']; + } + + public function setDeliveryStreet(?string $delivery_street): void + { + $this->data['delivery_street'] = $delivery_street; + } + + public function getDeliveryStreet(): ?string + { + return $this->data['delivery_street']; + } + + public function setDeliverySuffix1(?string $delivery_suffix_1): void + { + $this->data['delivery_suffix_1'] = $delivery_suffix_1; + } + + public function getDeliverySuffix1(): ?string + { + return $this->data['delivery_suffix_1']; + } + + public function setDeliverySuffix2(?string $delivery_suffix_2): void + { + $this->data['delivery_suffix_2'] = $delivery_suffix_2; + } + + public function getDeliverySuffix2(): ?string + { + return $this->data['delivery_suffix_2']; + } + + public function setDeliveryZipCode(?string $delivery_zip_code): void + { + $this->data['delivery_zip_code'] = $delivery_zip_code; + } + + public function getDeliveryZipCode(): ?string + { + return $this->data['delivery_zip_code']; + } + + public function getDisplayName(): string + { + return $this->data['display_name']; + } + + public function setEmails(array $emails): void + { + $this->data['emails'] = $emails; + } + + /** + * @return string[] + */ + public function getEmails(): array + { + return $this->data['emails']; + } + + public function setFax(?string $fax): void + { + $this->data['fax'] = $fax; + } + + public function getFax(): ?string + { + return $this->data['fax']; + } + + public function setFirstName(?string $first_name): void + { + $this->data['first_name'] = $first_name; + } + + public function getFirstName(): ?string + { + return $this->data['first_name']; + } + + /** + * will be replaced by its alias due_in_days. + */ + public function setGracePeriod(?int $grace_period): void + { + $this->data['grace_period'] = $grace_period; + } + + public function getGracePeriod(): ?int + { + return $this->data['grace_period']; + } + + /** + * due date in days. + */ + public function setDueInDays(?int $due_in_days): void + { + $this->data['due_in_days'] = $due_in_days; + } + + public function getDueInDays(): ?int + { + return $this->data['due_in_days']; + } + + public function setGroupId(?int $group_id): void + { + $this->data['group_id'] = $group_id; + } + + public function getGroupId(): ?int + { + return $this->data['group_id']; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setInfo1(?string $info_1): void + { + $this->data['info_1'] = $info_1; + } + + public function getInfo1(): ?string + { + return $this->data['info_1']; + } + + public function setInfo2(?string $info_2): void + { + $this->data['info_2'] = $info_2; + } + + public function getInfo2(): ?string + { + return $this->data['info_2']; + } + + public function setInternet(?string $internet): void + { + $this->data['internet'] = $internet; + } + + public function getInternet(): ?string + { + return $this->data['internet']; + } + + public function setLastName(?string $last_name): void + { + $this->data['last_name'] = $last_name; + } + + public function getLastName(): ?string + { + return $this->data['last_name']; + } + + public function setLoginId(int $login_id): void + { + $this->data['login_id'] = $login_id; + } + + public function getLoginId(): int + { + return $this->data['login_id']; + } + + public function setMobile(?string $mobile): void + { + $this->data['mobile'] = $mobile; + } + + public function getMobile(): ?string + { + return $this->data['mobile']; + } + + public function setNote(?string $note): void + { + $this->data['note'] = $note; + } + + public function getNote(): ?string + { + return $this->data['note']; + } + + /** + * Automatically generated if empty. + */ + public function setNumber(string $number): void + { + $this->data['number'] = $number; + } + + public function getNumber(): string + { + return $this->data['number']; + } + + /** + * 1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung. + */ + public function setPaymentOptions(?int $payment_options): void + { + $this->data['payment_options'] = $payment_options; + } + + public function getPaymentOptions(): ?int + { + return $this->data['payment_options']; + } + + public function setPersonal(bool $personal): void + { + $this->data['personal'] = $personal; + } + + public function getPersonal(): bool + { + return $this->data['personal']; + } + + public function setPhone1(?string $phone_1): void + { + $this->data['phone_1'] = $phone_1; + } + + public function getPhone1(): ?string + { + return $this->data['phone_1']; + } + + public function setPhone2(?string $phone_2): void + { + $this->data['phone_2'] = $phone_2; + } + + public function getPhone2(): ?string + { + return $this->data['phone_2']; + } + + public function setPostbox(?string $postbox): void + { + $this->data['postbox'] = $postbox; + } + + public function getPostbox(): ?string + { + return $this->data['postbox']; + } + + public function setPostboxCity(?string $postbox_city): void + { + $this->data['postbox_city'] = $postbox_city; + } + + public function getPostboxCity(): ?string + { + return $this->data['postbox_city']; + } + + public function setPostboxState(string $postbox_state): void + { + $this->data['postbox_state'] = $postbox_state; + } + + public function getPostboxState(): string + { + return $this->data['postbox_state']; + } + + public function setPostboxCountry(?string $postbox_country): void + { + $this->data['postbox_country'] = $postbox_country; + } + + public function getPostboxCountry(): ?string + { + return $this->data['postbox_country']; + } + + public function setPostboxZipCode(?string $postbox_zip_code): void + { + $this->data['postbox_zip_code'] = $postbox_zip_code; + } + + public function getPostboxZipCode(): ?string + { + return $this->data['postbox_zip_code']; + } + + public function setSalePriceLevel(?string $sale_price_level): void + { + $this->data['sale_price_level'] = $sale_price_level; + } + + public function getSalePriceLevel(): ?string + { + return $this->data['sale_price_level']; + } + + /** + * 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family. + */ + public function setSalutation(int $salutation): void + { + $this->data['salutation'] = $salutation; + } + + public function getSalutation(): int + { + return $this->data['salutation']; + } + + /** + * BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1, COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt. + */ + public function setSepaAgreement(?string $sepa_agreement): void + { + $this->data['sepa_agreement'] = $sepa_agreement; + } + + public function getSepaAgreement(): ?string + { + return $this->data['sepa_agreement']; + } + + public function setSepaAgreementDate(?string $sepa_agreement_date): void + { + $this->data['sepa_agreement_date'] = $sepa_agreement_date; + } + + public function getSepaAgreementDate(): ?string + { + return $this->data['sepa_agreement_date']; + } + + public function setSepaMandateReference(?string $sepa_mandate_reference): void + { + $this->data['sepa_mandate_reference'] = $sepa_mandate_reference; + } + + public function getSepaMandateReference(): ?string + { + return $this->data['sepa_mandate_reference']; + } + + public function setSinceDate(?string $since_date): void + { + $this->data['since_date'] = $since_date; + } + + public function getSinceDate(): ?string + { + return $this->data['since_date']; + } + + public function setStreet(?string $street): void + { + $this->data['street'] = $street; + } + + public function getStreet(): ?string + { + return $this->data['street']; + } + + public function setSuffix1(?string $suffix_1): void + { + $this->data['suffix_1'] = $suffix_1; + } + + public function getSuffix1(): ?string + { + return $this->data['suffix_1']; + } + + public function setSuffix2(?string $suffix_2): void + { + $this->data['suffix_2'] = $suffix_2; + } + + public function getSuffix2(): ?string + { + return $this->data['suffix_2']; + } + + public function setTaxNumber(?string $tax_number): void + { + $this->data['tax_number'] = $tax_number; + } + + public function getTaxNumber(): ?string + { + return $this->data['tax_number']; + } + + public function setCourt(?string $court): void + { + $this->data['court'] = $court; + } + + public function getCourt(): ?string + { + return $this->data['court']; + } + + public function setCourtRegistryNumber(?string $court_registry_number): void + { + $this->data['court_registry_number'] = $court_registry_number; + } + + public function getCourtRegistryNumber(): ?string + { + return $this->data['court_registry_number']; + } + + /** + * nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig. + */ + public function setTaxOptions(?string $tax_options): void + { + $this->data['tax_options'] = $tax_options; + } + + public function getTaxOptions(): ?string + { + return $this->data['tax_options']; + } + + public function setTitle(?string $title): void + { + $this->data['title'] = $title; + } + + public function getTitle(): ?string + { + return $this->data['title']; + } + + public function setVatIdentifier(?string $vat_identifier): void + { + $this->data['vat_identifier'] = $vat_identifier; + } + + public function getVatIdentifier(): ?string + { + return $this->data['vat_identifier']; + } + + public function setZipCode(?string $zip_code): void + { + $this->data['zip_code'] = $zip_code; + } + + public function getZipCode(): ?string + { + return $this->data['zip_code']; + } + + /** + * Type of PDF to use when sending a Document to the Customer. + */ + public function setDocumentPdfType(string $documentPdfType): void + { + $this->data['documentPdfType'] = $documentPdfType; + } + + public function getDocumentPdfType(): string + { + return $this->data['documentPdfType']; + } + + /** + * Used as "buyerReference" in ZUGFeRD and as "Leitweg-ID" in the XRechnung format. + */ + public function setBuyerReference(string $buyer_reference): void + { + $this->data['buyer_reference'] = $buyer_reference; + } + + public function getBuyerReference(): string + { + return $this->data['buyer_reference']; + } + + /** + * The ID given to your company by the customer in his system. + */ + public function setForeignSupplierNumber(string $foreign_supplier_number): void + { + $this->data['foreign_supplier_number'] = $foreign_supplier_number; + } + + public function getForeignSupplierNumber(): string + { + return $this->data['foreign_supplier_number']; + } +} diff --git a/src/Models/CustomerGroup.php b/src/Models/CustomerGroup.php new file mode 100644 index 0000000..81fe1b2 --- /dev/null +++ b/src/Models/CustomerGroup.php @@ -0,0 +1,63 @@ +data; + } + + public function setName(string $name): void + { + $this->data['name'] = $name; + } + + public function getName(): string + { + return $this->data['name']; + } + + public function setDescription(?string $description): void + { + $this->data['description'] = $description; + } + + public function getDescription(): ?string + { + return $this->data['description']; + } + + /** + * Can be chosen freely. + */ + public function setNumber(string $number): void + { + $this->data['number'] = $number; + } + + public function getNumber(): string + { + return $this->data['number']; + } + + public function getDisplayName(): string + { + return $this->data['display_name']; + } + + public function getId(): int + { + return $this->data['id']; + } +} diff --git a/src/Models/CustomerSnapshot.php b/src/Models/CustomerSnapshot.php new file mode 100644 index 0000000..7aa826f --- /dev/null +++ b/src/Models/CustomerSnapshot.php @@ -0,0 +1,22 @@ +data; + } +} diff --git a/src/Models/Discount.php b/src/Models/Discount.php new file mode 100644 index 0000000..ac1a847 --- /dev/null +++ b/src/Models/Discount.php @@ -0,0 +1,61 @@ +data; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setCustomerId(int $customer_id): void + { + $this->data['customer_id'] = $customer_id; + } + + public function getCustomerId(): int + { + return $this->data['customer_id']; + } + + /** + * The discount value depending on "discount_type". + */ + public function setDiscount(int $discount): void + { + $this->data['discount'] = $discount; + } + + public function getDiscount(): int + { + return $this->data['discount']; + } + + /** + * AMOUNT subtracts the value in "discount" from the total
QUANTITY subtracts the value in "discount" multiplied by quantity
PERCENT uses the value in "discount" as a percentage
FIX sets the value in "discount" as the new price. + */ + public function setDiscountType(string $discount_type): void + { + $this->data['discount_type'] = $discount_type; + } + + public function getDiscountType(): string + { + return $this->data['discount_type']; + } +} diff --git a/src/Models/DiscountPosition.php b/src/Models/DiscountPosition.php new file mode 100644 index 0000000..4c4ce8e --- /dev/null +++ b/src/Models/DiscountPosition.php @@ -0,0 +1,31 @@ +data; + } + + public function setPositionId(int $position_id): void + { + $this->data['position_id'] = $position_id; + } + + public function getPositionId(): int + { + return $this->data['position_id']; + } +} diff --git a/src/Models/DiscountPositionGroup.php b/src/Models/DiscountPositionGroup.php new file mode 100644 index 0000000..4239d2f --- /dev/null +++ b/src/Models/DiscountPositionGroup.php @@ -0,0 +1,31 @@ +data; + } + + public function setPositionGroupId(int $position_group_id): void + { + $this->data['position_group_id'] = $position_group_id; + } + + public function getPositionGroupId(): int + { + return $this->data['position_group_id']; + } +} diff --git a/src/Models/Document.php b/src/Models/Document.php new file mode 100644 index 0000000..c8bde8b --- /dev/null +++ b/src/Models/Document.php @@ -0,0 +1,597 @@ +data; + } + + public function getAddress(): DocumentAddress + { + return $this->data['address']; + } + + /** + * @return int[] + */ + public function getAttachmentIds(): array + { + return $this->data['attachment_ids']; + } + + public function getLabelAddress(): DocumentAddress + { + return $this->data['label_address']; + } + + public function getAmount(): int + { + return $this->data['amount']; + } + + public function getAmountNet(): int + { + return $this->data['amount_net']; + } + + public function setBankDebitForm(?string $bank_debit_form): void + { + $this->data['bank_debit_form'] = $bank_debit_form; + } + + public function getBankDebitForm(): ?string + { + return $this->data['bank_debit_form']; + } + + public function getBillingCountry(): string + { + return $this->data['billing_country']; + } + + /** + * 0 === Net, 1 === Gross. + */ + public function setCalcVatFrom(int $calc_vat_from): void + { + $this->data['calc_vat_from'] = $calc_vat_from; + } + + public function getCalcVatFrom(): int + { + return $this->data['calc_vat_from']; + } + + public function getCancelId(): int + { + return $this->data['cancel_id']; + } + + public function setCashAllowance(?float $cash_allowance): void + { + $this->data['cash_allowance'] = $cash_allowance; + } + + public function getCashAllowance(): ?float + { + return $this->data['cash_allowance']; + } + + public function setCashAllowanceDays(?int $cash_allowance_days): void + { + $this->data['cash_allowance_days'] = $cash_allowance_days; + } + + public function getCashAllowanceDays(): ?int + { + return $this->data['cash_allowance_days']; + } + + public function setCashAllowanceText(?string $cash_allowance_text): void + { + $this->data['cash_allowance_text'] = $cash_allowance_text; + } + + public function getCashAllowanceText(): ?string + { + return $this->data['cash_allowance_text']; + } + + public function setContactId(?int $contact_id): void + { + $this->data['contact_id'] = $contact_id; + } + + public function getContactId(): ?int + { + return $this->data['contact_id']; + } + + public function setContactLabel(string $contact_label): void + { + $this->data['contact_label'] = $contact_label; + } + + public function getContactLabel(): string + { + return $this->data['contact_label']; + } + + public function setContactText(string $contact_text): void + { + $this->data['contact_text'] = $contact_text; + } + + public function getContactText(): string + { + return $this->data['contact_text']; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + public function setCurrency(string $currency): void + { + $this->data['currency'] = $currency; + } + + public function getCurrency(): string + { + return $this->data['currency']; + } + + public function setCustomerId(?int $customer_id): void + { + $this->data['customer_id'] = $customer_id; + } + + public function getCustomerId(): ?int + { + return $this->data['customer_id']; + } + + public function getCustomerSnapshot(): CustomerSnapshot + { + return $this->data['customer_snapshot']; + } + + public function setDiscount(?string $discount): void + { + $this->data['discount'] = $discount; + } + + public function getDiscount(): ?string + { + return $this->data['discount']; + } + + public function setDiscountType(?string $discount_type): void + { + $this->data['discount_type'] = $discount_type; + } + + public function getDiscountType(): ?string + { + return $this->data['discount_type']; + } + + public function setDocumentDate(string $document_date): void + { + $this->data['document_date'] = $document_date; + } + + public function getDocumentDate(): string + { + return $this->data['document_date']; + } + + public function getDueDate(): string + { + return $this->data['due_date']; + } + + public function getEditedAt(): string + { + return $this->data['edited_at']; + } + + public function setExternalId(?string $external_id): void + { + $this->data['external_id'] = $external_id; + } + + public function getExternalId(): ?string + { + return $this->data['external_id']; + } + + public function setReplicaUrl(?string $replica_url): void + { + $this->data['replica_url'] = $replica_url; + } + + public function getReplicaUrl(): ?string + { + return $this->data['replica_url']; + } + + /** + * will be replaced by its alias due_in_days. + */ + public function setGracePeriod(?int $grace_period): void + { + $this->data['grace_period'] = $grace_period; + } + + public function getGracePeriod(): ?int + { + return $this->data['grace_period']; + } + + /** + * due date in days. + */ + public function setDueInDays(?int $due_in_days): void + { + $this->data['due_in_days'] = $due_in_days; + } + + public function getDueInDays(): ?int + { + return $this->data['due_in_days']; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setIsArchive(bool $is_archive): void + { + $this->data['is_archive'] = $is_archive; + } + + public function getIsArchive(): bool + { + return $this->data['is_archive']; + } + + public function getIsDraft(): bool + { + return $this->data['is_draft']; + } + + /** + * Marks a document as a replica from another software. + */ + public function setIsReplica(bool $is_replica): void + { + $this->data['is_replica'] = $is_replica; + } + + public function getIsReplica(): bool + { + return $this->data['is_replica']; + } + + public function getIsCold(): bool + { + return $this->data['is_cold']; + } + + /** + * Indicates if a document is a one-stop-shop document. + */ + public function setIsOss(bool $is_oss): void + { + $this->data['is_oss'] = $is_oss; + } + + public function getIsOss(): bool + { + return $this->data['is_oss']; + } + + /** + * Signals when the document should be moved to the long term archive. + */ + public function setColdstorageDueDate(?string $coldstorage_due_date): void + { + $this->data['coldstorage_due_date'] = $coldstorage_due_date; + } + + public function getColdstorageDueDate(): ?string + { + return $this->data['coldstorage_due_date']; + } + + /** + * @return string[] + */ + public function getItemNotes(): array + { + return $this->data['item_notes']; + } + + public function setItems(array $items): void + { + $this->data['items'] = $items; + } + + /** + * @return \easybill\SDK\Models\DocumentPosition[] + */ + public function getItems(): array + { + return $this->data['items']; + } + + public function getLastPostboxId(): int + { + return $this->data['last_postbox_id']; + } + + /** + * If omitted or null, the currently active login is used. + */ + public function setLoginId(int $login_id): void + { + $this->data['login_id'] = $login_id; + } + + public function getLoginId(): int + { + return $this->data['login_id']; + } + + public function setNumber(?string $number): void + { + $this->data['number'] = $number; + } + + public function getNumber(): ?string + { + return $this->data['number']; + } + + public function setOrderNumber(string $order_number): void + { + $this->data['order_number'] = $order_number; + } + + public function getOrderNumber(): string + { + return $this->data['order_number']; + } + + public function setBuyerReference(string $buyer_reference): void + { + $this->data['buyer_reference'] = $buyer_reference; + } + + public function getBuyerReference(): string + { + return $this->data['buyer_reference']; + } + + public function getPaidAmount(): int + { + return $this->data['paid_amount']; + } + + public function getPaidAt(): string + { + return $this->data['paid_at']; + } + + public function getPdfPages(): int + { + return $this->data['pdf_pages']; + } + + /** + * Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID. + */ + public function setPdfTemplate(string $pdf_template): void + { + $this->data['pdf_template'] = $pdf_template; + } + + public function getPdfTemplate(): string + { + return $this->data['pdf_template']; + } + + public function setProjectId(?int $project_id): void + { + $this->data['project_id'] = $project_id; + } + + public function getProjectId(): ?int + { + return $this->data['project_id']; + } + + /** + * This object is only available in document type RECURRING. + */ + public function setRecurringOptions(DocumentRecurring $recurring_options): void + { + $this->data['recurring_options'] = $recurring_options; + } + + public function getRecurringOptions(): DocumentRecurring + { + return $this->data['recurring_options']; + } + + /** + * Reference document id. + */ + public function setRefId(?int $ref_id): void + { + $this->data['ref_id'] = $ref_id; + } + + public function getRefId(): ?int + { + return $this->data['ref_id']; + } + + /** + * This object is only available in document type INVOICE or CREDIT. + */ + public function setServiceDate(ServiceDate $service_date): void + { + $this->data['service_date'] = $service_date; + } + + public function getServiceDate(): ServiceDate + { + return $this->data['service_date']; + } + + public function setShippingCountry(?string $shipping_country): void + { + $this->data['shipping_country'] = $shipping_country; + } + + public function getShippingCountry(): ?string + { + return $this->data['shipping_country']; + } + + /** + * This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set. + */ + public function setStatus(?string $status): void + { + $this->data['status'] = $status; + } + + public function getStatus(): ?string + { + return $this->data['status']; + } + + public function setText(string $text): void + { + $this->data['text'] = $text; + } + + public function getText(): string + { + return $this->data['text']; + } + + public function setTextPrefix(string $text_prefix): void + { + $this->data['text_prefix'] = $text_prefix; + } + + public function getTextPrefix(): string + { + return $this->data['text_prefix']; + } + + /** + * Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null. + */ + public function setTextTax(?string $text_tax): void + { + $this->data['text_tax'] = $text_tax; + } + + public function getTextTax(): ?string + { + return $this->data['text_tax']; + } + + public function setTitle(?string $title): void + { + $this->data['title'] = $title; + } + + public function getTitle(): ?string + { + return $this->data['title']; + } + + /** + * Can only set on create. + */ + public function setType(string $type): void + { + $this->data['type'] = $type; + } + + public function getType(): string + { + return $this->data['type']; + } + + /** + * If true and customer has shipping address then it will be used. + */ + public function setUseShippingAddress(bool $use_shipping_address): void + { + $this->data['use_shipping_address'] = $use_shipping_address; + } + + public function getUseShippingAddress(): bool + { + return $this->data['use_shipping_address']; + } + + public function setVatCountry(?string $vat_country): void + { + $this->data['vat_country'] = $vat_country; + } + + public function getVatCountry(): ?string + { + return $this->data['vat_country']; + } + + public function getVatId(): string + { + return $this->data['vat_id']; + } + + public function setFulfillmentCountry(?string $fulfillment_country): void + { + $this->data['fulfillment_country'] = $fulfillment_country; + } + + public function getFulfillmentCountry(): ?string + { + return $this->data['fulfillment_country']; + } + + /** + * NULL: Normal steuerbar
nStb: Nicht steuerbar (Drittland)
nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)
nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)
nStbIm: Nicht steuerbarer Innenumsatz
revc: Steuerschuldwechsel §13b (Inland)
IG: Innergemeinschaftliche Lieferung
AL: Ausfuhrlieferung
sStfr: sonstige Steuerbefreiung
smallBusiness: Kleinunternehmen (Keine MwSt.). + */ + public function setVatOption(?string $vat_option): void + { + $this->data['vat_option'] = $vat_option; + } + + public function getVatOption(): ?string + { + return $this->data['vat_option']; + } +} diff --git a/src/Models/DocumentAddress.php b/src/Models/DocumentAddress.php new file mode 100644 index 0000000..44d1cb5 --- /dev/null +++ b/src/Models/DocumentAddress.php @@ -0,0 +1,85 @@ +data; + } + + public function getSalutation(): int + { + return $this->data['salutation']; + } + + public function getPersonal(): bool + { + return $this->data['personal']; + } + + public function getTitle(): string + { + return $this->data['title']; + } + + public function getFirstName(): string + { + return $this->data['first_name']; + } + + public function getLastName(): string + { + return $this->data['last_name']; + } + + public function getSuffix1(): string + { + return $this->data['suffix_1']; + } + + public function getSuffix2(): string + { + return $this->data['suffix_2']; + } + + public function getCompanyName(): string + { + return $this->data['company_name']; + } + + public function getStreet(): string + { + return $this->data['street']; + } + + public function getZipCode(): string + { + return $this->data['zip_code']; + } + + public function getCity(): string + { + return $this->data['city']; + } + + public function getState(): string + { + return $this->data['state']; + } + + public function getCountry(): string + { + return $this->data['country']; + } +} diff --git a/src/Models/DocumentPayment.php b/src/Models/DocumentPayment.php new file mode 100644 index 0000000..632c2ae --- /dev/null +++ b/src/Models/DocumentPayment.php @@ -0,0 +1,110 @@ +data; + } + + public function setAmount(int $amount): void + { + $this->data['amount'] = $amount; + } + + public function getAmount(): int + { + return $this->data['amount']; + } + + public function setDocumentId(int $document_id): void + { + $this->data['document_id'] = $document_id; + } + + public function getDocumentId(): int + { + return $this->data['document_id']; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setIsOverdueFee(bool $is_overdue_fee): void + { + $this->data['is_overdue_fee'] = $is_overdue_fee; + } + + public function getIsOverdueFee(): bool + { + return $this->data['is_overdue_fee']; + } + + public function getLoginId(): int + { + return $this->data['login_id']; + } + + public function setNotice(string $notice): void + { + $this->data['notice'] = $notice; + } + + public function getNotice(): string + { + return $this->data['notice']; + } + + public function setPaymentAt(string $payment_at): void + { + $this->data['payment_at'] = $payment_at; + } + + public function getPaymentAt(): string + { + return $this->data['payment_at']; + } + + public function setType(string $type): void + { + $this->data['type'] = $type; + } + + public function getType(): string + { + return $this->data['type']; + } + + public function setProvider(string $provider): void + { + $this->data['provider'] = $provider; + } + + public function getProvider(): string + { + return $this->data['provider']; + } + + public function setReference(string $reference): void + { + $this->data['reference'] = $reference; + } + + public function getReference(): string + { + return $this->data['reference']; + } +} diff --git a/src/Models/DocumentPosition.php b/src/Models/DocumentPosition.php new file mode 100644 index 0000000..5139d0f --- /dev/null +++ b/src/Models/DocumentPosition.php @@ -0,0 +1,262 @@ +data; + } + + public function setNumber(?string $number): void + { + $this->data['number'] = $number; + } + + public function getNumber(): ?string + { + return $this->data['number']; + } + + public function setDescription(?string $description): void + { + $this->data['description'] = $description; + } + + public function getDescription(): ?string + { + return $this->data['description']; + } + + /** + * This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction. + */ + public function setDocumentNote(string $document_note): void + { + $this->data['document_note'] = $document_note; + } + + public function getDocumentNote(): string + { + return $this->data['document_note']; + } + + public function setQuantity(float $quantity): void + { + $this->data['quantity'] = $quantity; + } + + public function getQuantity(): float + { + return $this->data['quantity']; + } + + /** + * Use quantity_str if you want to set a quantity like: 1:30 h or 3x5 m. quantity_str overwrites quantity. + */ + public function setQuantityStr(string $quantity_str): void + { + $this->data['quantity_str'] = $quantity_str; + } + + public function getQuantityStr(): string + { + return $this->data['quantity_str']; + } + + public function setUnit(?string $unit): void + { + $this->data['unit'] = $unit; + } + + public function getUnit(): ?string + { + return $this->data['unit']; + } + + public function setType(string $type): void + { + $this->data['type'] = $type; + } + + public function getType(): string + { + return $this->data['type']; + } + + /** + * Automatic by default (first item: 1, second item: 2, ...). + */ + public function setPosition(int $position): void + { + $this->data['position'] = $position; + } + + public function getPosition(): int + { + return $this->data['position']; + } + + public function setSinglePriceNet(?float $single_price_net): void + { + $this->data['single_price_net'] = $single_price_net; + } + + public function getSinglePriceNet(): ?float + { + return $this->data['single_price_net']; + } + + public function getSinglePriceGross(): float + { + return $this->data['single_price_gross']; + } + + public function setVatPercent(float $vat_percent): void + { + $this->data['vat_percent'] = $vat_percent; + } + + public function getVatPercent(): float + { + return $this->data['vat_percent']; + } + + public function setDiscount(?float $discount): void + { + $this->data['discount'] = $discount; + } + + public function getDiscount(): ?float + { + return $this->data['discount']; + } + + public function setDiscountType(?string $discount_type): void + { + $this->data['discount_type'] = $discount_type; + } + + public function getDiscountType(): ?string + { + return $this->data['discount_type']; + } + + /** + * If set, values are copied from the referenced position. + */ + public function setPositionId(?int $position_id): void + { + $this->data['position_id'] = $position_id; + } + + public function getPositionId(): ?int + { + return $this->data['position_id']; + } + + public function getTotalPriceNet(): float + { + return $this->data['total_price_net']; + } + + public function getTotalPriceGross(): float + { + return $this->data['total_price_gross']; + } + + public function getTotalVat(): float + { + return $this->data['total_vat']; + } + + public function getSerialNumberId(): string + { + return $this->data['serial_number_id']; + } + + public function getSerialNumber(): string + { + return $this->data['serial_number']; + } + + public function setBookingAccount(?string $booking_account): void + { + $this->data['booking_account'] = $booking_account; + } + + public function getBookingAccount(): ?string + { + return $this->data['booking_account']; + } + + public function setExportCost1(?string $export_cost_1): void + { + $this->data['export_cost_1'] = $export_cost_1; + } + + public function getExportCost1(): ?string + { + return $this->data['export_cost_1']; + } + + public function setExportCost2(?string $export_cost_2): void + { + $this->data['export_cost_2'] = $export_cost_2; + } + + public function getExportCost2(): ?string + { + return $this->data['export_cost_2']; + } + + public function setCostPriceNet(?float $cost_price_net): void + { + $this->data['cost_price_net'] = $cost_price_net; + } + + public function getCostPriceNet(): ?float + { + return $this->data['cost_price_net']; + } + + public function getCostPriceTotal(): float + { + return $this->data['cost_price_total']; + } + + public function getCostPriceCharge(): float + { + return $this->data['cost_price_charge']; + } + + public function getCostPriceChargeType(): string + { + return $this->data['cost_price_charge_type']; + } + + public function setItemType(string $itemType): void + { + $this->data['itemType'] = $itemType; + } + + public function getItemType(): string + { + return $this->data['itemType']; + } + + public function getId(): int + { + return $this->data['id']; + } +} diff --git a/src/Models/DocumentRecurring.php b/src/Models/DocumentRecurring.php new file mode 100644 index 0000000..9ccdda6 --- /dev/null +++ b/src/Models/DocumentRecurring.php @@ -0,0 +1,212 @@ +data; + } + + /** + * Must be in the future. + */ + public function setNextDate(string $next_date): void + { + $this->data['next_date'] = $next_date; + } + + public function getNextDate(): string + { + return $this->data['next_date']; + } + + public function setFrequency(string $frequency): void + { + $this->data['frequency'] = $frequency; + } + + public function getFrequency(): string + { + return $this->data['frequency']; + } + + public function setFrequencySpecial(?string $frequency_special): void + { + $this->data['frequency_special'] = $frequency_special; + } + + public function getFrequencySpecial(): ?string + { + return $this->data['frequency_special']; + } + + public function setInterval(int $interval): void + { + $this->data['interval'] = $interval; + } + + public function getInterval(): int + { + return $this->data['interval']; + } + + /** + * Date of last exectution day or number of times to exectute. + */ + public function setEndDateOrCount(?string $end_date_or_count): void + { + $this->data['end_date_or_count'] = $end_date_or_count; + } + + public function getEndDateOrCount(): ?string + { + return $this->data['end_date_or_count']; + } + + public function setStatus(string $status): void + { + $this->data['status'] = $status; + } + + public function getStatus(): string + { + return $this->data['status']; + } + + public function setAsDraft(bool $as_draft): void + { + $this->data['as_draft'] = $as_draft; + } + + public function getAsDraft(): bool + { + return $this->data['as_draft']; + } + + public function setIsNotify(bool $is_notify): void + { + $this->data['is_notify'] = $is_notify; + } + + public function getIsNotify(): bool + { + return $this->data['is_notify']; + } + + public function setSendAs(?string $send_as): void + { + $this->data['send_as'] = $send_as; + } + + public function getSendAs(): ?string + { + return $this->data['send_as']; + } + + public function setIsSign(bool $is_sign): void + { + $this->data['is_sign'] = $is_sign; + } + + public function getIsSign(): bool + { + return $this->data['is_sign']; + } + + public function setIsPaid(bool $is_paid): void + { + $this->data['is_paid'] = $is_paid; + } + + public function getIsPaid(): bool + { + return $this->data['is_paid']; + } + + /** + * Option is used to determine what date is used for the payment if is_paid is true. "next_valid_date" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday. + */ + public function setPaidDateOption(string $paid_date_option): void + { + $this->data['paid_date_option'] = $paid_date_option; + } + + public function getPaidDateOption(): string + { + return $this->data['paid_date_option']; + } + + public function setIsSepa(bool $is_sepa): void + { + $this->data['is_sepa'] = $is_sepa; + } + + public function getIsSepa(): bool + { + return $this->data['is_sepa']; + } + + public function setSepaLocalInstrument(?string $sepa_local_instrument): void + { + $this->data['sepa_local_instrument'] = $sepa_local_instrument; + } + + public function getSepaLocalInstrument(): ?string + { + return $this->data['sepa_local_instrument']; + } + + public function setSepaSequenceType(?string $sepa_sequence_type): void + { + $this->data['sepa_sequence_type'] = $sepa_sequence_type; + } + + public function getSepaSequenceType(): ?string + { + return $this->data['sepa_sequence_type']; + } + + public function setSepaReference(?string $sepa_reference): void + { + $this->data['sepa_reference'] = $sepa_reference; + } + + public function getSepaReference(): ?string + { + return $this->data['sepa_reference']; + } + + public function setSepaRemittanceInformation(?string $sepa_remittance_information): void + { + $this->data['sepa_remittance_information'] = $sepa_remittance_information; + } + + public function getSepaRemittanceInformation(): ?string + { + return $this->data['sepa_remittance_information']; + } + + /** + * The document type that will be generated. Can not be changed on existing documents. + */ + public function setTargetType(string $target_type): void + { + $this->data['target_type'] = $target_type; + } + + public function getTargetType(): string + { + return $this->data['target_type']; + } +} diff --git a/src/Models/Login.php b/src/Models/Login.php new file mode 100644 index 0000000..908e3bc --- /dev/null +++ b/src/Models/Login.php @@ -0,0 +1,120 @@ +data; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setFirstName(string $first_name): void + { + $this->data['first_name'] = $first_name; + } + + public function getFirstName(): string + { + return $this->data['first_name']; + } + + public function setLastName(string $last_name): void + { + $this->data['last_name'] = $last_name; + } + + public function getLastName(): string + { + return $this->data['last_name']; + } + + public function getDisplayName(): string + { + return $this->data['display_name']; + } + + public function setPhone(string $phone): void + { + $this->data['phone'] = $phone; + } + + public function getPhone(): string + { + return $this->data['phone']; + } + + public function setEmail(string $email): void + { + $this->data['email'] = $email; + } + + public function getEmail(): string + { + return $this->data['email']; + } + + public function setEmailSignature(string $email_signature): void + { + $this->data['email_signature'] = $email_signature; + } + + public function getEmailSignature(): string + { + return $this->data['email_signature']; + } + + public function setLoginType(string $login_type): void + { + $this->data['login_type'] = $login_type; + } + + public function getLoginType(): string + { + return $this->data['login_type']; + } + + public function setLocale(string $locale): void + { + $this->data['locale'] = $locale; + } + + public function getLocale(): string + { + return $this->data['locale']; + } + + public function setTimeZone(string $time_zone): void + { + $this->data['time_zone'] = $time_zone; + } + + public function getTimeZone(): string + { + return $this->data['time_zone']; + } + + public function setSecurity(LoginSecurity $security): void + { + $this->data['security'] = $security; + } + + public function getSecurity(): LoginSecurity + { + return $this->data['security']; + } +} diff --git a/src/Models/LoginSecurity.php b/src/Models/LoginSecurity.php new file mode 100644 index 0000000..a424d2c --- /dev/null +++ b/src/Models/LoginSecurity.php @@ -0,0 +1,36 @@ +data; + } + + public function getTwoFactorEnabled(): bool + { + return $this->data['two_factor_enabled']; + } + + public function getRecoveryCodesEnabled(): bool + { + return $this->data['recovery_codes_enabled']; + } + + public function getNotifyOnNewLoginEnabled(): bool + { + return $this->data['notify_on_new_login_enabled']; + } +} diff --git a/src/Models/PDFTemplate.php b/src/Models/PDFTemplate.php new file mode 100644 index 0000000..cd78a4d --- /dev/null +++ b/src/Models/PDFTemplate.php @@ -0,0 +1,60 @@ +data; + } + + public function setId(string $id): void + { + $this->data['id'] = $id; + } + + public function getId(): string + { + return $this->data['id']; + } + + public function setName(string $name): void + { + $this->data['name'] = $name; + } + + public function getName(): string + { + return $this->data['name']; + } + + public function setPdfTemplate(string $pdf_template): void + { + $this->data['pdf_template'] = $pdf_template; + } + + public function getPdfTemplate(): string + { + return $this->data['pdf_template']; + } + + public function setDocumentType(string $document_type): void + { + $this->data['document_type'] = $document_type; + } + + public function getDocumentType(): string + { + return $this->data['document_type']; + } +} diff --git a/src/Models/Position.php b/src/Models/Position.php new file mode 100644 index 0000000..246efbf --- /dev/null +++ b/src/Models/Position.php @@ -0,0 +1,382 @@ +data; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setType(string $type): void + { + $this->data['type'] = $type; + } + + public function getType(): string + { + return $this->data['type']; + } + + public function setNumber(string $number): void + { + $this->data['number'] = $number; + } + + public function getNumber(): string + { + return $this->data['number']; + } + + /** + * The positions name or description. + */ + public function setDescription(string $description): void + { + $this->data['description'] = $description; + } + + public function getDescription(): string + { + return $this->data['description']; + } + + /** + * This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction. + */ + public function setDocumentNote(string $document_note): void + { + $this->data['document_note'] = $document_note; + } + + public function getDocumentNote(): string + { + return $this->data['document_note']; + } + + /** + * Note for internal use. + */ + public function setNote(?string $note): void + { + $this->data['note'] = $note; + } + + public function getNote(): ?string + { + return $this->data['note']; + } + + public function setUnit(?string $unit): void + { + $this->data['unit'] = $unit; + } + + public function getUnit(): ?string + { + return $this->data['unit']; + } + + /** + * The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant. + */ + public function setExportIdentifier(?string $export_identifier): void + { + $this->data['export_identifier'] = $export_identifier; + } + + public function getExportIdentifier(): ?string + { + return $this->data['export_identifier']; + } + + public function setExportIdentifierExtended(\stdClass $export_identifier_extended): void + { + $this->data['export_identifier_extended'] = $export_identifier_extended; + } + + public function getExportIdentifierExtended(): \stdClass + { + return $this->data['export_identifier_extended']; + } + + public function getLoginId(): int + { + return $this->data['login_id']; + } + + public function setPriceType(string $price_type): void + { + $this->data['price_type'] = $price_type; + } + + public function getPriceType(): string + { + return $this->data['price_type']; + } + + public function setVatPercent(float $vat_percent): void + { + $this->data['vat_percent'] = $vat_percent; + } + + public function getVatPercent(): float + { + return $this->data['vat_percent']; + } + + /** + * Price in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice(float $sale_price): void + { + $this->data['sale_price'] = $sale_price; + } + + public function getSalePrice(): float + { + return $this->data['sale_price']; + } + + /** + * Price for customers of group 2 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice2(?float $sale_price2): void + { + $this->data['sale_price2'] = $sale_price2; + } + + public function getSalePrice2(): ?float + { + return $this->data['sale_price2']; + } + + /** + * Price for customers of group 3 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice3(?float $sale_price3): void + { + $this->data['sale_price3'] = $sale_price3; + } + + public function getSalePrice3(): ?float + { + return $this->data['sale_price3']; + } + + /** + * Price for customers of group 4 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice4(?float $sale_price4): void + { + $this->data['sale_price4'] = $sale_price4; + } + + public function getSalePrice4(): ?float + { + return $this->data['sale_price4']; + } + + /** + * Price for customers of group 5 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice5(?float $sale_price5): void + { + $this->data['sale_price5'] = $sale_price5; + } + + public function getSalePrice5(): ?float + { + return $this->data['sale_price5']; + } + + /** + * Price for customers of group 6 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice6(?float $sale_price6): void + { + $this->data['sale_price6'] = $sale_price6; + } + + public function getSalePrice6(): ?float + { + return $this->data['sale_price6']; + } + + /** + * Price for customers of group 7 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice7(?float $sale_price7): void + { + $this->data['sale_price7'] = $sale_price7; + } + + public function getSalePrice7(): ?float + { + return $this->data['sale_price7']; + } + + /** + * Price for customers of group 8 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice8(?float $sale_price8): void + { + $this->data['sale_price8'] = $sale_price8; + } + + public function getSalePrice8(): ?float + { + return $this->data['sale_price8']; + } + + /** + * Price for customers of group 9 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice9(?float $sale_price9): void + { + $this->data['sale_price9'] = $sale_price9; + } + + public function getSalePrice9(): ?float + { + return $this->data['sale_price9']; + } + + /** + * Price for customers of group 10 in cents (e.g. "150" = 1.50€). + */ + public function setSalePrice10(?float $sale_price10): void + { + $this->data['sale_price10'] = $sale_price10; + } + + public function getSalePrice10(): ?float + { + return $this->data['sale_price10']; + } + + /** + * Price in cents (e.g. "150" = 1.50€). + */ + public function setCostPrice(?float $cost_price): void + { + $this->data['cost_price'] = $cost_price; + } + + public function getCostPrice(): ?float + { + return $this->data['cost_price']; + } + + public function setExportCost1(?string $export_cost1): void + { + $this->data['export_cost1'] = $export_cost1; + } + + public function getExportCost1(): ?string + { + return $this->data['export_cost1']; + } + + public function setExportCost2(?string $export_cost2): void + { + $this->data['export_cost2'] = $export_cost2; + } + + public function getExportCost2(): ?string + { + return $this->data['export_cost2']; + } + + public function setGroupId(?int $group_id): void + { + $this->data['group_id'] = $group_id; + } + + public function getGroupId(): ?int + { + return $this->data['group_id']; + } + + /** + * Activates stock management for this position. + */ + public function setStock(string $stock): void + { + $this->data['stock'] = $stock; + } + + public function getStock(): string + { + return $this->data['stock']; + } + + public function getStockCount(): int + { + return $this->data['stock_count']; + } + + /** + * Notify when stock_count is lower than stock_limit. + */ + public function setStockLimitNotify(bool $stock_limit_notify): void + { + $this->data['stock_limit_notify'] = $stock_limit_notify; + } + + public function getStockLimitNotify(): bool + { + return $this->data['stock_limit_notify']; + } + + /** + * Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE). + */ + public function setStockLimitNotifyFrequency(string $stock_limit_notify_frequency): void + { + $this->data['stock_limit_notify_frequency'] = $stock_limit_notify_frequency; + } + + public function getStockLimitNotifyFrequency(): string + { + return $this->data['stock_limit_notify_frequency']; + } + + public function setStockLimit(int $stock_limit): void + { + $this->data['stock_limit'] = $stock_limit; + } + + public function getStockLimit(): int + { + return $this->data['stock_limit']; + } + + /** + * Used as the default quantity when adding this position to a document. + */ + public function setQuantity(?float $quantity): void + { + $this->data['quantity'] = $quantity; + } + + public function getQuantity(): ?float + { + return $this->data['quantity']; + } +} diff --git a/src/Models/PositionGroup.php b/src/Models/PositionGroup.php new file mode 100644 index 0000000..5b5bb3e --- /dev/null +++ b/src/Models/PositionGroup.php @@ -0,0 +1,65 @@ +data; + } + + public function setDescription(?string $description): void + { + $this->data['description'] = $description; + } + + public function getDescription(): ?string + { + return $this->data['description']; + } + + public function getLoginId(): int + { + return $this->data['login_id']; + } + + public function setName(string $name): void + { + $this->data['name'] = $name; + } + + public function getName(): string + { + return $this->data['name']; + } + + public function setNumber(string $number): void + { + $this->data['number'] = $number; + } + + public function getNumber(): string + { + return $this->data['number']; + } + + public function getDisplayName(): string + { + return $this->data['display_name']; + } + + public function getId(): int + { + return $this->data['id']; + } +} diff --git a/src/Models/PostBox.php b/src/Models/PostBox.php new file mode 100644 index 0000000..221d0ca --- /dev/null +++ b/src/Models/PostBox.php @@ -0,0 +1,206 @@ +data; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setDocumentId(int $document_id): void + { + $this->data['document_id'] = $document_id; + } + + public function getDocumentId(): int + { + return $this->data['document_id']; + } + + public function setTo(string $to): void + { + $this->data['to'] = $to; + } + + public function getTo(): string + { + return $this->data['to']; + } + + public function setCc(string $cc): void + { + $this->data['cc'] = $cc; + } + + public function getCc(): string + { + return $this->data['cc']; + } + + public function setFrom(string $from): void + { + $this->data['from'] = $from; + } + + public function getFrom(): string + { + return $this->data['from']; + } + + public function setSubject(string $subject): void + { + $this->data['subject'] = $subject; + } + + public function getSubject(): string + { + return $this->data['subject']; + } + + public function setMessage(string $message): void + { + $this->data['message'] = $message; + } + + public function getMessage(): string + { + return $this->data['message']; + } + + public function setDate(string $date): void + { + $this->data['date'] = $date; + } + + public function getDate(): string + { + return $this->data['date']; + } + + public function setCreatedAt(string $created_at): void + { + $this->data['created_at'] = $created_at; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + public function setProcessedAt(string $processed_at): void + { + $this->data['processed_at'] = $processed_at; + } + + public function getProcessedAt(): string + { + return $this->data['processed_at']; + } + + public function setSendBySelf(bool $send_by_self): void + { + $this->data['send_by_self'] = $send_by_self; + } + + public function getSendBySelf(): bool + { + return $this->data['send_by_self']; + } + + public function setSendWithAttachment(bool $send_with_attachment): void + { + $this->data['send_with_attachment'] = $send_with_attachment; + } + + public function getSendWithAttachment(): bool + { + return $this->data['send_with_attachment']; + } + + public function setType(string $type): void + { + $this->data['type'] = $type; + } + + public function getType(): string + { + return $this->data['type']; + } + + public function setStatus(string $status): void + { + $this->data['status'] = $status; + } + + public function getStatus(): string + { + return $this->data['status']; + } + + public function setStatusMsg(string $status_msg): void + { + $this->data['status_msg'] = $status_msg; + } + + public function getStatusMsg(): string + { + return $this->data['status_msg']; + } + + public function getLoginId(): int + { + return $this->data['login_id']; + } + + public function setDocumentFileType(?string $document_file_type): void + { + $this->data['document_file_type'] = $document_file_type; + } + + public function getDocumentFileType(): ?string + { + return $this->data['document_file_type']; + } + + /** + * This value indicates what method is used when the document is send via mail. + * The different types are offered by the german post as additional services. + * The registered mail options will include a tracking number which will be + * added to the postbox when known. + * + * If the value is omitted or empty when a postbox is created with the type "POST" + * post_send_type_standard will be used. + * + * For postbox with a different type than "POST" this field will hold a empty string. + */ + public function setPostSendType(string $post_send_type): void + { + $this->data['post_send_type'] = $post_send_type; + } + + public function getPostSendType(): string + { + return $this->data['post_send_type']; + } + + public function getTrackingIdentifier(): string + { + return $this->data['tracking_identifier']; + } +} diff --git a/src/Models/PostBoxRequest.php b/src/Models/PostBoxRequest.php new file mode 100644 index 0000000..a3f3495 --- /dev/null +++ b/src/Models/PostBoxRequest.php @@ -0,0 +1,114 @@ +data; + } + + public function setTo(string $to): void + { + $this->data['to'] = $to; + } + + public function getTo(): string + { + return $this->data['to']; + } + + public function setCc(string $cc): void + { + $this->data['cc'] = $cc; + } + + public function getCc(): string + { + return $this->data['cc']; + } + + public function setFrom(string $from): void + { + $this->data['from'] = $from; + } + + public function getFrom(): string + { + return $this->data['from']; + } + + public function setSubject(string $subject): void + { + $this->data['subject'] = $subject; + } + + public function getSubject(): string + { + return $this->data['subject']; + } + + public function setMessage(string $message): void + { + $this->data['message'] = $message; + } + + public function getMessage(): string + { + return $this->data['message']; + } + + public function setDate(string $date): void + { + $this->data['date'] = $date; + } + + public function getDate(): string + { + return $this->data['date']; + } + + /** + * When set to null, the setting on the customer is used. + */ + public function setDocumentFileType(?string $document_file_type): void + { + $this->data['document_file_type'] = $document_file_type; + } + + public function getDocumentFileType(): ?string + { + return $this->data['document_file_type']; + } + + /** + * This value indicates what method is used when the document is send via mail. + * The different types are offered by the german post as additional services. + * The registered mail options will include a tracking number which will be + * added to the postbox when known. + * + * If the value is omitted or empty when a postbox is created with the type "POST" + * post_send_type_standard will be used. + * + * For postbox with a different type than "POST" this field will hold a empty string. + */ + public function setPostSendType(string $post_send_type): void + { + $this->data['post_send_type'] = $post_send_type; + } + + public function getPostSendType(): string + { + return $this->data['post_send_type']; + } +} diff --git a/src/Models/Project.php b/src/Models/Project.php new file mode 100644 index 0000000..3ab3e31 --- /dev/null +++ b/src/Models/Project.php @@ -0,0 +1,147 @@ +data; + } + + /** + * Project budget in cents (e.g. "150" = 1.50€). + */ + public function setBudgetAmount(int $budget_amount): void + { + $this->data['budget_amount'] = $budget_amount; + } + + public function getBudgetAmount(): int + { + return $this->data['budget_amount']; + } + + /** + * Time budget in minutes (e.g. "90" = 1 hour and 30 minutes). + */ + public function setBudgetTime(int $budget_time): void + { + $this->data['budget_time'] = $budget_time; + } + + public function getBudgetTime(): int + { + return $this->data['budget_time']; + } + + public function setCustomerId(?int $customer_id): void + { + $this->data['customer_id'] = $customer_id; + } + + public function getCustomerId(): ?int + { + return $this->data['customer_id']; + } + + /** + * Hourly rate in cents (e.g. "150" = 1.50€). + */ + public function setHourlyRate(float $hourly_rate): void + { + $this->data['hourly_rate'] = $hourly_rate; + } + + public function getHourlyRate(): float + { + return $this->data['hourly_rate']; + } + + public function getId(): int + { + return $this->data['id']; + } + + /** + * If omitted or null, the currently active login is used. + */ + public function setLoginId(?int $login_id): void + { + $this->data['login_id'] = $login_id; + } + + public function getLoginId(): ?int + { + return $this->data['login_id']; + } + + public function setName(string $name): void + { + $this->data['name'] = $name; + } + + public function getName(): string + { + return $this->data['name']; + } + + public function setNote(?string $note): void + { + $this->data['note'] = $note; + } + + public function getNote(): ?string + { + return $this->data['note']; + } + + public function setStatus(string $status): void + { + $this->data['status'] = $status; + } + + public function getStatus(): string + { + return $this->data['status']; + } + + public function setDueAt(?string $due_at): void + { + $this->data['due_at'] = $due_at; + } + + public function getDueAt(): ?string + { + return $this->data['due_at']; + } + + public function setBudgetNotifyFrequency(string $budget_notify_frequency): void + { + $this->data['budget_notify_frequency'] = $budget_notify_frequency; + } + + public function getBudgetNotifyFrequency(): string + { + return $this->data['budget_notify_frequency']; + } + + public function getConsumedTime(): int + { + return $this->data['consumed_time']; + } + + public function getConsumedAmount(): int + { + return $this->data['consumed_amount']; + } +} diff --git a/src/Models/SEPAPayment.php b/src/Models/SEPAPayment.php new file mode 100644 index 0000000..0d8eb2d --- /dev/null +++ b/src/Models/SEPAPayment.php @@ -0,0 +1,282 @@ +data; + } + + /** + * Amount in cents (e.g. "150" = 1.50€). + */ + public function setAmount(int $amount): void + { + $this->data['amount'] = $amount; + } + + public function getAmount(): int + { + return $this->data['amount']; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + /** + * If type is DEBIT, this field is overwritten with the selected bank account data on export. + */ + public function setCreditorBic(?string $creditor_bic): void + { + $this->data['creditor_bic'] = $creditor_bic; + } + + public function getCreditorBic(): ?string + { + return $this->data['creditor_bic']; + } + + /** + * Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export. + */ + public function setCreditorIban(?string $creditor_iban): void + { + $this->data['creditor_iban'] = $creditor_iban; + } + + public function getCreditorIban(): ?string + { + return $this->data['creditor_iban']; + } + + /** + * Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export. + */ + public function setCreditorName(?string $creditor_name): void + { + $this->data['creditor_name'] = $creditor_name; + } + + public function getCreditorName(): ?string + { + return $this->data['creditor_name']; + } + + /** + * If type is CREDIT, this field is overwritten with the selected bank account data on export. + */ + public function setDebitorBic(?string $debitor_bic): void + { + $this->data['debitor_bic'] = $debitor_bic; + } + + public function getDebitorBic(): ?string + { + return $this->data['debitor_bic']; + } + + /** + * Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export. + */ + public function setDebitorIban(?string $debitor_iban): void + { + $this->data['debitor_iban'] = $debitor_iban; + } + + public function getDebitorIban(): ?string + { + return $this->data['debitor_iban']; + } + + /** + * Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export. + */ + public function setDebitorName(?string $debitor_name): void + { + $this->data['debitor_name'] = $debitor_name; + } + + public function getDebitorName(): ?string + { + return $this->data['debitor_name']; + } + + /** + * Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA. + */ + public function setDebitorAddressLine1(string $debitor_address_line_1): void + { + $this->data['debitor_address_line_1'] = $debitor_address_line_1; + } + + public function getDebitorAddressLine1(): string + { + return $this->data['debitor_address_line_1']; + } + + /** + * string. + */ + public function setDebitorAddressLine2(string $debitor_address_line2): void + { + $this->data['debitor_address_line2'] = $debitor_address_line2; + } + + public function getDebitorAddressLine2(): string + { + return $this->data['debitor_address_line2']; + } + + /** + * Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA. + */ + public function setDebitorCountry(string $debitor_country): void + { + $this->data['debitor_country'] = $debitor_country; + } + + public function getDebitorCountry(): string + { + return $this->data['debitor_country']; + } + + public function setDocumentId(int $document_id): void + { + $this->data['document_id'] = $document_id; + } + + public function getDocumentId(): int + { + return $this->data['document_id']; + } + + /** + * If a date is set, this record is marked as exported. + */ + public function setExportAt(?string $export_at): void + { + $this->data['export_at'] = $export_at; + } + + public function getExportAt(): ?string + { + return $this->data['export_at']; + } + + public function getExportError(): string + { + return $this->data['export_error']; + } + + public function getId(): int + { + return $this->data['id']; + } + + /** + * CORE: SEPA Core Direct Debit
COR1: SEPA-Basislastschrift COR1
B2B: SEPA Business to Business Direct Debit. + */ + public function setLocalInstrument(string $local_instrument): void + { + $this->data['local_instrument'] = $local_instrument; + } + + public function getLocalInstrument(): string + { + return $this->data['local_instrument']; + } + + public function setMandateDateOfSignature(string $mandate_date_of_signature): void + { + $this->data['mandate_date_of_signature'] = $mandate_date_of_signature; + } + + public function getMandateDateOfSignature(): string + { + return $this->data['mandate_date_of_signature']; + } + + public function setMandateId(string $mandate_id): void + { + $this->data['mandate_id'] = $mandate_id; + } + + public function getMandateId(): string + { + return $this->data['mandate_id']; + } + + public function setReference(string $reference): void + { + $this->data['reference'] = $reference; + } + + public function getReference(): string + { + return $this->data['reference']; + } + + public function setRemittanceInformation(?string $remittance_information): void + { + $this->data['remittance_information'] = $remittance_information; + } + + public function getRemittanceInformation(): ?string + { + return $this->data['remittance_information']; + } + + /** + * Booking date. + */ + public function setRequestedAt(string $requested_at): void + { + $this->data['requested_at'] = $requested_at; + } + + public function getRequestedAt(): string + { + return $this->data['requested_at']; + } + + /** + * FRST: Erstlastschrift
RCUR: Folgelastschrift
OOFF: Einmallastschrift
FNAL: Letztmalige Lastschrift. + */ + public function setSequenceType(string $sequence_type): void + { + $this->data['sequence_type'] = $sequence_type; + } + + public function getSequenceType(): string + { + return $this->data['sequence_type']; + } + + public function getUpdatedAt(): string + { + return $this->data['updated_at']; + } + + public function setType(string $type): void + { + $this->data['type'] = $type; + } + + public function getType(): string + { + return $this->data['type']; + } +} diff --git a/src/Models/SerialNumber.php b/src/Models/SerialNumber.php new file mode 100644 index 0000000..655b8dd --- /dev/null +++ b/src/Models/SerialNumber.php @@ -0,0 +1,65 @@ +data; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setSerialNumber(string $serial_number): void + { + $this->data['serial_number'] = $serial_number; + } + + public function getSerialNumber(): string + { + return $this->data['serial_number']; + } + + public function setPositionId(int $position_id): void + { + $this->data['position_id'] = $position_id; + } + + public function getPositionId(): int + { + return $this->data['position_id']; + } + + public function getDocumentId(): ?int + { + return $this->data['document_id']; + } + + public function getDocumentPositionId(): ?int + { + return $this->data['document_position_id']; + } + + public function getUsedAt(): ?string + { + return $this->data['used_at']; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } +} diff --git a/src/Models/ServiceDate.php b/src/Models/ServiceDate.php new file mode 100644 index 0000000..3a87a3a --- /dev/null +++ b/src/Models/ServiceDate.php @@ -0,0 +1,73 @@ +data; + } + + /** + * With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.
For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text. + */ + public function setType(string $type): void + { + $this->data['type'] = $type; + } + + public function getType(): string + { + return $this->data['type']; + } + + public function setDate(?string $date): void + { + $this->data['date'] = $date; + } + + public function getDate(): ?string + { + return $this->data['date']; + } + + public function setDateFrom(?string $date_from): void + { + $this->data['date_from'] = $date_from; + } + + public function getDateFrom(): ?string + { + return $this->data['date_from']; + } + + public function setDateTo(?string $date_to): void + { + $this->data['date_to'] = $date_to; + } + + public function getDateTo(): ?string + { + return $this->data['date_to']; + } + + public function setText(?string $text): void + { + $this->data['text'] = $text; + } + + public function getText(): ?string + { + return $this->data['text']; + } +} diff --git a/src/Models/Stock.php b/src/Models/Stock.php new file mode 100644 index 0000000..37cf28e --- /dev/null +++ b/src/Models/Stock.php @@ -0,0 +1,85 @@ +data; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setNote(string $note): void + { + $this->data['note'] = $note; + } + + public function getNote(): string + { + return $this->data['note']; + } + + public function setStockCount(int $stock_count): void + { + $this->data['stock_count'] = $stock_count; + } + + public function getStockCount(): int + { + return $this->data['stock_count']; + } + + public function setPositionId(int $position_id): void + { + $this->data['position_id'] = $position_id; + } + + public function getPositionId(): int + { + return $this->data['position_id']; + } + + public function getDocumentId(): ?int + { + return $this->data['document_id']; + } + + public function getDocumentPositionId(): ?int + { + return $this->data['document_position_id']; + } + + public function setStoredAt(?string $stored_at): void + { + $this->data['stored_at'] = $stored_at; + } + + public function getStoredAt(): ?string + { + return $this->data['stored_at']; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + public function getUpdatedAt(): string + { + return $this->data['updated_at']; + } +} diff --git a/src/Models/Task.php b/src/Models/Task.php new file mode 100644 index 0000000..d4d7c7a --- /dev/null +++ b/src/Models/Task.php @@ -0,0 +1,184 @@ +data; + } + + public function setCategory(?string $category): void + { + $this->data['category'] = $category; + } + + public function getCategory(): ?string + { + return $this->data['category']; + } + + /** + * The name of your custom category. Can only have a value if "category" is "CUSTOM". + */ + public function setCategoryCustom(?string $category_custom): void + { + $this->data['category_custom'] = $category_custom; + } + + public function getCategoryCustom(): ?string + { + return $this->data['category_custom']; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + public function setCustomerId(?int $customer_id): void + { + $this->data['customer_id'] = $customer_id; + } + + public function getCustomerId(): ?int + { + return $this->data['customer_id']; + } + + public function setDescription(?string $description): void + { + $this->data['description'] = $description; + } + + public function getDescription(): ?string + { + return $this->data['description']; + } + + public function setDocumentId(?int $document_id): void + { + $this->data['document_id'] = $document_id; + } + + public function getDocumentId(): ?int + { + return $this->data['document_id']; + } + + /** + * The deadline. + */ + public function setEndAt(?string $end_at): void + { + $this->data['end_at'] = $end_at; + } + + public function getEndAt(): ?string + { + return $this->data['end_at']; + } + + public function getFinishAt(): ?string + { + return $this->data['finish_at']; + } + + public function getId(): int + { + return $this->data['id']; + } + + /** + * When omitted or null, the currently active login is used. + */ + public function setLoginId(?int $login_id): void + { + $this->data['login_id'] = $login_id; + } + + public function getLoginId(): ?int + { + return $this->data['login_id']; + } + + public function setName(string $name): void + { + $this->data['name'] = $name; + } + + public function getName(): string + { + return $this->data['name']; + } + + public function setPositionId(?int $position_id): void + { + $this->data['position_id'] = $position_id; + } + + public function getPositionId(): ?int + { + return $this->data['position_id']; + } + + public function setPriority(string $priority): void + { + $this->data['priority'] = $priority; + } + + public function getPriority(): string + { + return $this->data['priority']; + } + + public function setProjectId(?int $project_id): void + { + $this->data['project_id'] = $project_id; + } + + public function getProjectId(): ?int + { + return $this->data['project_id']; + } + + public function setStartAt(?string $start_at): void + { + $this->data['start_at'] = $start_at; + } + + public function getStartAt(): ?string + { + return $this->data['start_at']; + } + + public function setStatus(string $status): void + { + $this->data['status'] = $status; + } + + public function getStatus(): string + { + return $this->data['status']; + } + + public function setStatusPercent(?int $status_percent): void + { + $this->data['status_percent'] = $status_percent; + } + + public function getStatusPercent(): ?int + { + return $this->data['status_percent']; + } +} diff --git a/src/Models/TextTemplate.php b/src/Models/TextTemplate.php new file mode 100644 index 0000000..2eaf587 --- /dev/null +++ b/src/Models/TextTemplate.php @@ -0,0 +1,50 @@ +data; + } + + public function getCanModify(): bool + { + return $this->data['can_modify']; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setText(string $text): void + { + $this->data['text'] = $text; + } + + public function getText(): string + { + return $this->data['text']; + } + + public function setTitle(string $title): void + { + $this->data['title'] = $title; + } + + public function getTitle(): string + { + return $this->data['title']; + } +} diff --git a/src/Models/TimeTracking.php b/src/Models/TimeTracking.php new file mode 100644 index 0000000..493c789 --- /dev/null +++ b/src/Models/TimeTracking.php @@ -0,0 +1,152 @@ +data; + } + + public function setClearedAt(?string $cleared_at): void + { + $this->data['cleared_at'] = $cleared_at; + } + + public function getClearedAt(): ?string + { + return $this->data['cleared_at']; + } + + public function getCreatedAt(): string + { + return $this->data['created_at']; + } + + public function setDateFromAt(?string $date_from_at): void + { + $this->data['date_from_at'] = $date_from_at; + } + + public function getDateFromAt(): ?string + { + return $this->data['date_from_at']; + } + + public function setDateThruAt(?string $date_thru_at): void + { + $this->data['date_thru_at'] = $date_thru_at; + } + + public function getDateThruAt(): ?string + { + return $this->data['date_thru_at']; + } + + public function setDescription(string $description): void + { + $this->data['description'] = $description; + } + + public function getDescription(): string + { + return $this->data['description']; + } + + /** + * Hourly rate in cents (e.g. "150" = 1.50€). + */ + public function setHourlyRate(float $hourly_rate): void + { + $this->data['hourly_rate'] = $hourly_rate; + } + + public function getHourlyRate(): float + { + return $this->data['hourly_rate']; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setNote(?string $note): void + { + $this->data['note'] = $note; + } + + public function getNote(): ?string + { + return $this->data['note']; + } + + /** + * Can be chosen freely. + */ + public function setNumber(?string $number): void + { + $this->data['number'] = $number; + } + + public function getNumber(): ?string + { + return $this->data['number']; + } + + public function setPositionId(?int $position_id): void + { + $this->data['position_id'] = $position_id; + } + + public function getPositionId(): ?int + { + return $this->data['position_id']; + } + + public function setProjectId(?int $project_id): void + { + $this->data['project_id'] = $project_id; + } + + public function getProjectId(): ?int + { + return $this->data['project_id']; + } + + /** + * If omitted or null, the currently active login is used. + */ + public function setLoginId(?int $login_id): void + { + $this->data['login_id'] = $login_id; + } + + public function getLoginId(): ?int + { + return $this->data['login_id']; + } + + /** + * Tracked time in minutes. + */ + public function setTimerValue(?int $timer_value): void + { + $this->data['timer_value'] = $timer_value; + } + + public function getTimerValue(): ?int + { + return $this->data['timer_value']; + } +} diff --git a/src/Models/WebHook.php b/src/Models/WebHook.php new file mode 100644 index 0000000..71a782e --- /dev/null +++ b/src/Models/WebHook.php @@ -0,0 +1,93 @@ +data; + } + + public function setContentType(string $content_type): void + { + $this->data['content_type'] = $content_type; + } + + public function getContentType(): string + { + return $this->data['content_type']; + } + + public function setDescription(string $description): void + { + $this->data['description'] = $description; + } + + public function getDescription(): string + { + return $this->data['description']; + } + + public function setEvents(array $events): void + { + $this->data['events'] = $events; + } + + /** + * @return string[] + */ + public function getEvents(): array + { + return $this->data['events']; + } + + public function getId(): int + { + return $this->data['id']; + } + + public function setIsActive(bool $is_active): void + { + $this->data['is_active'] = $is_active; + } + + public function getIsActive(): bool + { + return $this->data['is_active']; + } + + public function getLastResponse(): \stdClass + { + return $this->data['last_response']; + } + + public function setSecret(string $secret): void + { + $this->data['secret'] = $secret; + } + + public function getSecret(): string + { + return $this->data['secret']; + } + + public function setUrl(string $url): void + { + $this->data['url'] = $url; + } + + public function getUrl(): string + { + return $this->data['url']; + } +} From ed7fc64b601e3b025c34578dfa89db3ea16d8e29 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 15 Dec 2021 22:30:50 +0100 Subject: [PATCH 10/37] Remove useless Makefile file --- Makefile | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index bf485b4..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -current_dir = $(shell pwd) - -make: - composer install - composer dump-autoload \ No newline at end of file From d2acd3d1b9e175f836c76815d52b375a91e3822a Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Thu, 16 Dec 2021 15:32:36 +0100 Subject: [PATCH 11/37] Improve scripts definition in composer.json --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d250021..3199ee5 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,11 @@ "nette/php-generator": "^3.6" }, "scripts": { - "sdk:models": "php generators/models.php", + "sdk:models": "@php generators/models.php", "sdk:cs-fix": "./vendor/bin/php-cs-fixer fix" + }, + "scripts-descriptions": { + "sdk:models": "Gnerate models from swagger.json file.", + "sdk:cs-fix": "Run php-cs-fixer to reformat php files." } } From 5a26fe7cda792c4657249411046acfb5de5efd74 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 10:49:19 +0100 Subject: [PATCH 12/37] Update models, add tests and more... --- .php-cs-fixer.dist.php | 1 + composer.json | 16 +- composer.lock | 2254 ++++++++++++++++- .../customers_create.php} | 4 +- examples/with_models/logins_list.php | 16 + generators/models.php | 22 +- .../{swagger.1.68.0.json => swagger.json} | 194 +- src/Models/Attachment.php | 24 +- src/Models/Contact.php | 58 +- src/Models/Customer.php | 162 +- src/Models/CustomerGroup.php | 20 +- src/Models/CustomerSnapshot.php | 7 +- src/Models/Discount.php | 18 +- src/Models/DiscountPosition.php | 9 +- src/Models/DiscountPositionGroup.php | 9 +- src/Models/Document.php | 134 +- src/Models/DocumentAddress.php | 39 +- src/Models/DocumentPayment.php | 30 +- src/Models/DocumentPosition.php | 66 +- src/Models/DocumentRecurring.php | 46 +- src/Models/Login.php | 32 +- src/Models/LoginSecurity.php | 16 +- src/Models/PDFTemplate.php | 18 +- src/Models/Position.php | 78 +- .../PositionExportIdentifierExtended.php | 148 ++ src/Models/PositionGroup.php | 22 +- src/Models/PostBox.php | 48 +- src/Models/PostBoxRequest.php | 26 +- src/Models/Project.php | 36 +- src/Models/SEPAPayment.php | 58 +- src/Models/SerialNumber.php | 24 +- src/Models/ServiceDate.php | 20 +- src/Models/Stock.php | 28 +- src/Models/Task.php | 44 +- src/Models/TextTemplate.php | 18 +- src/Models/TimeTracking.php | 36 +- src/Models/ToArrayInterface.php | 8 + src/Models/Traits/Data.php | 37 + src/Models/WebHook.php | 28 +- src/Models/WebHookLastResponse.php | 33 + tests/Models/CustomerTest.php | 16 + tests/Models/PositionTest.php | 19 + 42 files changed, 3089 insertions(+), 833 deletions(-) rename examples/{customers_02_create_with_model.php => with_models/customers_create.php} (88%) create mode 100644 examples/with_models/logins_list.php rename generators/{swagger.1.68.0.json => swagger.json} (98%) create mode 100644 src/Models/PositionExportIdentifierExtended.php create mode 100644 src/Models/ToArrayInterface.php create mode 100644 src/Models/Traits/Data.php create mode 100644 src/Models/WebHookLastResponse.php create mode 100644 tests/Models/CustomerTest.php create mode 100644 tests/Models/PositionTest.php diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 9b3ab45..1254d55 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -38,4 +38,5 @@ ->in(__DIR__ . '/src') ->in(__DIR__ . '/examples') ->in(__DIR__ . '/generators') + ->in(__DIR__ . '/tests') ); diff --git a/composer.json b/composer.json index 3199ee5..bfa8393 100644 --- a/composer.json +++ b/composer.json @@ -28,13 +28,23 @@ "easybill\\SDK\\": "src/" } }, + "autoload-dev": { + "psr-4": { + "easybill\\SDK\\Tests\\": "tests/" + } + }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.4", - "nette/php-generator": "^3.6" + "nette/php-generator": "^3.6", + "phpunit/phpunit": "^9.5" }, "scripts": { - "sdk:models": "@php generators/models.php", - "sdk:cs-fix": "./vendor/bin/php-cs-fixer fix" + "sdk:models": [ + "@php generators/models.php", + "@sdk:cs-fix" + ], + "sdk:cs-fix": "./vendor/bin/php-cs-fixer fix", + "sdk:test": "./vendor/bin/phpunit tests" }, "scripts-descriptions": { "sdk:models": "Gnerate models from swagger.json file.", diff --git a/composer.lock b/composer.lock index 20bd8c0..cfa2689 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6b9ab6148f5672f5e6e5499363ca6add", + "content-hash": "8aea787884ab60a688ad10c410d72176", "packages": [ { "name": "guzzlehttp/guzzle", @@ -892,6 +892,75 @@ }, "time": "2021-08-05T19:00:23+00:00" }, + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, { "name": "doctrine/lexer", "version": "1.2.1", @@ -1061,6 +1130,64 @@ ], "time": "2021-12-11T16:25:08+00:00" }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, { "name": "nette/php-generator", "version": "v3.6.5", @@ -1209,33 +1336,1788 @@ "validation" ], "support": { - "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.6" + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v3.2.6" + }, + "time": "2021-11-24T15:47:23+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "sebastian/diff v3 backport support for PHP 5.6+", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + }, + "time": "2020-10-14T08:32:19+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + }, + "time": "2021-10-02T14:08:47+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-05T09:12:13+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-09-25T07:38:51+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, - "time": "2021-11-24T15:47:23+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "php-cs-fixer/diff", - "version": "v2.0.2", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1249,224 +3131,248 @@ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" } ], - "description": "sebastian/diff v3 backport support for PHP 5.6+", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, - "time": "2020-10-14T08:32:19+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "psr/cache", - "version": "3.0.0", + "name": "sebastian/recursion-context", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" }, - "time": "2021-02-03T23:26:27+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" }, { - "name": "psr/container", - "version": "2.0.2", + "name": "sebastian/resource-operations", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" }, - "time": "2021-11-05T16:47:00+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" }, { - "name": "psr/event-dispatcher", - "version": "1.0.0", + "name": "sebastian/type", + "version": "2.3.4", "source": { "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.3-dev" } }, "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" }, - "time": "2019-01-08T18:20:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" }, { - "name": "psr/log", - "version": "3.0.0", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, - "time": "2021-07-14T16:46:02+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "symfony/console", @@ -2691,6 +4597,114 @@ } ], "time": "2021-12-08T15:13:44+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], @@ -2699,7 +4713,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.4 || ^8.0 || ^8.1", + "php": "^8.0 || ^8.1", "ext-json": "*" }, "platform-dev": [], diff --git a/examples/customers_02_create_with_model.php b/examples/with_models/customers_create.php similarity index 88% rename from examples/customers_02_create_with_model.php rename to examples/with_models/customers_create.php index 6da4438..ae593c0 100644 --- a/examples/customers_02_create_with_model.php +++ b/examples/with_models/customers_create.php @@ -2,7 +2,7 @@ declare(strict_types=1); -require_once __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . '../../vendor/autoload.php'; use easybill\SDK\Client; use easybill\SDK\Endpoint; @@ -16,7 +16,7 @@ $customerCreate->setCompanyName('FooBar GmbH'); $customerCreate->setEmails(['foo.bar@foobar.com']); -$result = $client->request('POST', 'customers', $customerCreate->getData()); +$result = $client->request('POST', 'customers', $customerCreate->toArray()); $customer = new Customer($result); diff --git a/examples/with_models/logins_list.php b/examples/with_models/logins_list.php new file mode 100644 index 0000000..c629dee --- /dev/null +++ b/examples/with_models/logins_list.php @@ -0,0 +1,16 @@ +request('GET', 'logins'); +$result['items'] = array_map(static fn (array $data): Login => new Login($data), $result['items']); + +var_dump($result); diff --git a/generators/models.php b/generators/models.php index ed26bc1..3281d8e 100644 --- a/generators/models.php +++ b/generators/models.php @@ -4,7 +4,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; -$swagger = json_decode(file_get_contents(__DIR__ . '/swagger.1.68.0.json'), true); +$swagger = json_decode(file_get_contents(__DIR__ . '/swagger.json'), true); function classNameFromRef(string $ref): string { @@ -27,7 +27,6 @@ function typeMap(string $type): string 'boolean' => 'bool', 'array' => 'array', 'string' => 'string', - 'object' => \stdClass::class, '' => '', default => throw new RuntimeException('type not supported: ' . $type), }; @@ -71,15 +70,15 @@ function typeMap(string $type): string } $construct = $class->addMethod('__construct'); - $construct->addPromotedParameter('data', [])->setProtected(); + $construct->addParameter('data', [])->setType('array'); if ($classExtends) { $construct->setBody('parent::__construct($data);'); + } else { + $class->addImplement(\easybill\SDK\Models\ToArrayInterface::class); + $class->addTrait(\easybill\SDK\Models\Traits\Data::class); + $construct->setBody('$this->data = $data;'); } - $getterData = $class->addMethod('getData'); - $getterData->setReturnType('array'); - $getterData->setBody('return $this->data;'); - $errors = []; foreach ($classInfo['properties'] as $propertyName => $propertyInfo) { @@ -92,9 +91,12 @@ function typeMap(string $type): string echo '==> ' . $className . '::' . $propertyName . "\n"; $type = typeMap($propertyInfo['type']); + $isObject = false; if (array_key_exists('$ref', $propertyInfo)) { $type = classWithNamespace(classNameFromRef($propertyInfo['$ref'])); + $propertyInfo['readOnly'] = $swagger['definitions'][classNameFromRef($propertyInfo['$ref'])]['readOnly'] ?? false; + $isObject = true; } $methodeName = str_replace('_', '', ucwords($propertyName, '_')); @@ -125,7 +127,11 @@ function typeMap(string $type): string if ($type === 'array' && array_key_exists('$ref', $propertyInfo['items'])) { $getter->addComment('@return \\' . classWithNamespace(classNameFromRef($propertyInfo['items']['$ref'])) . '[]'); } - $getter->setBody('return $this->data[\'' . $propertyName . '\'];'); + if ($isObject) { + $getter->setBody('return $this->getInstance(\'' . $propertyName . '\', \\' . $type . '::class);'); + } else { + $getter->setBody('return $this->get(\'' . $propertyName . '\');'); + } } $content = (new Nette\PhpGenerator\PsrPrinter())->printFile($file); diff --git a/generators/swagger.1.68.0.json b/generators/swagger.json similarity index 98% rename from generators/swagger.1.68.0.json rename to generators/swagger.json index 8ce3fdf..12a0bca 100644 --- a/generators/swagger.1.68.0.json +++ b/generators/swagger.json @@ -4033,6 +4033,7 @@ } }, "CustomerSnapshot": { + "readOnly": true, "type": "object", "description": "A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state.", "allOf": [ @@ -4405,6 +4406,8 @@ }, "DocumentAddress": { "type": "object", + "readOnly": true, + "description": "This information comes from the customer which can be set with customer_id.", "properties": { "salutation": { "readOnly": true, @@ -4657,8 +4660,6 @@ "type": "object", "properties": { "address": { - "readOnly": true, - "description": "This information comes from the customer which can be set with customer_id.", "$ref": "#/definitions/DocumentAddress" }, "attachment_ids": { @@ -4671,8 +4672,6 @@ } }, "label_address": { - "readOnly": true, - "description": "This information comes from the customer which can be set with customer_id.", "$ref": "#/definitions/DocumentAddress" }, "amount": { @@ -4768,7 +4767,6 @@ "example": null }, "customer_snapshot": { - "readOnly": true, "$ref": "#/definitions/CustomerSnapshot" }, "discount": { @@ -4938,7 +4936,7 @@ }, "recurring_options": { "description": "This object is only available in document type RECURRING", - "$ref": "#/definitions/DocumentRecurring" + "$ref": "#/definitions/DocumentRecurring" }, "ref_id": { "type": "integer", @@ -5442,70 +5440,7 @@ "description": "The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant." }, "export_identifier_extended": { - "type": "object", - "default": [], - "properties": { - "NULL": { - "example": "8400", - "description": "Umsatzsteuerpflichtig", - "x-nullable": true, - "default": null - }, - "nStb": { - "example": "8338", - "description": "Nicht steuerbar (Drittland)", - "x-nullable": true, - "default": null - }, - "nStbUstID": { - "example": "8339", - "description": "Nicht steuerbar (EU mit USt-IdNr.)", - "x-nullable": true, - "default": null - }, - "nStbNoneUstID": { - "example": "8950", - "description": "Nicht steuerbar (EU ohne USt-IdNr.)", - "x-nullable": true, - "default": null - }, - "nStbIm": { - "example": "8950", - "description": "Nicht steuerbarer Innenumsatz", - "x-nullable": true, - "default": null - }, - "revc": { - "example": "8337", - "description": "Steuerschuldwechsel §13b (Inland)", - "x-nullable": true, - "default": null - }, - "IG": { - "example": "8125", - "description": "Innergemeinschaftliche Lieferung", - "x-nullable": true, - "default": null - }, - "AL": { - "example": "8120", - "description": "Ausfuhrlieferung", - "x-nullable": true, - "default": null - }, - "sStfr": { - "example": "8100", - "description": "sonstige Steuerbefreiung", - "x-nullable": true, - "default": null - }, - "smallBusiness": { - "example": "8195", - "description": "Kleinunternehmen (Keine MwSt.)", - "x-nullable": true, - "default": null - } - } + "$ref": "#/definitions/PositionExportIdentifierExtended" }, "login_id": { "type": "integer", @@ -5692,6 +5627,82 @@ } ] }, + "PositionExportIdentifierExtended": { + "type": "object", + "default": [], + "properties": { + "NULL": { + "type": "string", + "example": "8400", + "description": "Umsatzsteuerpflichtig", + "x-nullable": true, + "default": null + }, + "nStb": { + "type": "string", + "example": "8338", + "description": "Nicht steuerbar (Drittland)", + "x-nullable": true, + "default": null + }, + "nStbUstID": { + "type": "string", + "example": "8339", + "description": "Nicht steuerbar (EU mit USt-IdNr.)", + "x-nullable": true, + "default": null + }, + "nStbNoneUstID": { + "type": "string", + "example": "8950", + "description": "Nicht steuerbar (EU ohne USt-IdNr.)", + "x-nullable": true, + "default": null + }, + "nStbIm": { + "type": "string", + "example": "8950", + "description": "Nicht steuerbarer Innenumsatz", + "x-nullable": true, + "default": null + }, + "revc": { + "type": "string", + "example": "8337", + "description": "Steuerschuldwechsel §13b (Inland)", + "x-nullable": true, + "default": null + }, + "IG": { + "type": "string", + "example": "8125", + "description": "Innergemeinschaftliche Lieferung", + "x-nullable": true, + "default": null + }, + "AL": { + "type": "string", + "example": "8120", + "description": "Ausfuhrlieferung", + "x-nullable": true, + "default": null + }, + "sStfr": { + "type": "string", + "example": "8100", + "description": "sonstige Steuerbefreiung", + "x-nullable": true, + "default": null + }, + "smallBusiness": { + "type": "string", + "example": "8195", + "description": "Kleinunternehmen (Keine MwSt.)", + "x-nullable": true, + "default": null + } + } + }, "PositionGroup": { "type": "object", "required": [ @@ -6473,26 +6484,7 @@ "default": false }, "last_response": { - "readOnly": true, - "type": "object", - "properties": { - "date": { - "type": "string", - "format": "date-time", - "readOnly": true, - "example": "2019-02-01 11:16:52" - }, - "code": { - "type": "integer", - "readOnly": true, - "example": 204 - }, - "response": { - "type": "string", - "readOnly": true, - "example": "" - } - } + "$ref": "#/definitions/WebHookLastResponse" }, "secret": { "type": "string", @@ -6522,6 +6514,28 @@ } ] }, + "WebHookLastResponse": { + "type": "object", + "readOnly": true, + "properties": { + "date": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "code": { + "type": "integer", + "readOnly": true, + "example": 204 + }, + "response": { + "type": "string", + "readOnly": true, + "example": "" + } + } + }, "PDFTemplate": { "type": "object", "properties": { diff --git a/src/Models/Attachment.php b/src/Models/Attachment.php index 32c8a2b..28d78a3 100644 --- a/src/Models/Attachment.php +++ b/src/Models/Attachment.php @@ -8,20 +8,18 @@ * Auto-generated with `composer sdk:models` * If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination). */ -class Attachment +class Attachment implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } public function setCustomerId(?int $customer_id): void @@ -31,7 +29,7 @@ public function setCustomerId(?int $customer_id): void public function getCustomerId(): ?int { - return $this->data['customer_id']; + return $this->get('customer_id'); } public function setDocumentId(?int $document_id): void @@ -41,17 +39,17 @@ public function setDocumentId(?int $document_id): void public function getDocumentId(): ?int { - return $this->data['document_id']; + return $this->get('document_id'); } public function getFileName(): string { - return $this->data['file_name']; + return $this->get('file_name'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setProjectId(?int $project_id): void @@ -61,11 +59,11 @@ public function setProjectId(?int $project_id): void public function getProjectId(): ?int { - return $this->data['project_id']; + return $this->get('project_id'); } public function getSize(): int { - return $this->data['size']; + return $this->get('size'); } } diff --git a/src/Models/Contact.php b/src/Models/Contact.php index 6964aed..e4b6623 100644 --- a/src/Models/Contact.php +++ b/src/Models/Contact.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class Contact +class Contact implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setCity(string $city): void @@ -25,7 +23,7 @@ public function setCity(string $city): void public function getCity(): string { - return $this->data['city']; + return $this->get('city'); } public function setState(string $state): void @@ -35,7 +33,7 @@ public function setState(string $state): void public function getState(): string { - return $this->data['state']; + return $this->get('state'); } public function setCompanyName(?string $company_name): void @@ -45,7 +43,7 @@ public function setCompanyName(?string $company_name): void public function getCompanyName(): ?string { - return $this->data['company_name']; + return $this->get('company_name'); } /** @@ -58,7 +56,7 @@ public function setCountry(string $country): void public function getCountry(): string { - return $this->data['country']; + return $this->get('country'); } public function setDepartment(?string $department): void @@ -68,7 +66,7 @@ public function setDepartment(?string $department): void public function getDepartment(): ?string { - return $this->data['department']; + return $this->get('department'); } public function setEmails(array $emails): void @@ -81,7 +79,7 @@ public function setEmails(array $emails): void */ public function getEmails(): array { - return $this->data['emails']; + return $this->get('emails'); } public function setFax(?string $fax): void @@ -91,7 +89,7 @@ public function setFax(?string $fax): void public function getFax(): ?string { - return $this->data['fax']; + return $this->get('fax'); } public function setFirstName(?string $first_name): void @@ -101,12 +99,12 @@ public function setFirstName(?string $first_name): void public function getFirstName(): ?string { - return $this->data['first_name']; + return $this->get('first_name'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setLastName(?string $last_name): void @@ -116,12 +114,12 @@ public function setLastName(?string $last_name): void public function getLastName(): ?string { - return $this->data['last_name']; + return $this->get('last_name'); } public function getLoginId(): int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setMobile(?string $mobile): void @@ -131,7 +129,7 @@ public function setMobile(?string $mobile): void public function getMobile(): ?string { - return $this->data['mobile']; + return $this->get('mobile'); } public function setNote(?string $note): void @@ -141,7 +139,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->data['note']; + return $this->get('note'); } public function setPersonal(bool $personal): void @@ -151,7 +149,7 @@ public function setPersonal(bool $personal): void public function getPersonal(): bool { - return $this->data['personal']; + return $this->get('personal'); } public function setPhone1(?string $phone_1): void @@ -161,7 +159,7 @@ public function setPhone1(?string $phone_1): void public function getPhone1(): ?string { - return $this->data['phone_1']; + return $this->get('phone_1'); } public function setPhone2(?string $phone_2): void @@ -171,7 +169,7 @@ public function setPhone2(?string $phone_2): void public function getPhone2(): ?string { - return $this->data['phone_2']; + return $this->get('phone_2'); } /** @@ -184,7 +182,7 @@ public function setSalutation(int $salutation): void public function getSalutation(): int { - return $this->data['salutation']; + return $this->get('salutation'); } public function setStreet(string $street): void @@ -194,7 +192,7 @@ public function setStreet(string $street): void public function getStreet(): string { - return $this->data['street']; + return $this->get('street'); } public function setSuffix1(?string $suffix_1): void @@ -204,7 +202,7 @@ public function setSuffix1(?string $suffix_1): void public function getSuffix1(): ?string { - return $this->data['suffix_1']; + return $this->get('suffix_1'); } public function setSuffix2(?string $suffix_2): void @@ -214,7 +212,7 @@ public function setSuffix2(?string $suffix_2): void public function getSuffix2(): ?string { - return $this->data['suffix_2']; + return $this->get('suffix_2'); } public function setTitle(?string $title): void @@ -224,7 +222,7 @@ public function setTitle(?string $title): void public function getTitle(): ?string { - return $this->data['title']; + return $this->get('title'); } public function setZipCode(?string $zip_code): void @@ -234,16 +232,16 @@ public function setZipCode(?string $zip_code): void public function getZipCode(): ?string { - return $this->data['zip_code']; + return $this->get('zip_code'); } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } public function getUpdatedAt(): string { - return $this->data['updated_at']; + return $this->get('updated_at'); } } diff --git a/src/Models/Customer.php b/src/Models/Customer.php index 069e47a..8ee305c 100644 --- a/src/Models/Customer.php +++ b/src/Models/Customer.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class Customer +class Customer implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } /** @@ -28,7 +26,7 @@ public function setAcquireOptions(?int $acquire_options): void public function getAcquireOptions(): ?int { - return $this->data['acquire_options']; + return $this->get('acquire_options'); } /** @@ -36,7 +34,7 @@ public function getAcquireOptions(): ?int */ public function getAdditionalGroupsIds(): array { - return $this->data['additional_groups_ids']; + return $this->get('additional_groups_ids'); } public function setBankAccount(?string $bank_account): void @@ -46,7 +44,7 @@ public function setBankAccount(?string $bank_account): void public function getBankAccount(): ?string { - return $this->data['bank_account']; + return $this->get('bank_account'); } public function setBankAccountOwner(?string $bank_account_owner): void @@ -56,7 +54,7 @@ public function setBankAccountOwner(?string $bank_account_owner): void public function getBankAccountOwner(): ?string { - return $this->data['bank_account_owner']; + return $this->get('bank_account_owner'); } public function setBankBic(?string $bank_bic): void @@ -66,7 +64,7 @@ public function setBankBic(?string $bank_bic): void public function getBankBic(): ?string { - return $this->data['bank_bic']; + return $this->get('bank_bic'); } public function setBankCode(?string $bank_code): void @@ -76,7 +74,7 @@ public function setBankCode(?string $bank_code): void public function getBankCode(): ?string { - return $this->data['bank_code']; + return $this->get('bank_code'); } public function setBankIban(?string $bank_iban): void @@ -86,7 +84,7 @@ public function setBankIban(?string $bank_iban): void public function getBankIban(): ?string { - return $this->data['bank_iban']; + return $this->get('bank_iban'); } public function setBankName(?string $bank_name): void @@ -96,7 +94,7 @@ public function setBankName(?string $bank_name): void public function getBankName(): ?string { - return $this->data['bank_name']; + return $this->get('bank_name'); } public function setBirthDate(?string $birth_date): void @@ -106,7 +104,7 @@ public function setBirthDate(?string $birth_date): void public function getBirthDate(): ?string { - return $this->data['birth_date']; + return $this->get('birth_date'); } public function setCashAllowance(?float $cash_allowance): void @@ -116,7 +114,7 @@ public function setCashAllowance(?float $cash_allowance): void public function getCashAllowance(): ?float { - return $this->data['cash_allowance']; + return $this->get('cash_allowance'); } public function setCashAllowanceDays(int $cash_allowance_days): void @@ -126,7 +124,7 @@ public function setCashAllowanceDays(int $cash_allowance_days): void public function getCashAllowanceDays(): int { - return $this->data['cash_allowance_days']; + return $this->get('cash_allowance_days'); } public function setCashDiscount(?float $cash_discount): void @@ -136,7 +134,7 @@ public function setCashDiscount(?float $cash_discount): void public function getCashDiscount(): ?float { - return $this->data['cash_discount']; + return $this->get('cash_discount'); } public function setCashDiscountType(?string $cash_discount_type): void @@ -146,7 +144,7 @@ public function setCashDiscountType(?string $cash_discount_type): void public function getCashDiscountType(): ?string { - return $this->data['cash_discount_type']; + return $this->get('cash_discount_type'); } public function setCity(?string $city): void @@ -156,7 +154,7 @@ public function setCity(?string $city): void public function getCity(): ?string { - return $this->data['city']; + return $this->get('city'); } public function setState(string $state): void @@ -166,7 +164,7 @@ public function setState(string $state): void public function getState(): string { - return $this->data['state']; + return $this->get('state'); } public function setCompanyName(?string $company_name): void @@ -176,7 +174,7 @@ public function setCompanyName(?string $company_name): void public function getCompanyName(): ?string { - return $this->data['company_name']; + return $this->get('company_name'); } public function setCountry(string $country): void @@ -186,17 +184,17 @@ public function setCountry(string $country): void public function getCountry(): string { - return $this->data['country']; + return $this->get('country'); } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } public function getUpdatedAt(): string { - return $this->data['updated_at']; + return $this->get('updated_at'); } public function setDeliveryTitle(string $delivery_title): void @@ -206,7 +204,7 @@ public function setDeliveryTitle(string $delivery_title): void public function getDeliveryTitle(): string { - return $this->data['delivery_title']; + return $this->get('delivery_title'); } public function setDeliveryCity(?string $delivery_city): void @@ -216,7 +214,7 @@ public function setDeliveryCity(?string $delivery_city): void public function getDeliveryCity(): ?string { - return $this->data['delivery_city']; + return $this->get('delivery_city'); } public function setDeliveryState(string $delivery_state): void @@ -226,7 +224,7 @@ public function setDeliveryState(string $delivery_state): void public function getDeliveryState(): string { - return $this->data['delivery_state']; + return $this->get('delivery_state'); } public function setDeliveryCompanyName(?string $delivery_company_name): void @@ -236,7 +234,7 @@ public function setDeliveryCompanyName(?string $delivery_company_name): void public function getDeliveryCompanyName(): ?string { - return $this->data['delivery_company_name']; + return $this->get('delivery_company_name'); } public function setDeliveryCountry(?string $delivery_country): void @@ -246,7 +244,7 @@ public function setDeliveryCountry(?string $delivery_country): void public function getDeliveryCountry(): ?string { - return $this->data['delivery_country']; + return $this->get('delivery_country'); } public function setDeliveryFirstName(?string $delivery_first_name): void @@ -256,7 +254,7 @@ public function setDeliveryFirstName(?string $delivery_first_name): void public function getDeliveryFirstName(): ?string { - return $this->data['delivery_first_name']; + return $this->get('delivery_first_name'); } public function setDeliveryLastName(?string $delivery_last_name): void @@ -266,7 +264,7 @@ public function setDeliveryLastName(?string $delivery_last_name): void public function getDeliveryLastName(): ?string { - return $this->data['delivery_last_name']; + return $this->get('delivery_last_name'); } public function setDeliveryPersonal(bool $delivery_personal): void @@ -276,7 +274,7 @@ public function setDeliveryPersonal(bool $delivery_personal): void public function getDeliveryPersonal(): bool { - return $this->data['delivery_personal']; + return $this->get('delivery_personal'); } /** @@ -289,7 +287,7 @@ public function setDeliverySalutation(int $delivery_salutation): void public function getDeliverySalutation(): int { - return $this->data['delivery_salutation']; + return $this->get('delivery_salutation'); } public function setDeliveryStreet(?string $delivery_street): void @@ -299,7 +297,7 @@ public function setDeliveryStreet(?string $delivery_street): void public function getDeliveryStreet(): ?string { - return $this->data['delivery_street']; + return $this->get('delivery_street'); } public function setDeliverySuffix1(?string $delivery_suffix_1): void @@ -309,7 +307,7 @@ public function setDeliverySuffix1(?string $delivery_suffix_1): void public function getDeliverySuffix1(): ?string { - return $this->data['delivery_suffix_1']; + return $this->get('delivery_suffix_1'); } public function setDeliverySuffix2(?string $delivery_suffix_2): void @@ -319,7 +317,7 @@ public function setDeliverySuffix2(?string $delivery_suffix_2): void public function getDeliverySuffix2(): ?string { - return $this->data['delivery_suffix_2']; + return $this->get('delivery_suffix_2'); } public function setDeliveryZipCode(?string $delivery_zip_code): void @@ -329,12 +327,12 @@ public function setDeliveryZipCode(?string $delivery_zip_code): void public function getDeliveryZipCode(): ?string { - return $this->data['delivery_zip_code']; + return $this->get('delivery_zip_code'); } public function getDisplayName(): string { - return $this->data['display_name']; + return $this->get('display_name'); } public function setEmails(array $emails): void @@ -347,7 +345,7 @@ public function setEmails(array $emails): void */ public function getEmails(): array { - return $this->data['emails']; + return $this->get('emails'); } public function setFax(?string $fax): void @@ -357,7 +355,7 @@ public function setFax(?string $fax): void public function getFax(): ?string { - return $this->data['fax']; + return $this->get('fax'); } public function setFirstName(?string $first_name): void @@ -367,7 +365,7 @@ public function setFirstName(?string $first_name): void public function getFirstName(): ?string { - return $this->data['first_name']; + return $this->get('first_name'); } /** @@ -380,7 +378,7 @@ public function setGracePeriod(?int $grace_period): void public function getGracePeriod(): ?int { - return $this->data['grace_period']; + return $this->get('grace_period'); } /** @@ -393,7 +391,7 @@ public function setDueInDays(?int $due_in_days): void public function getDueInDays(): ?int { - return $this->data['due_in_days']; + return $this->get('due_in_days'); } public function setGroupId(?int $group_id): void @@ -403,12 +401,12 @@ public function setGroupId(?int $group_id): void public function getGroupId(): ?int { - return $this->data['group_id']; + return $this->get('group_id'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setInfo1(?string $info_1): void @@ -418,7 +416,7 @@ public function setInfo1(?string $info_1): void public function getInfo1(): ?string { - return $this->data['info_1']; + return $this->get('info_1'); } public function setInfo2(?string $info_2): void @@ -428,7 +426,7 @@ public function setInfo2(?string $info_2): void public function getInfo2(): ?string { - return $this->data['info_2']; + return $this->get('info_2'); } public function setInternet(?string $internet): void @@ -438,7 +436,7 @@ public function setInternet(?string $internet): void public function getInternet(): ?string { - return $this->data['internet']; + return $this->get('internet'); } public function setLastName(?string $last_name): void @@ -448,7 +446,7 @@ public function setLastName(?string $last_name): void public function getLastName(): ?string { - return $this->data['last_name']; + return $this->get('last_name'); } public function setLoginId(int $login_id): void @@ -458,7 +456,7 @@ public function setLoginId(int $login_id): void public function getLoginId(): int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setMobile(?string $mobile): void @@ -468,7 +466,7 @@ public function setMobile(?string $mobile): void public function getMobile(): ?string { - return $this->data['mobile']; + return $this->get('mobile'); } public function setNote(?string $note): void @@ -478,7 +476,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->data['note']; + return $this->get('note'); } /** @@ -491,7 +489,7 @@ public function setNumber(string $number): void public function getNumber(): string { - return $this->data['number']; + return $this->get('number'); } /** @@ -504,7 +502,7 @@ public function setPaymentOptions(?int $payment_options): void public function getPaymentOptions(): ?int { - return $this->data['payment_options']; + return $this->get('payment_options'); } public function setPersonal(bool $personal): void @@ -514,7 +512,7 @@ public function setPersonal(bool $personal): void public function getPersonal(): bool { - return $this->data['personal']; + return $this->get('personal'); } public function setPhone1(?string $phone_1): void @@ -524,7 +522,7 @@ public function setPhone1(?string $phone_1): void public function getPhone1(): ?string { - return $this->data['phone_1']; + return $this->get('phone_1'); } public function setPhone2(?string $phone_2): void @@ -534,7 +532,7 @@ public function setPhone2(?string $phone_2): void public function getPhone2(): ?string { - return $this->data['phone_2']; + return $this->get('phone_2'); } public function setPostbox(?string $postbox): void @@ -544,7 +542,7 @@ public function setPostbox(?string $postbox): void public function getPostbox(): ?string { - return $this->data['postbox']; + return $this->get('postbox'); } public function setPostboxCity(?string $postbox_city): void @@ -554,7 +552,7 @@ public function setPostboxCity(?string $postbox_city): void public function getPostboxCity(): ?string { - return $this->data['postbox_city']; + return $this->get('postbox_city'); } public function setPostboxState(string $postbox_state): void @@ -564,7 +562,7 @@ public function setPostboxState(string $postbox_state): void public function getPostboxState(): string { - return $this->data['postbox_state']; + return $this->get('postbox_state'); } public function setPostboxCountry(?string $postbox_country): void @@ -574,7 +572,7 @@ public function setPostboxCountry(?string $postbox_country): void public function getPostboxCountry(): ?string { - return $this->data['postbox_country']; + return $this->get('postbox_country'); } public function setPostboxZipCode(?string $postbox_zip_code): void @@ -584,7 +582,7 @@ public function setPostboxZipCode(?string $postbox_zip_code): void public function getPostboxZipCode(): ?string { - return $this->data['postbox_zip_code']; + return $this->get('postbox_zip_code'); } public function setSalePriceLevel(?string $sale_price_level): void @@ -594,7 +592,7 @@ public function setSalePriceLevel(?string $sale_price_level): void public function getSalePriceLevel(): ?string { - return $this->data['sale_price_level']; + return $this->get('sale_price_level'); } /** @@ -607,7 +605,7 @@ public function setSalutation(int $salutation): void public function getSalutation(): int { - return $this->data['salutation']; + return $this->get('salutation'); } /** @@ -620,7 +618,7 @@ public function setSepaAgreement(?string $sepa_agreement): void public function getSepaAgreement(): ?string { - return $this->data['sepa_agreement']; + return $this->get('sepa_agreement'); } public function setSepaAgreementDate(?string $sepa_agreement_date): void @@ -630,7 +628,7 @@ public function setSepaAgreementDate(?string $sepa_agreement_date): void public function getSepaAgreementDate(): ?string { - return $this->data['sepa_agreement_date']; + return $this->get('sepa_agreement_date'); } public function setSepaMandateReference(?string $sepa_mandate_reference): void @@ -640,7 +638,7 @@ public function setSepaMandateReference(?string $sepa_mandate_reference): void public function getSepaMandateReference(): ?string { - return $this->data['sepa_mandate_reference']; + return $this->get('sepa_mandate_reference'); } public function setSinceDate(?string $since_date): void @@ -650,7 +648,7 @@ public function setSinceDate(?string $since_date): void public function getSinceDate(): ?string { - return $this->data['since_date']; + return $this->get('since_date'); } public function setStreet(?string $street): void @@ -660,7 +658,7 @@ public function setStreet(?string $street): void public function getStreet(): ?string { - return $this->data['street']; + return $this->get('street'); } public function setSuffix1(?string $suffix_1): void @@ -670,7 +668,7 @@ public function setSuffix1(?string $suffix_1): void public function getSuffix1(): ?string { - return $this->data['suffix_1']; + return $this->get('suffix_1'); } public function setSuffix2(?string $suffix_2): void @@ -680,7 +678,7 @@ public function setSuffix2(?string $suffix_2): void public function getSuffix2(): ?string { - return $this->data['suffix_2']; + return $this->get('suffix_2'); } public function setTaxNumber(?string $tax_number): void @@ -690,7 +688,7 @@ public function setTaxNumber(?string $tax_number): void public function getTaxNumber(): ?string { - return $this->data['tax_number']; + return $this->get('tax_number'); } public function setCourt(?string $court): void @@ -700,7 +698,7 @@ public function setCourt(?string $court): void public function getCourt(): ?string { - return $this->data['court']; + return $this->get('court'); } public function setCourtRegistryNumber(?string $court_registry_number): void @@ -710,7 +708,7 @@ public function setCourtRegistryNumber(?string $court_registry_number): void public function getCourtRegistryNumber(): ?string { - return $this->data['court_registry_number']; + return $this->get('court_registry_number'); } /** @@ -723,7 +721,7 @@ public function setTaxOptions(?string $tax_options): void public function getTaxOptions(): ?string { - return $this->data['tax_options']; + return $this->get('tax_options'); } public function setTitle(?string $title): void @@ -733,7 +731,7 @@ public function setTitle(?string $title): void public function getTitle(): ?string { - return $this->data['title']; + return $this->get('title'); } public function setVatIdentifier(?string $vat_identifier): void @@ -743,7 +741,7 @@ public function setVatIdentifier(?string $vat_identifier): void public function getVatIdentifier(): ?string { - return $this->data['vat_identifier']; + return $this->get('vat_identifier'); } public function setZipCode(?string $zip_code): void @@ -753,7 +751,7 @@ public function setZipCode(?string $zip_code): void public function getZipCode(): ?string { - return $this->data['zip_code']; + return $this->get('zip_code'); } /** @@ -766,7 +764,7 @@ public function setDocumentPdfType(string $documentPdfType): void public function getDocumentPdfType(): string { - return $this->data['documentPdfType']; + return $this->get('documentPdfType'); } /** @@ -779,7 +777,7 @@ public function setBuyerReference(string $buyer_reference): void public function getBuyerReference(): string { - return $this->data['buyer_reference']; + return $this->get('buyer_reference'); } /** @@ -792,6 +790,6 @@ public function setForeignSupplierNumber(string $foreign_supplier_number): void public function getForeignSupplierNumber(): string { - return $this->data['foreign_supplier_number']; + return $this->get('foreign_supplier_number'); } } diff --git a/src/Models/CustomerGroup.php b/src/Models/CustomerGroup.php index 81fe1b2..97507f8 100644 --- a/src/Models/CustomerGroup.php +++ b/src/Models/CustomerGroup.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class CustomerGroup +class CustomerGroup implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setName(string $name): void @@ -25,7 +23,7 @@ public function setName(string $name): void public function getName(): string { - return $this->data['name']; + return $this->get('name'); } public function setDescription(?string $description): void @@ -35,7 +33,7 @@ public function setDescription(?string $description): void public function getDescription(): ?string { - return $this->data['description']; + return $this->get('description'); } /** @@ -48,16 +46,16 @@ public function setNumber(string $number): void public function getNumber(): string { - return $this->data['number']; + return $this->get('number'); } public function getDisplayName(): string { - return $this->data['display_name']; + return $this->get('display_name'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } } diff --git a/src/Models/CustomerSnapshot.php b/src/Models/CustomerSnapshot.php index 7aa826f..76ae6bf 100644 --- a/src/Models/CustomerSnapshot.php +++ b/src/Models/CustomerSnapshot.php @@ -10,13 +10,8 @@ */ class CustomerSnapshot extends Customer { - public function __construct(protected $data = []) + public function __construct(array $data = []) { parent::__construct($data); } - - public function getData(): array - { - return $this->data; - } } diff --git a/src/Models/Discount.php b/src/Models/Discount.php index ac1a847..3324b10 100644 --- a/src/Models/Discount.php +++ b/src/Models/Discount.php @@ -7,20 +7,18 @@ /** * Auto-generated with `composer sdk:models`. */ -class Discount +class Discount implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setCustomerId(int $customer_id): void @@ -30,7 +28,7 @@ public function setCustomerId(int $customer_id): void public function getCustomerId(): int { - return $this->data['customer_id']; + return $this->get('customer_id'); } /** @@ -43,7 +41,7 @@ public function setDiscount(int $discount): void public function getDiscount(): int { - return $this->data['discount']; + return $this->get('discount'); } /** @@ -56,6 +54,6 @@ public function setDiscountType(string $discount_type): void public function getDiscountType(): string { - return $this->data['discount_type']; + return $this->get('discount_type'); } } diff --git a/src/Models/DiscountPosition.php b/src/Models/DiscountPosition.php index 4c4ce8e..81d0952 100644 --- a/src/Models/DiscountPosition.php +++ b/src/Models/DiscountPosition.php @@ -9,16 +9,11 @@ */ class DiscountPosition extends Discount { - public function __construct(protected $data = []) + public function __construct(array $data = []) { parent::__construct($data); } - public function getData(): array - { - return $this->data; - } - public function setPositionId(int $position_id): void { $this->data['position_id'] = $position_id; @@ -26,6 +21,6 @@ public function setPositionId(int $position_id): void public function getPositionId(): int { - return $this->data['position_id']; + return $this->get('position_id'); } } diff --git a/src/Models/DiscountPositionGroup.php b/src/Models/DiscountPositionGroup.php index 4239d2f..72d113c 100644 --- a/src/Models/DiscountPositionGroup.php +++ b/src/Models/DiscountPositionGroup.php @@ -9,16 +9,11 @@ */ class DiscountPositionGroup extends Discount { - public function __construct(protected $data = []) + public function __construct(array $data = []) { parent::__construct($data); } - public function getData(): array - { - return $this->data; - } - public function setPositionGroupId(int $position_group_id): void { $this->data['position_group_id'] = $position_group_id; @@ -26,6 +21,6 @@ public function setPositionGroupId(int $position_group_id): void public function getPositionGroupId(): int { - return $this->data['position_group_id']; + return $this->get('position_group_id'); } } diff --git a/src/Models/Document.php b/src/Models/Document.php index c8bde8b..fbf9c48 100644 --- a/src/Models/Document.php +++ b/src/Models/Document.php @@ -7,20 +7,18 @@ /** * Auto-generated with `composer sdk:models`. */ -class Document +class Document implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getAddress(): DocumentAddress { - return $this->data['address']; + return $this->getInstance('address', \easybill\SDK\Models\DocumentAddress::class); } /** @@ -28,22 +26,22 @@ public function getAddress(): DocumentAddress */ public function getAttachmentIds(): array { - return $this->data['attachment_ids']; + return $this->get('attachment_ids'); } public function getLabelAddress(): DocumentAddress { - return $this->data['label_address']; + return $this->getInstance('label_address', \easybill\SDK\Models\DocumentAddress::class); } public function getAmount(): int { - return $this->data['amount']; + return $this->get('amount'); } public function getAmountNet(): int { - return $this->data['amount_net']; + return $this->get('amount_net'); } public function setBankDebitForm(?string $bank_debit_form): void @@ -53,12 +51,12 @@ public function setBankDebitForm(?string $bank_debit_form): void public function getBankDebitForm(): ?string { - return $this->data['bank_debit_form']; + return $this->get('bank_debit_form'); } public function getBillingCountry(): string { - return $this->data['billing_country']; + return $this->get('billing_country'); } /** @@ -71,12 +69,12 @@ public function setCalcVatFrom(int $calc_vat_from): void public function getCalcVatFrom(): int { - return $this->data['calc_vat_from']; + return $this->get('calc_vat_from'); } public function getCancelId(): int { - return $this->data['cancel_id']; + return $this->get('cancel_id'); } public function setCashAllowance(?float $cash_allowance): void @@ -86,7 +84,7 @@ public function setCashAllowance(?float $cash_allowance): void public function getCashAllowance(): ?float { - return $this->data['cash_allowance']; + return $this->get('cash_allowance'); } public function setCashAllowanceDays(?int $cash_allowance_days): void @@ -96,7 +94,7 @@ public function setCashAllowanceDays(?int $cash_allowance_days): void public function getCashAllowanceDays(): ?int { - return $this->data['cash_allowance_days']; + return $this->get('cash_allowance_days'); } public function setCashAllowanceText(?string $cash_allowance_text): void @@ -106,7 +104,7 @@ public function setCashAllowanceText(?string $cash_allowance_text): void public function getCashAllowanceText(): ?string { - return $this->data['cash_allowance_text']; + return $this->get('cash_allowance_text'); } public function setContactId(?int $contact_id): void @@ -116,7 +114,7 @@ public function setContactId(?int $contact_id): void public function getContactId(): ?int { - return $this->data['contact_id']; + return $this->get('contact_id'); } public function setContactLabel(string $contact_label): void @@ -126,7 +124,7 @@ public function setContactLabel(string $contact_label): void public function getContactLabel(): string { - return $this->data['contact_label']; + return $this->get('contact_label'); } public function setContactText(string $contact_text): void @@ -136,12 +134,12 @@ public function setContactText(string $contact_text): void public function getContactText(): string { - return $this->data['contact_text']; + return $this->get('contact_text'); } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } public function setCurrency(string $currency): void @@ -151,7 +149,7 @@ public function setCurrency(string $currency): void public function getCurrency(): string { - return $this->data['currency']; + return $this->get('currency'); } public function setCustomerId(?int $customer_id): void @@ -161,12 +159,12 @@ public function setCustomerId(?int $customer_id): void public function getCustomerId(): ?int { - return $this->data['customer_id']; + return $this->get('customer_id'); } public function getCustomerSnapshot(): CustomerSnapshot { - return $this->data['customer_snapshot']; + return $this->getInstance('customer_snapshot', \easybill\SDK\Models\CustomerSnapshot::class); } public function setDiscount(?string $discount): void @@ -176,7 +174,7 @@ public function setDiscount(?string $discount): void public function getDiscount(): ?string { - return $this->data['discount']; + return $this->get('discount'); } public function setDiscountType(?string $discount_type): void @@ -186,7 +184,7 @@ public function setDiscountType(?string $discount_type): void public function getDiscountType(): ?string { - return $this->data['discount_type']; + return $this->get('discount_type'); } public function setDocumentDate(string $document_date): void @@ -196,17 +194,17 @@ public function setDocumentDate(string $document_date): void public function getDocumentDate(): string { - return $this->data['document_date']; + return $this->get('document_date'); } public function getDueDate(): string { - return $this->data['due_date']; + return $this->get('due_date'); } public function getEditedAt(): string { - return $this->data['edited_at']; + return $this->get('edited_at'); } public function setExternalId(?string $external_id): void @@ -216,7 +214,7 @@ public function setExternalId(?string $external_id): void public function getExternalId(): ?string { - return $this->data['external_id']; + return $this->get('external_id'); } public function setReplicaUrl(?string $replica_url): void @@ -226,7 +224,7 @@ public function setReplicaUrl(?string $replica_url): void public function getReplicaUrl(): ?string { - return $this->data['replica_url']; + return $this->get('replica_url'); } /** @@ -239,7 +237,7 @@ public function setGracePeriod(?int $grace_period): void public function getGracePeriod(): ?int { - return $this->data['grace_period']; + return $this->get('grace_period'); } /** @@ -252,12 +250,12 @@ public function setDueInDays(?int $due_in_days): void public function getDueInDays(): ?int { - return $this->data['due_in_days']; + return $this->get('due_in_days'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setIsArchive(bool $is_archive): void @@ -267,12 +265,12 @@ public function setIsArchive(bool $is_archive): void public function getIsArchive(): bool { - return $this->data['is_archive']; + return $this->get('is_archive'); } public function getIsDraft(): bool { - return $this->data['is_draft']; + return $this->get('is_draft'); } /** @@ -285,12 +283,12 @@ public function setIsReplica(bool $is_replica): void public function getIsReplica(): bool { - return $this->data['is_replica']; + return $this->get('is_replica'); } public function getIsCold(): bool { - return $this->data['is_cold']; + return $this->get('is_cold'); } /** @@ -303,7 +301,7 @@ public function setIsOss(bool $is_oss): void public function getIsOss(): bool { - return $this->data['is_oss']; + return $this->get('is_oss'); } /** @@ -316,7 +314,7 @@ public function setColdstorageDueDate(?string $coldstorage_due_date): void public function getColdstorageDueDate(): ?string { - return $this->data['coldstorage_due_date']; + return $this->get('coldstorage_due_date'); } /** @@ -324,7 +322,7 @@ public function getColdstorageDueDate(): ?string */ public function getItemNotes(): array { - return $this->data['item_notes']; + return $this->get('item_notes'); } public function setItems(array $items): void @@ -337,12 +335,12 @@ public function setItems(array $items): void */ public function getItems(): array { - return $this->data['items']; + return $this->get('items'); } public function getLastPostboxId(): int { - return $this->data['last_postbox_id']; + return $this->get('last_postbox_id'); } /** @@ -355,7 +353,7 @@ public function setLoginId(int $login_id): void public function getLoginId(): int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setNumber(?string $number): void @@ -365,7 +363,7 @@ public function setNumber(?string $number): void public function getNumber(): ?string { - return $this->data['number']; + return $this->get('number'); } public function setOrderNumber(string $order_number): void @@ -375,7 +373,7 @@ public function setOrderNumber(string $order_number): void public function getOrderNumber(): string { - return $this->data['order_number']; + return $this->get('order_number'); } public function setBuyerReference(string $buyer_reference): void @@ -385,22 +383,22 @@ public function setBuyerReference(string $buyer_reference): void public function getBuyerReference(): string { - return $this->data['buyer_reference']; + return $this->get('buyer_reference'); } public function getPaidAmount(): int { - return $this->data['paid_amount']; + return $this->get('paid_amount'); } public function getPaidAt(): string { - return $this->data['paid_at']; + return $this->get('paid_at'); } public function getPdfPages(): int { - return $this->data['pdf_pages']; + return $this->get('pdf_pages'); } /** @@ -413,7 +411,7 @@ public function setPdfTemplate(string $pdf_template): void public function getPdfTemplate(): string { - return $this->data['pdf_template']; + return $this->get('pdf_template'); } public function setProjectId(?int $project_id): void @@ -423,7 +421,7 @@ public function setProjectId(?int $project_id): void public function getProjectId(): ?int { - return $this->data['project_id']; + return $this->get('project_id'); } /** @@ -436,7 +434,7 @@ public function setRecurringOptions(DocumentRecurring $recurring_options): void public function getRecurringOptions(): DocumentRecurring { - return $this->data['recurring_options']; + return $this->getInstance('recurring_options', \easybill\SDK\Models\DocumentRecurring::class); } /** @@ -449,7 +447,7 @@ public function setRefId(?int $ref_id): void public function getRefId(): ?int { - return $this->data['ref_id']; + return $this->get('ref_id'); } /** @@ -462,7 +460,7 @@ public function setServiceDate(ServiceDate $service_date): void public function getServiceDate(): ServiceDate { - return $this->data['service_date']; + return $this->getInstance('service_date', \easybill\SDK\Models\ServiceDate::class); } public function setShippingCountry(?string $shipping_country): void @@ -472,7 +470,7 @@ public function setShippingCountry(?string $shipping_country): void public function getShippingCountry(): ?string { - return $this->data['shipping_country']; + return $this->get('shipping_country'); } /** @@ -485,7 +483,7 @@ public function setStatus(?string $status): void public function getStatus(): ?string { - return $this->data['status']; + return $this->get('status'); } public function setText(string $text): void @@ -495,7 +493,7 @@ public function setText(string $text): void public function getText(): string { - return $this->data['text']; + return $this->get('text'); } public function setTextPrefix(string $text_prefix): void @@ -505,7 +503,7 @@ public function setTextPrefix(string $text_prefix): void public function getTextPrefix(): string { - return $this->data['text_prefix']; + return $this->get('text_prefix'); } /** @@ -518,7 +516,7 @@ public function setTextTax(?string $text_tax): void public function getTextTax(): ?string { - return $this->data['text_tax']; + return $this->get('text_tax'); } public function setTitle(?string $title): void @@ -528,7 +526,7 @@ public function setTitle(?string $title): void public function getTitle(): ?string { - return $this->data['title']; + return $this->get('title'); } /** @@ -541,7 +539,7 @@ public function setType(string $type): void public function getType(): string { - return $this->data['type']; + return $this->get('type'); } /** @@ -554,7 +552,7 @@ public function setUseShippingAddress(bool $use_shipping_address): void public function getUseShippingAddress(): bool { - return $this->data['use_shipping_address']; + return $this->get('use_shipping_address'); } public function setVatCountry(?string $vat_country): void @@ -564,12 +562,12 @@ public function setVatCountry(?string $vat_country): void public function getVatCountry(): ?string { - return $this->data['vat_country']; + return $this->get('vat_country'); } public function getVatId(): string { - return $this->data['vat_id']; + return $this->get('vat_id'); } public function setFulfillmentCountry(?string $fulfillment_country): void @@ -579,7 +577,7 @@ public function setFulfillmentCountry(?string $fulfillment_country): void public function getFulfillmentCountry(): ?string { - return $this->data['fulfillment_country']; + return $this->get('fulfillment_country'); } /** @@ -592,6 +590,6 @@ public function setVatOption(?string $vat_option): void public function getVatOption(): ?string { - return $this->data['vat_option']; + return $this->get('vat_option'); } } diff --git a/src/Models/DocumentAddress.php b/src/Models/DocumentAddress.php index 44d1cb5..0f487de 100644 --- a/src/Models/DocumentAddress.php +++ b/src/Models/DocumentAddress.php @@ -5,81 +5,80 @@ namespace easybill\SDK\Models; /** - * Auto-generated with `composer sdk:models`. + * Auto-generated with `composer sdk:models` + * This information comes from the customer which can be set with customer_id. */ -class DocumentAddress +class DocumentAddress implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getSalutation(): int { - return $this->data['salutation']; + return $this->get('salutation'); } public function getPersonal(): bool { - return $this->data['personal']; + return $this->get('personal'); } public function getTitle(): string { - return $this->data['title']; + return $this->get('title'); } public function getFirstName(): string { - return $this->data['first_name']; + return $this->get('first_name'); } public function getLastName(): string { - return $this->data['last_name']; + return $this->get('last_name'); } public function getSuffix1(): string { - return $this->data['suffix_1']; + return $this->get('suffix_1'); } public function getSuffix2(): string { - return $this->data['suffix_2']; + return $this->get('suffix_2'); } public function getCompanyName(): string { - return $this->data['company_name']; + return $this->get('company_name'); } public function getStreet(): string { - return $this->data['street']; + return $this->get('street'); } public function getZipCode(): string { - return $this->data['zip_code']; + return $this->get('zip_code'); } public function getCity(): string { - return $this->data['city']; + return $this->get('city'); } public function getState(): string { - return $this->data['state']; + return $this->get('state'); } public function getCountry(): string { - return $this->data['country']; + return $this->get('country'); } } diff --git a/src/Models/DocumentPayment.php b/src/Models/DocumentPayment.php index 632c2ae..cc43397 100644 --- a/src/Models/DocumentPayment.php +++ b/src/Models/DocumentPayment.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class DocumentPayment +class DocumentPayment implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setAmount(int $amount): void @@ -25,7 +23,7 @@ public function setAmount(int $amount): void public function getAmount(): int { - return $this->data['amount']; + return $this->get('amount'); } public function setDocumentId(int $document_id): void @@ -35,12 +33,12 @@ public function setDocumentId(int $document_id): void public function getDocumentId(): int { - return $this->data['document_id']; + return $this->get('document_id'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setIsOverdueFee(bool $is_overdue_fee): void @@ -50,12 +48,12 @@ public function setIsOverdueFee(bool $is_overdue_fee): void public function getIsOverdueFee(): bool { - return $this->data['is_overdue_fee']; + return $this->get('is_overdue_fee'); } public function getLoginId(): int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setNotice(string $notice): void @@ -65,7 +63,7 @@ public function setNotice(string $notice): void public function getNotice(): string { - return $this->data['notice']; + return $this->get('notice'); } public function setPaymentAt(string $payment_at): void @@ -75,7 +73,7 @@ public function setPaymentAt(string $payment_at): void public function getPaymentAt(): string { - return $this->data['payment_at']; + return $this->get('payment_at'); } public function setType(string $type): void @@ -85,7 +83,7 @@ public function setType(string $type): void public function getType(): string { - return $this->data['type']; + return $this->get('type'); } public function setProvider(string $provider): void @@ -95,7 +93,7 @@ public function setProvider(string $provider): void public function getProvider(): string { - return $this->data['provider']; + return $this->get('provider'); } public function setReference(string $reference): void @@ -105,6 +103,6 @@ public function setReference(string $reference): void public function getReference(): string { - return $this->data['reference']; + return $this->get('reference'); } } diff --git a/src/Models/DocumentPosition.php b/src/Models/DocumentPosition.php index 5139d0f..325d6cb 100644 --- a/src/Models/DocumentPosition.php +++ b/src/Models/DocumentPosition.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class DocumentPosition +class DocumentPosition implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setNumber(?string $number): void @@ -25,7 +23,7 @@ public function setNumber(?string $number): void public function getNumber(): ?string { - return $this->data['number']; + return $this->get('number'); } public function setDescription(?string $description): void @@ -35,7 +33,7 @@ public function setDescription(?string $description): void public function getDescription(): ?string { - return $this->data['description']; + return $this->get('description'); } /** @@ -48,7 +46,7 @@ public function setDocumentNote(string $document_note): void public function getDocumentNote(): string { - return $this->data['document_note']; + return $this->get('document_note'); } public function setQuantity(float $quantity): void @@ -58,7 +56,7 @@ public function setQuantity(float $quantity): void public function getQuantity(): float { - return $this->data['quantity']; + return $this->get('quantity'); } /** @@ -71,7 +69,7 @@ public function setQuantityStr(string $quantity_str): void public function getQuantityStr(): string { - return $this->data['quantity_str']; + return $this->get('quantity_str'); } public function setUnit(?string $unit): void @@ -81,7 +79,7 @@ public function setUnit(?string $unit): void public function getUnit(): ?string { - return $this->data['unit']; + return $this->get('unit'); } public function setType(string $type): void @@ -91,7 +89,7 @@ public function setType(string $type): void public function getType(): string { - return $this->data['type']; + return $this->get('type'); } /** @@ -104,7 +102,7 @@ public function setPosition(int $position): void public function getPosition(): int { - return $this->data['position']; + return $this->get('position'); } public function setSinglePriceNet(?float $single_price_net): void @@ -114,12 +112,12 @@ public function setSinglePriceNet(?float $single_price_net): void public function getSinglePriceNet(): ?float { - return $this->data['single_price_net']; + return $this->get('single_price_net'); } public function getSinglePriceGross(): float { - return $this->data['single_price_gross']; + return $this->get('single_price_gross'); } public function setVatPercent(float $vat_percent): void @@ -129,7 +127,7 @@ public function setVatPercent(float $vat_percent): void public function getVatPercent(): float { - return $this->data['vat_percent']; + return $this->get('vat_percent'); } public function setDiscount(?float $discount): void @@ -139,7 +137,7 @@ public function setDiscount(?float $discount): void public function getDiscount(): ?float { - return $this->data['discount']; + return $this->get('discount'); } public function setDiscountType(?string $discount_type): void @@ -149,7 +147,7 @@ public function setDiscountType(?string $discount_type): void public function getDiscountType(): ?string { - return $this->data['discount_type']; + return $this->get('discount_type'); } /** @@ -162,32 +160,32 @@ public function setPositionId(?int $position_id): void public function getPositionId(): ?int { - return $this->data['position_id']; + return $this->get('position_id'); } public function getTotalPriceNet(): float { - return $this->data['total_price_net']; + return $this->get('total_price_net'); } public function getTotalPriceGross(): float { - return $this->data['total_price_gross']; + return $this->get('total_price_gross'); } public function getTotalVat(): float { - return $this->data['total_vat']; + return $this->get('total_vat'); } public function getSerialNumberId(): string { - return $this->data['serial_number_id']; + return $this->get('serial_number_id'); } public function getSerialNumber(): string { - return $this->data['serial_number']; + return $this->get('serial_number'); } public function setBookingAccount(?string $booking_account): void @@ -197,7 +195,7 @@ public function setBookingAccount(?string $booking_account): void public function getBookingAccount(): ?string { - return $this->data['booking_account']; + return $this->get('booking_account'); } public function setExportCost1(?string $export_cost_1): void @@ -207,7 +205,7 @@ public function setExportCost1(?string $export_cost_1): void public function getExportCost1(): ?string { - return $this->data['export_cost_1']; + return $this->get('export_cost_1'); } public function setExportCost2(?string $export_cost_2): void @@ -217,7 +215,7 @@ public function setExportCost2(?string $export_cost_2): void public function getExportCost2(): ?string { - return $this->data['export_cost_2']; + return $this->get('export_cost_2'); } public function setCostPriceNet(?float $cost_price_net): void @@ -227,22 +225,22 @@ public function setCostPriceNet(?float $cost_price_net): void public function getCostPriceNet(): ?float { - return $this->data['cost_price_net']; + return $this->get('cost_price_net'); } public function getCostPriceTotal(): float { - return $this->data['cost_price_total']; + return $this->get('cost_price_total'); } public function getCostPriceCharge(): float { - return $this->data['cost_price_charge']; + return $this->get('cost_price_charge'); } public function getCostPriceChargeType(): string { - return $this->data['cost_price_charge_type']; + return $this->get('cost_price_charge_type'); } public function setItemType(string $itemType): void @@ -252,11 +250,11 @@ public function setItemType(string $itemType): void public function getItemType(): string { - return $this->data['itemType']; + return $this->get('itemType'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } } diff --git a/src/Models/DocumentRecurring.php b/src/Models/DocumentRecurring.php index 9ccdda6..3735c97 100644 --- a/src/Models/DocumentRecurring.php +++ b/src/Models/DocumentRecurring.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class DocumentRecurring +class DocumentRecurring implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } /** @@ -28,7 +26,7 @@ public function setNextDate(string $next_date): void public function getNextDate(): string { - return $this->data['next_date']; + return $this->get('next_date'); } public function setFrequency(string $frequency): void @@ -38,7 +36,7 @@ public function setFrequency(string $frequency): void public function getFrequency(): string { - return $this->data['frequency']; + return $this->get('frequency'); } public function setFrequencySpecial(?string $frequency_special): void @@ -48,7 +46,7 @@ public function setFrequencySpecial(?string $frequency_special): void public function getFrequencySpecial(): ?string { - return $this->data['frequency_special']; + return $this->get('frequency_special'); } public function setInterval(int $interval): void @@ -58,7 +56,7 @@ public function setInterval(int $interval): void public function getInterval(): int { - return $this->data['interval']; + return $this->get('interval'); } /** @@ -71,7 +69,7 @@ public function setEndDateOrCount(?string $end_date_or_count): void public function getEndDateOrCount(): ?string { - return $this->data['end_date_or_count']; + return $this->get('end_date_or_count'); } public function setStatus(string $status): void @@ -81,7 +79,7 @@ public function setStatus(string $status): void public function getStatus(): string { - return $this->data['status']; + return $this->get('status'); } public function setAsDraft(bool $as_draft): void @@ -91,7 +89,7 @@ public function setAsDraft(bool $as_draft): void public function getAsDraft(): bool { - return $this->data['as_draft']; + return $this->get('as_draft'); } public function setIsNotify(bool $is_notify): void @@ -101,7 +99,7 @@ public function setIsNotify(bool $is_notify): void public function getIsNotify(): bool { - return $this->data['is_notify']; + return $this->get('is_notify'); } public function setSendAs(?string $send_as): void @@ -111,7 +109,7 @@ public function setSendAs(?string $send_as): void public function getSendAs(): ?string { - return $this->data['send_as']; + return $this->get('send_as'); } public function setIsSign(bool $is_sign): void @@ -121,7 +119,7 @@ public function setIsSign(bool $is_sign): void public function getIsSign(): bool { - return $this->data['is_sign']; + return $this->get('is_sign'); } public function setIsPaid(bool $is_paid): void @@ -131,7 +129,7 @@ public function setIsPaid(bool $is_paid): void public function getIsPaid(): bool { - return $this->data['is_paid']; + return $this->get('is_paid'); } /** @@ -144,7 +142,7 @@ public function setPaidDateOption(string $paid_date_option): void public function getPaidDateOption(): string { - return $this->data['paid_date_option']; + return $this->get('paid_date_option'); } public function setIsSepa(bool $is_sepa): void @@ -154,7 +152,7 @@ public function setIsSepa(bool $is_sepa): void public function getIsSepa(): bool { - return $this->data['is_sepa']; + return $this->get('is_sepa'); } public function setSepaLocalInstrument(?string $sepa_local_instrument): void @@ -164,7 +162,7 @@ public function setSepaLocalInstrument(?string $sepa_local_instrument): void public function getSepaLocalInstrument(): ?string { - return $this->data['sepa_local_instrument']; + return $this->get('sepa_local_instrument'); } public function setSepaSequenceType(?string $sepa_sequence_type): void @@ -174,7 +172,7 @@ public function setSepaSequenceType(?string $sepa_sequence_type): void public function getSepaSequenceType(): ?string { - return $this->data['sepa_sequence_type']; + return $this->get('sepa_sequence_type'); } public function setSepaReference(?string $sepa_reference): void @@ -184,7 +182,7 @@ public function setSepaReference(?string $sepa_reference): void public function getSepaReference(): ?string { - return $this->data['sepa_reference']; + return $this->get('sepa_reference'); } public function setSepaRemittanceInformation(?string $sepa_remittance_information): void @@ -194,7 +192,7 @@ public function setSepaRemittanceInformation(?string $sepa_remittance_informatio public function getSepaRemittanceInformation(): ?string { - return $this->data['sepa_remittance_information']; + return $this->get('sepa_remittance_information'); } /** @@ -207,6 +205,6 @@ public function setTargetType(string $target_type): void public function getTargetType(): string { - return $this->data['target_type']; + return $this->get('target_type'); } } diff --git a/src/Models/Login.php b/src/Models/Login.php index 908e3bc..c0d76c7 100644 --- a/src/Models/Login.php +++ b/src/Models/Login.php @@ -7,20 +7,18 @@ /** * Auto-generated with `composer sdk:models`. */ -class Login +class Login implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setFirstName(string $first_name): void @@ -30,7 +28,7 @@ public function setFirstName(string $first_name): void public function getFirstName(): string { - return $this->data['first_name']; + return $this->get('first_name'); } public function setLastName(string $last_name): void @@ -40,12 +38,12 @@ public function setLastName(string $last_name): void public function getLastName(): string { - return $this->data['last_name']; + return $this->get('last_name'); } public function getDisplayName(): string { - return $this->data['display_name']; + return $this->get('display_name'); } public function setPhone(string $phone): void @@ -55,7 +53,7 @@ public function setPhone(string $phone): void public function getPhone(): string { - return $this->data['phone']; + return $this->get('phone'); } public function setEmail(string $email): void @@ -65,7 +63,7 @@ public function setEmail(string $email): void public function getEmail(): string { - return $this->data['email']; + return $this->get('email'); } public function setEmailSignature(string $email_signature): void @@ -75,7 +73,7 @@ public function setEmailSignature(string $email_signature): void public function getEmailSignature(): string { - return $this->data['email_signature']; + return $this->get('email_signature'); } public function setLoginType(string $login_type): void @@ -85,7 +83,7 @@ public function setLoginType(string $login_type): void public function getLoginType(): string { - return $this->data['login_type']; + return $this->get('login_type'); } public function setLocale(string $locale): void @@ -95,7 +93,7 @@ public function setLocale(string $locale): void public function getLocale(): string { - return $this->data['locale']; + return $this->get('locale'); } public function setTimeZone(string $time_zone): void @@ -105,7 +103,7 @@ public function setTimeZone(string $time_zone): void public function getTimeZone(): string { - return $this->data['time_zone']; + return $this->get('time_zone'); } public function setSecurity(LoginSecurity $security): void @@ -115,6 +113,6 @@ public function setSecurity(LoginSecurity $security): void public function getSecurity(): LoginSecurity { - return $this->data['security']; + return $this->getInstance('security', \easybill\SDK\Models\LoginSecurity::class); } } diff --git a/src/Models/LoginSecurity.php b/src/Models/LoginSecurity.php index a424d2c..1fcfc1b 100644 --- a/src/Models/LoginSecurity.php +++ b/src/Models/LoginSecurity.php @@ -8,29 +8,27 @@ * Auto-generated with `composer sdk:models` * This object is only displayed if your request the login resource as an admin. Otherwise this property will be null. */ -class LoginSecurity +class LoginSecurity implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getTwoFactorEnabled(): bool { - return $this->data['two_factor_enabled']; + return $this->get('two_factor_enabled'); } public function getRecoveryCodesEnabled(): bool { - return $this->data['recovery_codes_enabled']; + return $this->get('recovery_codes_enabled'); } public function getNotifyOnNewLoginEnabled(): bool { - return $this->data['notify_on_new_login_enabled']; + return $this->get('notify_on_new_login_enabled'); } } diff --git a/src/Models/PDFTemplate.php b/src/Models/PDFTemplate.php index cd78a4d..7c6c28a 100644 --- a/src/Models/PDFTemplate.php +++ b/src/Models/PDFTemplate.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class PDFTemplate +class PDFTemplate implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setId(string $id): void @@ -25,7 +23,7 @@ public function setId(string $id): void public function getId(): string { - return $this->data['id']; + return $this->get('id'); } public function setName(string $name): void @@ -35,7 +33,7 @@ public function setName(string $name): void public function getName(): string { - return $this->data['name']; + return $this->get('name'); } public function setPdfTemplate(string $pdf_template): void @@ -45,7 +43,7 @@ public function setPdfTemplate(string $pdf_template): void public function getPdfTemplate(): string { - return $this->data['pdf_template']; + return $this->get('pdf_template'); } public function setDocumentType(string $document_type): void @@ -55,6 +53,6 @@ public function setDocumentType(string $document_type): void public function getDocumentType(): string { - return $this->data['document_type']; + return $this->get('document_type'); } } diff --git a/src/Models/Position.php b/src/Models/Position.php index 246efbf..db33833 100644 --- a/src/Models/Position.php +++ b/src/Models/Position.php @@ -7,20 +7,18 @@ /** * Auto-generated with `composer sdk:models`. */ -class Position +class Position implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setType(string $type): void @@ -30,7 +28,7 @@ public function setType(string $type): void public function getType(): string { - return $this->data['type']; + return $this->get('type'); } public function setNumber(string $number): void @@ -40,7 +38,7 @@ public function setNumber(string $number): void public function getNumber(): string { - return $this->data['number']; + return $this->get('number'); } /** @@ -53,7 +51,7 @@ public function setDescription(string $description): void public function getDescription(): string { - return $this->data['description']; + return $this->get('description'); } /** @@ -66,7 +64,7 @@ public function setDocumentNote(string $document_note): void public function getDocumentNote(): string { - return $this->data['document_note']; + return $this->get('document_note'); } /** @@ -79,7 +77,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->data['note']; + return $this->get('note'); } public function setUnit(?string $unit): void @@ -89,7 +87,7 @@ public function setUnit(?string $unit): void public function getUnit(): ?string { - return $this->data['unit']; + return $this->get('unit'); } /** @@ -102,22 +100,22 @@ public function setExportIdentifier(?string $export_identifier): void public function getExportIdentifier(): ?string { - return $this->data['export_identifier']; + return $this->get('export_identifier'); } - public function setExportIdentifierExtended(\stdClass $export_identifier_extended): void + public function setExportIdentifierExtended(PositionExportIdentifierExtended $export_identifier_extended): void { $this->data['export_identifier_extended'] = $export_identifier_extended; } - public function getExportIdentifierExtended(): \stdClass + public function getExportIdentifierExtended(): PositionExportIdentifierExtended { - return $this->data['export_identifier_extended']; + return $this->getInstance('export_identifier_extended', \easybill\SDK\Models\PositionExportIdentifierExtended::class); } public function getLoginId(): int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setPriceType(string $price_type): void @@ -127,7 +125,7 @@ public function setPriceType(string $price_type): void public function getPriceType(): string { - return $this->data['price_type']; + return $this->get('price_type'); } public function setVatPercent(float $vat_percent): void @@ -137,7 +135,7 @@ public function setVatPercent(float $vat_percent): void public function getVatPercent(): float { - return $this->data['vat_percent']; + return $this->get('vat_percent'); } /** @@ -150,7 +148,7 @@ public function setSalePrice(float $sale_price): void public function getSalePrice(): float { - return $this->data['sale_price']; + return $this->get('sale_price'); } /** @@ -163,7 +161,7 @@ public function setSalePrice2(?float $sale_price2): void public function getSalePrice2(): ?float { - return $this->data['sale_price2']; + return $this->get('sale_price2'); } /** @@ -176,7 +174,7 @@ public function setSalePrice3(?float $sale_price3): void public function getSalePrice3(): ?float { - return $this->data['sale_price3']; + return $this->get('sale_price3'); } /** @@ -189,7 +187,7 @@ public function setSalePrice4(?float $sale_price4): void public function getSalePrice4(): ?float { - return $this->data['sale_price4']; + return $this->get('sale_price4'); } /** @@ -202,7 +200,7 @@ public function setSalePrice5(?float $sale_price5): void public function getSalePrice5(): ?float { - return $this->data['sale_price5']; + return $this->get('sale_price5'); } /** @@ -215,7 +213,7 @@ public function setSalePrice6(?float $sale_price6): void public function getSalePrice6(): ?float { - return $this->data['sale_price6']; + return $this->get('sale_price6'); } /** @@ -228,7 +226,7 @@ public function setSalePrice7(?float $sale_price7): void public function getSalePrice7(): ?float { - return $this->data['sale_price7']; + return $this->get('sale_price7'); } /** @@ -241,7 +239,7 @@ public function setSalePrice8(?float $sale_price8): void public function getSalePrice8(): ?float { - return $this->data['sale_price8']; + return $this->get('sale_price8'); } /** @@ -254,7 +252,7 @@ public function setSalePrice9(?float $sale_price9): void public function getSalePrice9(): ?float { - return $this->data['sale_price9']; + return $this->get('sale_price9'); } /** @@ -267,7 +265,7 @@ public function setSalePrice10(?float $sale_price10): void public function getSalePrice10(): ?float { - return $this->data['sale_price10']; + return $this->get('sale_price10'); } /** @@ -280,7 +278,7 @@ public function setCostPrice(?float $cost_price): void public function getCostPrice(): ?float { - return $this->data['cost_price']; + return $this->get('cost_price'); } public function setExportCost1(?string $export_cost1): void @@ -290,7 +288,7 @@ public function setExportCost1(?string $export_cost1): void public function getExportCost1(): ?string { - return $this->data['export_cost1']; + return $this->get('export_cost1'); } public function setExportCost2(?string $export_cost2): void @@ -300,7 +298,7 @@ public function setExportCost2(?string $export_cost2): void public function getExportCost2(): ?string { - return $this->data['export_cost2']; + return $this->get('export_cost2'); } public function setGroupId(?int $group_id): void @@ -310,7 +308,7 @@ public function setGroupId(?int $group_id): void public function getGroupId(): ?int { - return $this->data['group_id']; + return $this->get('group_id'); } /** @@ -323,12 +321,12 @@ public function setStock(string $stock): void public function getStock(): string { - return $this->data['stock']; + return $this->get('stock'); } public function getStockCount(): int { - return $this->data['stock_count']; + return $this->get('stock_count'); } /** @@ -341,7 +339,7 @@ public function setStockLimitNotify(bool $stock_limit_notify): void public function getStockLimitNotify(): bool { - return $this->data['stock_limit_notify']; + return $this->get('stock_limit_notify'); } /** @@ -354,7 +352,7 @@ public function setStockLimitNotifyFrequency(string $stock_limit_notify_frequenc public function getStockLimitNotifyFrequency(): string { - return $this->data['stock_limit_notify_frequency']; + return $this->get('stock_limit_notify_frequency'); } public function setStockLimit(int $stock_limit): void @@ -364,7 +362,7 @@ public function setStockLimit(int $stock_limit): void public function getStockLimit(): int { - return $this->data['stock_limit']; + return $this->get('stock_limit'); } /** @@ -377,6 +375,6 @@ public function setQuantity(?float $quantity): void public function getQuantity(): ?float { - return $this->data['quantity']; + return $this->get('quantity'); } } diff --git a/src/Models/PositionExportIdentifierExtended.php b/src/Models/PositionExportIdentifierExtended.php new file mode 100644 index 0000000..acea148 --- /dev/null +++ b/src/Models/PositionExportIdentifierExtended.php @@ -0,0 +1,148 @@ +data = $data; + } + + /** + * Umsatzsteuerpflichtig. + */ + public function setNULL(?string $NULL): void + { + $this->data['NULL'] = $NULL; + } + + public function getNULL(): ?string + { + return $this->get('NULL'); + } + + /** + * Nicht steuerbar (Drittland). + */ + public function setNStb(?string $nStb): void + { + $this->data['nStb'] = $nStb; + } + + public function getNStb(): ?string + { + return $this->get('nStb'); + } + + /** + * Nicht steuerbar (EU mit USt-IdNr.). + */ + public function setNStbUstID(?string $nStbUstID): void + { + $this->data['nStbUstID'] = $nStbUstID; + } + + public function getNStbUstID(): ?string + { + return $this->get('nStbUstID'); + } + + /** + * Nicht steuerbar (EU ohne USt-IdNr.). + */ + public function setNStbNoneUstID(?string $nStbNoneUstID): void + { + $this->data['nStbNoneUstID'] = $nStbNoneUstID; + } + + public function getNStbNoneUstID(): ?string + { + return $this->get('nStbNoneUstID'); + } + + /** + * Nicht steuerbarer Innenumsatz. + */ + public function setNStbIm(?string $nStbIm): void + { + $this->data['nStbIm'] = $nStbIm; + } + + public function getNStbIm(): ?string + { + return $this->get('nStbIm'); + } + + /** + * Steuerschuldwechsel §13b (Inland). + */ + public function setRevc(?string $revc): void + { + $this->data['revc'] = $revc; + } + + public function getRevc(): ?string + { + return $this->get('revc'); + } + + /** + * Innergemeinschaftliche Lieferung. + */ + public function setIG(?string $IG): void + { + $this->data['IG'] = $IG; + } + + public function getIG(): ?string + { + return $this->get('IG'); + } + + /** + * Ausfuhrlieferung. + */ + public function setAL(?string $AL): void + { + $this->data['AL'] = $AL; + } + + public function getAL(): ?string + { + return $this->get('AL'); + } + + /** + * sonstige Steuerbefreiung. + */ + public function setSStfr(?string $sStfr): void + { + $this->data['sStfr'] = $sStfr; + } + + public function getSStfr(): ?string + { + return $this->get('sStfr'); + } + + /** + * Kleinunternehmen (Keine MwSt.). + */ + public function setSmallBusiness(?string $smallBusiness): void + { + $this->data['smallBusiness'] = $smallBusiness; + } + + public function getSmallBusiness(): ?string + { + return $this->get('smallBusiness'); + } +} diff --git a/src/Models/PositionGroup.php b/src/Models/PositionGroup.php index 5b5bb3e..a00a6e9 100644 --- a/src/Models/PositionGroup.php +++ b/src/Models/PositionGroup.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class PositionGroup +class PositionGroup implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setDescription(?string $description): void @@ -25,12 +23,12 @@ public function setDescription(?string $description): void public function getDescription(): ?string { - return $this->data['description']; + return $this->get('description'); } public function getLoginId(): int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setName(string $name): void @@ -40,7 +38,7 @@ public function setName(string $name): void public function getName(): string { - return $this->data['name']; + return $this->get('name'); } public function setNumber(string $number): void @@ -50,16 +48,16 @@ public function setNumber(string $number): void public function getNumber(): string { - return $this->data['number']; + return $this->get('number'); } public function getDisplayName(): string { - return $this->data['display_name']; + return $this->get('display_name'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } } diff --git a/src/Models/PostBox.php b/src/Models/PostBox.php index 221d0ca..04883bf 100644 --- a/src/Models/PostBox.php +++ b/src/Models/PostBox.php @@ -7,20 +7,18 @@ /** * Auto-generated with `composer sdk:models`. */ -class PostBox +class PostBox implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setDocumentId(int $document_id): void @@ -30,7 +28,7 @@ public function setDocumentId(int $document_id): void public function getDocumentId(): int { - return $this->data['document_id']; + return $this->get('document_id'); } public function setTo(string $to): void @@ -40,7 +38,7 @@ public function setTo(string $to): void public function getTo(): string { - return $this->data['to']; + return $this->get('to'); } public function setCc(string $cc): void @@ -50,7 +48,7 @@ public function setCc(string $cc): void public function getCc(): string { - return $this->data['cc']; + return $this->get('cc'); } public function setFrom(string $from): void @@ -60,7 +58,7 @@ public function setFrom(string $from): void public function getFrom(): string { - return $this->data['from']; + return $this->get('from'); } public function setSubject(string $subject): void @@ -70,7 +68,7 @@ public function setSubject(string $subject): void public function getSubject(): string { - return $this->data['subject']; + return $this->get('subject'); } public function setMessage(string $message): void @@ -80,7 +78,7 @@ public function setMessage(string $message): void public function getMessage(): string { - return $this->data['message']; + return $this->get('message'); } public function setDate(string $date): void @@ -90,7 +88,7 @@ public function setDate(string $date): void public function getDate(): string { - return $this->data['date']; + return $this->get('date'); } public function setCreatedAt(string $created_at): void @@ -100,7 +98,7 @@ public function setCreatedAt(string $created_at): void public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } public function setProcessedAt(string $processed_at): void @@ -110,7 +108,7 @@ public function setProcessedAt(string $processed_at): void public function getProcessedAt(): string { - return $this->data['processed_at']; + return $this->get('processed_at'); } public function setSendBySelf(bool $send_by_self): void @@ -120,7 +118,7 @@ public function setSendBySelf(bool $send_by_self): void public function getSendBySelf(): bool { - return $this->data['send_by_self']; + return $this->get('send_by_self'); } public function setSendWithAttachment(bool $send_with_attachment): void @@ -130,7 +128,7 @@ public function setSendWithAttachment(bool $send_with_attachment): void public function getSendWithAttachment(): bool { - return $this->data['send_with_attachment']; + return $this->get('send_with_attachment'); } public function setType(string $type): void @@ -140,7 +138,7 @@ public function setType(string $type): void public function getType(): string { - return $this->data['type']; + return $this->get('type'); } public function setStatus(string $status): void @@ -150,7 +148,7 @@ public function setStatus(string $status): void public function getStatus(): string { - return $this->data['status']; + return $this->get('status'); } public function setStatusMsg(string $status_msg): void @@ -160,12 +158,12 @@ public function setStatusMsg(string $status_msg): void public function getStatusMsg(): string { - return $this->data['status_msg']; + return $this->get('status_msg'); } public function getLoginId(): int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setDocumentFileType(?string $document_file_type): void @@ -175,7 +173,7 @@ public function setDocumentFileType(?string $document_file_type): void public function getDocumentFileType(): ?string { - return $this->data['document_file_type']; + return $this->get('document_file_type'); } /** @@ -196,11 +194,11 @@ public function setPostSendType(string $post_send_type): void public function getPostSendType(): string { - return $this->data['post_send_type']; + return $this->get('post_send_type'); } public function getTrackingIdentifier(): string { - return $this->data['tracking_identifier']; + return $this->get('tracking_identifier'); } } diff --git a/src/Models/PostBoxRequest.php b/src/Models/PostBoxRequest.php index a3f3495..ce518bc 100644 --- a/src/Models/PostBoxRequest.php +++ b/src/Models/PostBoxRequest.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class PostBoxRequest +class PostBoxRequest implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setTo(string $to): void @@ -25,7 +23,7 @@ public function setTo(string $to): void public function getTo(): string { - return $this->data['to']; + return $this->get('to'); } public function setCc(string $cc): void @@ -35,7 +33,7 @@ public function setCc(string $cc): void public function getCc(): string { - return $this->data['cc']; + return $this->get('cc'); } public function setFrom(string $from): void @@ -45,7 +43,7 @@ public function setFrom(string $from): void public function getFrom(): string { - return $this->data['from']; + return $this->get('from'); } public function setSubject(string $subject): void @@ -55,7 +53,7 @@ public function setSubject(string $subject): void public function getSubject(): string { - return $this->data['subject']; + return $this->get('subject'); } public function setMessage(string $message): void @@ -65,7 +63,7 @@ public function setMessage(string $message): void public function getMessage(): string { - return $this->data['message']; + return $this->get('message'); } public function setDate(string $date): void @@ -75,7 +73,7 @@ public function setDate(string $date): void public function getDate(): string { - return $this->data['date']; + return $this->get('date'); } /** @@ -88,7 +86,7 @@ public function setDocumentFileType(?string $document_file_type): void public function getDocumentFileType(): ?string { - return $this->data['document_file_type']; + return $this->get('document_file_type'); } /** @@ -109,6 +107,6 @@ public function setPostSendType(string $post_send_type): void public function getPostSendType(): string { - return $this->data['post_send_type']; + return $this->get('post_send_type'); } } diff --git a/src/Models/Project.php b/src/Models/Project.php index 3ab3e31..1ad5272 100644 --- a/src/Models/Project.php +++ b/src/Models/Project.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class Project +class Project implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } /** @@ -28,7 +26,7 @@ public function setBudgetAmount(int $budget_amount): void public function getBudgetAmount(): int { - return $this->data['budget_amount']; + return $this->get('budget_amount'); } /** @@ -41,7 +39,7 @@ public function setBudgetTime(int $budget_time): void public function getBudgetTime(): int { - return $this->data['budget_time']; + return $this->get('budget_time'); } public function setCustomerId(?int $customer_id): void @@ -51,7 +49,7 @@ public function setCustomerId(?int $customer_id): void public function getCustomerId(): ?int { - return $this->data['customer_id']; + return $this->get('customer_id'); } /** @@ -64,12 +62,12 @@ public function setHourlyRate(float $hourly_rate): void public function getHourlyRate(): float { - return $this->data['hourly_rate']; + return $this->get('hourly_rate'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } /** @@ -82,7 +80,7 @@ public function setLoginId(?int $login_id): void public function getLoginId(): ?int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setName(string $name): void @@ -92,7 +90,7 @@ public function setName(string $name): void public function getName(): string { - return $this->data['name']; + return $this->get('name'); } public function setNote(?string $note): void @@ -102,7 +100,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->data['note']; + return $this->get('note'); } public function setStatus(string $status): void @@ -112,7 +110,7 @@ public function setStatus(string $status): void public function getStatus(): string { - return $this->data['status']; + return $this->get('status'); } public function setDueAt(?string $due_at): void @@ -122,7 +120,7 @@ public function setDueAt(?string $due_at): void public function getDueAt(): ?string { - return $this->data['due_at']; + return $this->get('due_at'); } public function setBudgetNotifyFrequency(string $budget_notify_frequency): void @@ -132,16 +130,16 @@ public function setBudgetNotifyFrequency(string $budget_notify_frequency): void public function getBudgetNotifyFrequency(): string { - return $this->data['budget_notify_frequency']; + return $this->get('budget_notify_frequency'); } public function getConsumedTime(): int { - return $this->data['consumed_time']; + return $this->get('consumed_time'); } public function getConsumedAmount(): int { - return $this->data['consumed_amount']; + return $this->get('consumed_amount'); } } diff --git a/src/Models/SEPAPayment.php b/src/Models/SEPAPayment.php index 0d8eb2d..aca1803 100644 --- a/src/Models/SEPAPayment.php +++ b/src/Models/SEPAPayment.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class SEPAPayment +class SEPAPayment implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } /** @@ -28,12 +26,12 @@ public function setAmount(int $amount): void public function getAmount(): int { - return $this->data['amount']; + return $this->get('amount'); } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } /** @@ -46,7 +44,7 @@ public function setCreditorBic(?string $creditor_bic): void public function getCreditorBic(): ?string { - return $this->data['creditor_bic']; + return $this->get('creditor_bic'); } /** @@ -59,7 +57,7 @@ public function setCreditorIban(?string $creditor_iban): void public function getCreditorIban(): ?string { - return $this->data['creditor_iban']; + return $this->get('creditor_iban'); } /** @@ -72,7 +70,7 @@ public function setCreditorName(?string $creditor_name): void public function getCreditorName(): ?string { - return $this->data['creditor_name']; + return $this->get('creditor_name'); } /** @@ -85,7 +83,7 @@ public function setDebitorBic(?string $debitor_bic): void public function getDebitorBic(): ?string { - return $this->data['debitor_bic']; + return $this->get('debitor_bic'); } /** @@ -98,7 +96,7 @@ public function setDebitorIban(?string $debitor_iban): void public function getDebitorIban(): ?string { - return $this->data['debitor_iban']; + return $this->get('debitor_iban'); } /** @@ -111,7 +109,7 @@ public function setDebitorName(?string $debitor_name): void public function getDebitorName(): ?string { - return $this->data['debitor_name']; + return $this->get('debitor_name'); } /** @@ -124,7 +122,7 @@ public function setDebitorAddressLine1(string $debitor_address_line_1): void public function getDebitorAddressLine1(): string { - return $this->data['debitor_address_line_1']; + return $this->get('debitor_address_line_1'); } /** @@ -137,7 +135,7 @@ public function setDebitorAddressLine2(string $debitor_address_line2): void public function getDebitorAddressLine2(): string { - return $this->data['debitor_address_line2']; + return $this->get('debitor_address_line2'); } /** @@ -150,7 +148,7 @@ public function setDebitorCountry(string $debitor_country): void public function getDebitorCountry(): string { - return $this->data['debitor_country']; + return $this->get('debitor_country'); } public function setDocumentId(int $document_id): void @@ -160,7 +158,7 @@ public function setDocumentId(int $document_id): void public function getDocumentId(): int { - return $this->data['document_id']; + return $this->get('document_id'); } /** @@ -173,17 +171,17 @@ public function setExportAt(?string $export_at): void public function getExportAt(): ?string { - return $this->data['export_at']; + return $this->get('export_at'); } public function getExportError(): string { - return $this->data['export_error']; + return $this->get('export_error'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } /** @@ -196,7 +194,7 @@ public function setLocalInstrument(string $local_instrument): void public function getLocalInstrument(): string { - return $this->data['local_instrument']; + return $this->get('local_instrument'); } public function setMandateDateOfSignature(string $mandate_date_of_signature): void @@ -206,7 +204,7 @@ public function setMandateDateOfSignature(string $mandate_date_of_signature): vo public function getMandateDateOfSignature(): string { - return $this->data['mandate_date_of_signature']; + return $this->get('mandate_date_of_signature'); } public function setMandateId(string $mandate_id): void @@ -216,7 +214,7 @@ public function setMandateId(string $mandate_id): void public function getMandateId(): string { - return $this->data['mandate_id']; + return $this->get('mandate_id'); } public function setReference(string $reference): void @@ -226,7 +224,7 @@ public function setReference(string $reference): void public function getReference(): string { - return $this->data['reference']; + return $this->get('reference'); } public function setRemittanceInformation(?string $remittance_information): void @@ -236,7 +234,7 @@ public function setRemittanceInformation(?string $remittance_information): void public function getRemittanceInformation(): ?string { - return $this->data['remittance_information']; + return $this->get('remittance_information'); } /** @@ -249,7 +247,7 @@ public function setRequestedAt(string $requested_at): void public function getRequestedAt(): string { - return $this->data['requested_at']; + return $this->get('requested_at'); } /** @@ -262,12 +260,12 @@ public function setSequenceType(string $sequence_type): void public function getSequenceType(): string { - return $this->data['sequence_type']; + return $this->get('sequence_type'); } public function getUpdatedAt(): string { - return $this->data['updated_at']; + return $this->get('updated_at'); } public function setType(string $type): void @@ -277,6 +275,6 @@ public function setType(string $type): void public function getType(): string { - return $this->data['type']; + return $this->get('type'); } } diff --git a/src/Models/SerialNumber.php b/src/Models/SerialNumber.php index 655b8dd..9cea8e6 100644 --- a/src/Models/SerialNumber.php +++ b/src/Models/SerialNumber.php @@ -7,20 +7,18 @@ /** * Auto-generated with `composer sdk:models`. */ -class SerialNumber +class SerialNumber implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setSerialNumber(string $serial_number): void @@ -30,7 +28,7 @@ public function setSerialNumber(string $serial_number): void public function getSerialNumber(): string { - return $this->data['serial_number']; + return $this->get('serial_number'); } public function setPositionId(int $position_id): void @@ -40,26 +38,26 @@ public function setPositionId(int $position_id): void public function getPositionId(): int { - return $this->data['position_id']; + return $this->get('position_id'); } public function getDocumentId(): ?int { - return $this->data['document_id']; + return $this->get('document_id'); } public function getDocumentPositionId(): ?int { - return $this->data['document_position_id']; + return $this->get('document_position_id'); } public function getUsedAt(): ?string { - return $this->data['used_at']; + return $this->get('used_at'); } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } } diff --git a/src/Models/ServiceDate.php b/src/Models/ServiceDate.php index 3a87a3a..09bfe21 100644 --- a/src/Models/ServiceDate.php +++ b/src/Models/ServiceDate.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class ServiceDate +class ServiceDate implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } /** @@ -28,7 +26,7 @@ public function setType(string $type): void public function getType(): string { - return $this->data['type']; + return $this->get('type'); } public function setDate(?string $date): void @@ -38,7 +36,7 @@ public function setDate(?string $date): void public function getDate(): ?string { - return $this->data['date']; + return $this->get('date'); } public function setDateFrom(?string $date_from): void @@ -48,7 +46,7 @@ public function setDateFrom(?string $date_from): void public function getDateFrom(): ?string { - return $this->data['date_from']; + return $this->get('date_from'); } public function setDateTo(?string $date_to): void @@ -58,7 +56,7 @@ public function setDateTo(?string $date_to): void public function getDateTo(): ?string { - return $this->data['date_to']; + return $this->get('date_to'); } public function setText(?string $text): void @@ -68,6 +66,6 @@ public function setText(?string $text): void public function getText(): ?string { - return $this->data['text']; + return $this->get('text'); } } diff --git a/src/Models/Stock.php b/src/Models/Stock.php index 37cf28e..5b8652f 100644 --- a/src/Models/Stock.php +++ b/src/Models/Stock.php @@ -7,20 +7,18 @@ /** * Auto-generated with `composer sdk:models`. */ -class Stock +class Stock implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setNote(string $note): void @@ -30,7 +28,7 @@ public function setNote(string $note): void public function getNote(): string { - return $this->data['note']; + return $this->get('note'); } public function setStockCount(int $stock_count): void @@ -40,7 +38,7 @@ public function setStockCount(int $stock_count): void public function getStockCount(): int { - return $this->data['stock_count']; + return $this->get('stock_count'); } public function setPositionId(int $position_id): void @@ -50,17 +48,17 @@ public function setPositionId(int $position_id): void public function getPositionId(): int { - return $this->data['position_id']; + return $this->get('position_id'); } public function getDocumentId(): ?int { - return $this->data['document_id']; + return $this->get('document_id'); } public function getDocumentPositionId(): ?int { - return $this->data['document_position_id']; + return $this->get('document_position_id'); } public function setStoredAt(?string $stored_at): void @@ -70,16 +68,16 @@ public function setStoredAt(?string $stored_at): void public function getStoredAt(): ?string { - return $this->data['stored_at']; + return $this->get('stored_at'); } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } public function getUpdatedAt(): string { - return $this->data['updated_at']; + return $this->get('updated_at'); } } diff --git a/src/Models/Task.php b/src/Models/Task.php index d4d7c7a..4843963 100644 --- a/src/Models/Task.php +++ b/src/Models/Task.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class Task +class Task implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setCategory(?string $category): void @@ -25,7 +23,7 @@ public function setCategory(?string $category): void public function getCategory(): ?string { - return $this->data['category']; + return $this->get('category'); } /** @@ -38,12 +36,12 @@ public function setCategoryCustom(?string $category_custom): void public function getCategoryCustom(): ?string { - return $this->data['category_custom']; + return $this->get('category_custom'); } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } public function setCustomerId(?int $customer_id): void @@ -53,7 +51,7 @@ public function setCustomerId(?int $customer_id): void public function getCustomerId(): ?int { - return $this->data['customer_id']; + return $this->get('customer_id'); } public function setDescription(?string $description): void @@ -63,7 +61,7 @@ public function setDescription(?string $description): void public function getDescription(): ?string { - return $this->data['description']; + return $this->get('description'); } public function setDocumentId(?int $document_id): void @@ -73,7 +71,7 @@ public function setDocumentId(?int $document_id): void public function getDocumentId(): ?int { - return $this->data['document_id']; + return $this->get('document_id'); } /** @@ -86,17 +84,17 @@ public function setEndAt(?string $end_at): void public function getEndAt(): ?string { - return $this->data['end_at']; + return $this->get('end_at'); } public function getFinishAt(): ?string { - return $this->data['finish_at']; + return $this->get('finish_at'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } /** @@ -109,7 +107,7 @@ public function setLoginId(?int $login_id): void public function getLoginId(): ?int { - return $this->data['login_id']; + return $this->get('login_id'); } public function setName(string $name): void @@ -119,7 +117,7 @@ public function setName(string $name): void public function getName(): string { - return $this->data['name']; + return $this->get('name'); } public function setPositionId(?int $position_id): void @@ -129,7 +127,7 @@ public function setPositionId(?int $position_id): void public function getPositionId(): ?int { - return $this->data['position_id']; + return $this->get('position_id'); } public function setPriority(string $priority): void @@ -139,7 +137,7 @@ public function setPriority(string $priority): void public function getPriority(): string { - return $this->data['priority']; + return $this->get('priority'); } public function setProjectId(?int $project_id): void @@ -149,7 +147,7 @@ public function setProjectId(?int $project_id): void public function getProjectId(): ?int { - return $this->data['project_id']; + return $this->get('project_id'); } public function setStartAt(?string $start_at): void @@ -159,7 +157,7 @@ public function setStartAt(?string $start_at): void public function getStartAt(): ?string { - return $this->data['start_at']; + return $this->get('start_at'); } public function setStatus(string $status): void @@ -169,7 +167,7 @@ public function setStatus(string $status): void public function getStatus(): string { - return $this->data['status']; + return $this->get('status'); } public function setStatusPercent(?int $status_percent): void @@ -179,6 +177,6 @@ public function setStatusPercent(?int $status_percent): void public function getStatusPercent(): ?int { - return $this->data['status_percent']; + return $this->get('status_percent'); } } diff --git a/src/Models/TextTemplate.php b/src/Models/TextTemplate.php index 2eaf587..ed6963e 100644 --- a/src/Models/TextTemplate.php +++ b/src/Models/TextTemplate.php @@ -7,25 +7,23 @@ /** * Auto-generated with `composer sdk:models`. */ -class TextTemplate +class TextTemplate implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function getCanModify(): bool { - return $this->data['can_modify']; + return $this->get('can_modify'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setText(string $text): void @@ -35,7 +33,7 @@ public function setText(string $text): void public function getText(): string { - return $this->data['text']; + return $this->get('text'); } public function setTitle(string $title): void @@ -45,6 +43,6 @@ public function setTitle(string $title): void public function getTitle(): string { - return $this->data['title']; + return $this->get('title'); } } diff --git a/src/Models/TimeTracking.php b/src/Models/TimeTracking.php index 493c789..76022ca 100644 --- a/src/Models/TimeTracking.php +++ b/src/Models/TimeTracking.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class TimeTracking +class TimeTracking implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setClearedAt(?string $cleared_at): void @@ -25,12 +23,12 @@ public function setClearedAt(?string $cleared_at): void public function getClearedAt(): ?string { - return $this->data['cleared_at']; + return $this->get('cleared_at'); } public function getCreatedAt(): string { - return $this->data['created_at']; + return $this->get('created_at'); } public function setDateFromAt(?string $date_from_at): void @@ -40,7 +38,7 @@ public function setDateFromAt(?string $date_from_at): void public function getDateFromAt(): ?string { - return $this->data['date_from_at']; + return $this->get('date_from_at'); } public function setDateThruAt(?string $date_thru_at): void @@ -50,7 +48,7 @@ public function setDateThruAt(?string $date_thru_at): void public function getDateThruAt(): ?string { - return $this->data['date_thru_at']; + return $this->get('date_thru_at'); } public function setDescription(string $description): void @@ -60,7 +58,7 @@ public function setDescription(string $description): void public function getDescription(): string { - return $this->data['description']; + return $this->get('description'); } /** @@ -73,12 +71,12 @@ public function setHourlyRate(float $hourly_rate): void public function getHourlyRate(): float { - return $this->data['hourly_rate']; + return $this->get('hourly_rate'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setNote(?string $note): void @@ -88,7 +86,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->data['note']; + return $this->get('note'); } /** @@ -101,7 +99,7 @@ public function setNumber(?string $number): void public function getNumber(): ?string { - return $this->data['number']; + return $this->get('number'); } public function setPositionId(?int $position_id): void @@ -111,7 +109,7 @@ public function setPositionId(?int $position_id): void public function getPositionId(): ?int { - return $this->data['position_id']; + return $this->get('position_id'); } public function setProjectId(?int $project_id): void @@ -121,7 +119,7 @@ public function setProjectId(?int $project_id): void public function getProjectId(): ?int { - return $this->data['project_id']; + return $this->get('project_id'); } /** @@ -134,7 +132,7 @@ public function setLoginId(?int $login_id): void public function getLoginId(): ?int { - return $this->data['login_id']; + return $this->get('login_id'); } /** @@ -147,6 +145,6 @@ public function setTimerValue(?int $timer_value): void public function getTimerValue(): ?int { - return $this->data['timer_value']; + return $this->get('timer_value'); } } diff --git a/src/Models/ToArrayInterface.php b/src/Models/ToArrayInterface.php new file mode 100644 index 0000000..7d65d13 --- /dev/null +++ b/src/Models/ToArrayInterface.php @@ -0,0 +1,8 @@ +data)) { + throw new \RuntimeException(sprintf('Key "%s" not exists in $data', $key)); + } + return $this->data[$key]; + } + + protected function getInstance(string $key, string $className): mixed + { + $data = $this->get($key); + if ($data instanceof $className) { + return $data; + } + return $this->data[$key] = new $className($data); + } + + public function toArray(): array + { + return array_map(static function (mixed $val): mixed { + if ($val instanceof ToArrayInterface) { + return $val->toArray(); + } + return $val; + }, $this->data); + } +} diff --git a/src/Models/WebHook.php b/src/Models/WebHook.php index 71a782e..9b8bb6f 100644 --- a/src/Models/WebHook.php +++ b/src/Models/WebHook.php @@ -7,15 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class WebHook +class WebHook implements ToArrayInterface { - public function __construct(protected $data = []) - { - } + use Traits\Data; - public function getData(): array + public function __construct(array $data = []) { - return $this->data; + $this->data = $data; } public function setContentType(string $content_type): void @@ -25,7 +23,7 @@ public function setContentType(string $content_type): void public function getContentType(): string { - return $this->data['content_type']; + return $this->get('content_type'); } public function setDescription(string $description): void @@ -35,7 +33,7 @@ public function setDescription(string $description): void public function getDescription(): string { - return $this->data['description']; + return $this->get('description'); } public function setEvents(array $events): void @@ -48,12 +46,12 @@ public function setEvents(array $events): void */ public function getEvents(): array { - return $this->data['events']; + return $this->get('events'); } public function getId(): int { - return $this->data['id']; + return $this->get('id'); } public function setIsActive(bool $is_active): void @@ -63,12 +61,12 @@ public function setIsActive(bool $is_active): void public function getIsActive(): bool { - return $this->data['is_active']; + return $this->get('is_active'); } - public function getLastResponse(): \stdClass + public function getLastResponse(): WebHookLastResponse { - return $this->data['last_response']; + return $this->getInstance('last_response', \easybill\SDK\Models\WebHookLastResponse::class); } public function setSecret(string $secret): void @@ -78,7 +76,7 @@ public function setSecret(string $secret): void public function getSecret(): string { - return $this->data['secret']; + return $this->get('secret'); } public function setUrl(string $url): void @@ -88,6 +86,6 @@ public function setUrl(string $url): void public function getUrl(): string { - return $this->data['url']; + return $this->get('url'); } } diff --git a/src/Models/WebHookLastResponse.php b/src/Models/WebHookLastResponse.php new file mode 100644 index 0000000..d7c3295 --- /dev/null +++ b/src/Models/WebHookLastResponse.php @@ -0,0 +1,33 @@ +data = $data; + } + + public function getDate(): string + { + return $this->get('date'); + } + + public function getCode(): int + { + return $this->get('code'); + } + + public function getResponse(): string + { + return $this->get('response'); + } +} diff --git a/tests/Models/CustomerTest.php b/tests/Models/CustomerTest.php new file mode 100644 index 0000000..834d588 --- /dev/null +++ b/tests/Models/CustomerTest.php @@ -0,0 +1,16 @@ +setNumber('31337'); + static::assertSame(['number' => '31337'], $customer->toArray()); + } +} diff --git a/tests/Models/PositionTest.php b/tests/Models/PositionTest.php new file mode 100644 index 0000000..085a89a --- /dev/null +++ b/tests/Models/PositionTest.php @@ -0,0 +1,19 @@ +setNumber('31337'); + $position->setExportIdentifierExtended(new PositionExportIdentifierExtended()); + $position->getExportIdentifierExtended()->setSmallBusiness('010203040506070809'); + static::assertSame(['number' => '31337', 'export_identifier_extended' => ['smallBusiness' => '010203040506070809']], $position->toArray()); + } +} From 764806406142e215005a368fcebe2d7e9937512f Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 14:30:23 +0100 Subject: [PATCH 13/37] change cs fixer settings and drop extends in models --- .php-cs-fixer.dist.php | 25 +- generators/models.php | 56 ++-- src/HttpClient/BaseHttpClient.php | 3 +- src/HttpClient/GuzzleHttpClient.php | 2 +- src/Models/CustomerSnapshot.php | 392 ++++++++++++++++++++++++++- src/Models/Discount.php | 59 ---- src/Models/DiscountPosition.php | 47 +++- src/Models/DiscountPositionGroup.php | 47 +++- src/Models/Traits/Data.php | 23 +- tests/Models/CustomerTest.php | 4 + tests/Models/PositionTest.php | 4 + 11 files changed, 535 insertions(+), 127 deletions(-) delete mode 100644 src/Models/Discount.php diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 1254d55..4bbc007 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -7,31 +7,8 @@ '@Symfony' => true, '@PhpCsFixer' => true, '@DoctrineAnnotation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'cast_spaces' => ['space' => 'none'], 'concat_space' => ['spacing' => 'one'], - 'yoda_style' => false, - 'ordered_class_elements' => false, - 'ordered_imports' => false, - //'method_argument_space' => null, - //'no_whitespace_in_blank_line' => null, - //'no_extra_blank_lines' => null, - //'braces' => null, - 'blank_line_before_statement' => false, - 'phpdoc_align' => ['align' => 'left'], - 'phpdoc_var_without_name' => false, - 'phpdoc_types_order' => false, - 'phpdoc_order' => false, - 'phpdoc_separation' => false, - 'phpdoc_no_empty_return' => false, - 'phpdoc_add_missing_param_annotation' => false, - //'no_superfluous_elseif' => null, - 'class_definition' => false, - 'ternary_to_null_coalescing' => true, - 'php_unit_test_class_requires_covers' => false, - 'php_unit_internal_class' => false, - 'phpdoc_to_comment' => false, - 'single_line_comment_style' => false, + ]) ->setFinder( PhpCsFixer\Finder::create() diff --git a/generators/models.php b/generators/models.php index 3281d8e..2bb0a24 100644 --- a/generators/models.php +++ b/generators/models.php @@ -2,6 +2,9 @@ declare(strict_types=1); +use easybill\SDK\Models\ToArrayInterface; +use easybill\SDK\Models\Traits\Data; + require_once __DIR__ . '/../vendor/autoload.php'; $swagger = json_decode(file_get_contents(__DIR__ . '/swagger.json'), true); @@ -10,12 +13,14 @@ function classNameFromRef(string $ref): string { $explodedRef = explode('/', $ref); $className = end($explodedRef); - return $className === 'List' ? 'ResultList' : $className; + + return 'List' === $className ? 'ResultList' : $className; } function classWithNamespace(string $className): string { $namespace = str_contains($className, 'ResultList') ? 'easybill\SDK\ResultLists\\' : 'easybill\SDK\Models\\'; + return $namespace . $className; } @@ -33,51 +38,50 @@ function typeMap(string $type): string } foreach ($swagger['definitions'] as $className => $classInfo) { - $className = $className === 'List' ? 'ResultList' : $className; + $className = 'List' === $className ? 'ResultList' : $className; + + if ( + 'ResultList' === $className + || 'PDFTemplates' === $className + || 'Discount' === $className + || ($classInfo['allOf'][0]['$ref'] ?? '') === '#/definitions/List' + ) { + // dont support this in first step; + continue; + } + $classInfo['properties'] = $classInfo['properties'] ?? []; $classInfo['allOf'] = $classInfo['allOf'] ?? []; $classInfo['description'] = trim($classInfo['description'] ?? ''); - $classExtends = []; + $classInfo['readOnly'] = $classInfo['readOnly'] ?? false; foreach ($classInfo['allOf'] as $of) { if (array_key_exists('$ref', $of)) { - $classExtends[] = classWithNamespace(classNameFromRef($of['$ref'])); + $classInfo['properties'] = array_merge($classInfo['properties'], $swagger['definitions'][classNameFromRef($of['$ref'])]['properties'] ?? []); + continue; } if (array_key_exists('properties', $of)) { $classInfo['properties'] = array_merge($classInfo['properties'], $of['properties']); + continue; } } - if ( - str_contains($className, 'ResultList') - || in_array(classWithNamespace('ResultList'), $classExtends, true) - || $className === 'PDFTemplates' - ) { - // dont support this in first step; - continue; - } - $file = new Nette\PhpGenerator\PhpFile(); $file->setStrictTypes(); $class = $file->addClass(classWithNamespace($className)); $class->addComment('Auto-generated with `composer sdk:models`'); - $class->setExtends($classExtends); - if ($classInfo['description'] !== '') { + if ('' !== $classInfo['description']) { $class->addComment($classInfo['description']); } $construct = $class->addMethod('__construct'); $construct->addParameter('data', [])->setType('array'); - if ($classExtends) { - $construct->setBody('parent::__construct($data);'); - } else { - $class->addImplement(\easybill\SDK\Models\ToArrayInterface::class); - $class->addTrait(\easybill\SDK\Models\Traits\Data::class); - $construct->setBody('$this->data = $data;'); - } + $class->addImplement(ToArrayInterface::class); + $class->addTrait(Data::class); + $construct->setBody('$this->data = $data;'); $errors = []; @@ -101,9 +105,9 @@ function typeMap(string $type): string $methodeName = str_replace('_', '', ucwords($propertyName, '_')); - if ($propertyInfo['readOnly'] === false) { + if (false === $classInfo['readOnly'] && false === $propertyInfo['readOnly']) { $setter = $class->addMethod('set' . $methodeName); - if ($propertyInfo['description'] !== '') { + if ('' !== $propertyInfo['description']) { $setter->addComment($propertyInfo['description']); } $setter->setReturnType('void'); @@ -121,10 +125,10 @@ function typeMap(string $type): string if ($propertyInfo['x-nullable']) { $getter->setReturnNullable(); } - if ($type === 'array' && array_key_exists('type', $propertyInfo['items'])) { + if ('array' === $type && array_key_exists('type', $propertyInfo['items'])) { $getter->addComment('@return ' . typeMap($propertyInfo['items']['type']) . '[]'); } - if ($type === 'array' && array_key_exists('$ref', $propertyInfo['items'])) { + if ('array' === $type && array_key_exists('$ref', $propertyInfo['items'])) { $getter->addComment('@return \\' . classWithNamespace(classNameFromRef($propertyInfo['items']['$ref'])) . '[]'); } if ($isObject) { diff --git a/src/HttpClient/BaseHttpClient.php b/src/HttpClient/BaseHttpClient.php index 7f6c1d4..def419b 100644 --- a/src/HttpClient/BaseHttpClient.php +++ b/src/HttpClient/BaseHttpClient.php @@ -35,9 +35,10 @@ public function send(RequestInterface $request, array $options = []): ResponseIn return $res; } catch (ClientException $clientException) { - if ($clientException->getResponse()->getStatusCode() === 429) { + if (429 === $clientException->getResponse()->getStatusCode()) { // Too Many Requests, wait and try again. sleep(30); + return $this->send($request, $options); } diff --git a/src/HttpClient/GuzzleHttpClient.php b/src/HttpClient/GuzzleHttpClient.php index 0042148..61b59d8 100644 --- a/src/HttpClient/GuzzleHttpClient.php +++ b/src/HttpClient/GuzzleHttpClient.php @@ -3,9 +3,9 @@ namespace easybill\SDK\HttpClient; use easybill\SDK\HttpClientInterface; +use GuzzleHttp\Client; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use GuzzleHttp\Client; class GuzzleHttpClient implements HttpClientInterface { diff --git a/src/Models/CustomerSnapshot.php b/src/Models/CustomerSnapshot.php index 76ae6bf..718859c 100644 --- a/src/Models/CustomerSnapshot.php +++ b/src/Models/CustomerSnapshot.php @@ -8,10 +8,398 @@ * Auto-generated with `composer sdk:models` * A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state. */ -class CustomerSnapshot extends Customer +class CustomerSnapshot implements ToArrayInterface { + use Traits\Data; + public function __construct(array $data = []) { - parent::__construct($data); + $this->data = $data; + } + + public function getAcquireOptions(): ?int + { + return $this->get('acquire_options'); + } + + /** + * @return int[] + */ + public function getAdditionalGroupsIds(): array + { + return $this->get('additional_groups_ids'); + } + + public function getBankAccount(): ?string + { + return $this->get('bank_account'); + } + + public function getBankAccountOwner(): ?string + { + return $this->get('bank_account_owner'); + } + + public function getBankBic(): ?string + { + return $this->get('bank_bic'); + } + + public function getBankCode(): ?string + { + return $this->get('bank_code'); + } + + public function getBankIban(): ?string + { + return $this->get('bank_iban'); + } + + public function getBankName(): ?string + { + return $this->get('bank_name'); + } + + public function getBirthDate(): ?string + { + return $this->get('birth_date'); + } + + public function getCashAllowance(): ?float + { + return $this->get('cash_allowance'); + } + + public function getCashAllowanceDays(): int + { + return $this->get('cash_allowance_days'); + } + + public function getCashDiscount(): ?float + { + return $this->get('cash_discount'); + } + + public function getCashDiscountType(): ?string + { + return $this->get('cash_discount_type'); + } + + public function getCity(): ?string + { + return $this->get('city'); + } + + public function getState(): string + { + return $this->get('state'); + } + + public function getCompanyName(): ?string + { + return $this->get('company_name'); + } + + public function getCountry(): string + { + return $this->get('country'); + } + + public function getCreatedAt(): string + { + return $this->get('created_at'); + } + + public function getUpdatedAt(): string + { + return $this->get('updated_at'); + } + + public function getDeliveryTitle(): string + { + return $this->get('delivery_title'); + } + + public function getDeliveryCity(): ?string + { + return $this->get('delivery_city'); + } + + public function getDeliveryState(): string + { + return $this->get('delivery_state'); + } + + public function getDeliveryCompanyName(): ?string + { + return $this->get('delivery_company_name'); + } + + public function getDeliveryCountry(): ?string + { + return $this->get('delivery_country'); + } + + public function getDeliveryFirstName(): ?string + { + return $this->get('delivery_first_name'); + } + + public function getDeliveryLastName(): ?string + { + return $this->get('delivery_last_name'); + } + + public function getDeliveryPersonal(): bool + { + return $this->get('delivery_personal'); + } + + public function getDeliverySalutation(): int + { + return $this->get('delivery_salutation'); + } + + public function getDeliveryStreet(): ?string + { + return $this->get('delivery_street'); + } + + public function getDeliverySuffix1(): ?string + { + return $this->get('delivery_suffix_1'); + } + + public function getDeliverySuffix2(): ?string + { + return $this->get('delivery_suffix_2'); + } + + public function getDeliveryZipCode(): ?string + { + return $this->get('delivery_zip_code'); + } + + public function getDisplayName(): string + { + return $this->get('display_name'); + } + + /** + * @return string[] + */ + public function getEmails(): array + { + return $this->get('emails'); + } + + public function getFax(): ?string + { + return $this->get('fax'); + } + + public function getFirstName(): ?string + { + return $this->get('first_name'); + } + + public function getGracePeriod(): ?int + { + return $this->get('grace_period'); + } + + public function getDueInDays(): ?int + { + return $this->get('due_in_days'); + } + + public function getGroupId(): ?int + { + return $this->get('group_id'); + } + + public function getId(): int + { + return $this->get('id'); + } + + public function getInfo1(): ?string + { + return $this->get('info_1'); + } + + public function getInfo2(): ?string + { + return $this->get('info_2'); + } + + public function getInternet(): ?string + { + return $this->get('internet'); + } + + public function getLastName(): ?string + { + return $this->get('last_name'); + } + + public function getLoginId(): int + { + return $this->get('login_id'); + } + + public function getMobile(): ?string + { + return $this->get('mobile'); + } + + public function getNote(): ?string + { + return $this->get('note'); + } + + public function getNumber(): string + { + return $this->get('number'); + } + + public function getPaymentOptions(): ?int + { + return $this->get('payment_options'); + } + + public function getPersonal(): bool + { + return $this->get('personal'); + } + + public function getPhone1(): ?string + { + return $this->get('phone_1'); + } + + public function getPhone2(): ?string + { + return $this->get('phone_2'); + } + + public function getPostbox(): ?string + { + return $this->get('postbox'); + } + + public function getPostboxCity(): ?string + { + return $this->get('postbox_city'); + } + + public function getPostboxState(): string + { + return $this->get('postbox_state'); + } + + public function getPostboxCountry(): ?string + { + return $this->get('postbox_country'); + } + + public function getPostboxZipCode(): ?string + { + return $this->get('postbox_zip_code'); + } + + public function getSalePriceLevel(): ?string + { + return $this->get('sale_price_level'); + } + + public function getSalutation(): int + { + return $this->get('salutation'); + } + + public function getSepaAgreement(): ?string + { + return $this->get('sepa_agreement'); + } + + public function getSepaAgreementDate(): ?string + { + return $this->get('sepa_agreement_date'); + } + + public function getSepaMandateReference(): ?string + { + return $this->get('sepa_mandate_reference'); + } + + public function getSinceDate(): ?string + { + return $this->get('since_date'); + } + + public function getStreet(): ?string + { + return $this->get('street'); + } + + public function getSuffix1(): ?string + { + return $this->get('suffix_1'); + } + + public function getSuffix2(): ?string + { + return $this->get('suffix_2'); + } + + public function getTaxNumber(): ?string + { + return $this->get('tax_number'); + } + + public function getCourt(): ?string + { + return $this->get('court'); + } + + public function getCourtRegistryNumber(): ?string + { + return $this->get('court_registry_number'); + } + + public function getTaxOptions(): ?string + { + return $this->get('tax_options'); + } + + public function getTitle(): ?string + { + return $this->get('title'); + } + + public function getVatIdentifier(): ?string + { + return $this->get('vat_identifier'); + } + + public function getZipCode(): ?string + { + return $this->get('zip_code'); + } + + public function getDocumentPdfType(): string + { + return $this->get('documentPdfType'); + } + + public function getBuyerReference(): string + { + return $this->get('buyer_reference'); + } + + public function getForeignSupplierNumber(): string + { + return $this->get('foreign_supplier_number'); } } diff --git a/src/Models/Discount.php b/src/Models/Discount.php deleted file mode 100644 index 3324b10..0000000 --- a/src/Models/Discount.php +++ /dev/null @@ -1,59 +0,0 @@ -data = $data; - } - - public function getId(): int - { - return $this->get('id'); - } - - public function setCustomerId(int $customer_id): void - { - $this->data['customer_id'] = $customer_id; - } - - public function getCustomerId(): int - { - return $this->get('customer_id'); - } - - /** - * The discount value depending on "discount_type". - */ - public function setDiscount(int $discount): void - { - $this->data['discount'] = $discount; - } - - public function getDiscount(): int - { - return $this->get('discount'); - } - - /** - * AMOUNT subtracts the value in "discount" from the total
QUANTITY subtracts the value in "discount" multiplied by quantity
PERCENT uses the value in "discount" as a percentage
FIX sets the value in "discount" as the new price. - */ - public function setDiscountType(string $discount_type): void - { - $this->data['discount_type'] = $discount_type; - } - - public function getDiscountType(): string - { - return $this->get('discount_type'); - } -} diff --git a/src/Models/DiscountPosition.php b/src/Models/DiscountPosition.php index 81d0952..dd7acb5 100644 --- a/src/Models/DiscountPosition.php +++ b/src/Models/DiscountPosition.php @@ -7,11 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class DiscountPosition extends Discount +class DiscountPosition implements ToArrayInterface { + use Traits\Data; + public function __construct(array $data = []) { - parent::__construct($data); + $this->data = $data; } public function setPositionId(int $position_id): void @@ -23,4 +25,45 @@ public function getPositionId(): int { return $this->get('position_id'); } + + public function getId(): int + { + return $this->get('id'); + } + + public function setCustomerId(int $customer_id): void + { + $this->data['customer_id'] = $customer_id; + } + + public function getCustomerId(): int + { + return $this->get('customer_id'); + } + + /** + * The discount value depending on "discount_type". + */ + public function setDiscount(int $discount): void + { + $this->data['discount'] = $discount; + } + + public function getDiscount(): int + { + return $this->get('discount'); + } + + /** + * AMOUNT subtracts the value in "discount" from the total
QUANTITY subtracts the value in "discount" multiplied by quantity
PERCENT uses the value in "discount" as a percentage
FIX sets the value in "discount" as the new price. + */ + public function setDiscountType(string $discount_type): void + { + $this->data['discount_type'] = $discount_type; + } + + public function getDiscountType(): string + { + return $this->get('discount_type'); + } } diff --git a/src/Models/DiscountPositionGroup.php b/src/Models/DiscountPositionGroup.php index 72d113c..3801b6a 100644 --- a/src/Models/DiscountPositionGroup.php +++ b/src/Models/DiscountPositionGroup.php @@ -7,11 +7,13 @@ /** * Auto-generated with `composer sdk:models`. */ -class DiscountPositionGroup extends Discount +class DiscountPositionGroup implements ToArrayInterface { + use Traits\Data; + public function __construct(array $data = []) { - parent::__construct($data); + $this->data = $data; } public function setPositionGroupId(int $position_group_id): void @@ -23,4 +25,45 @@ public function getPositionGroupId(): int { return $this->get('position_group_id'); } + + public function getId(): int + { + return $this->get('id'); + } + + public function setCustomerId(int $customer_id): void + { + $this->data['customer_id'] = $customer_id; + } + + public function getCustomerId(): int + { + return $this->get('customer_id'); + } + + /** + * The discount value depending on "discount_type". + */ + public function setDiscount(int $discount): void + { + $this->data['discount'] = $discount; + } + + public function getDiscount(): int + { + return $this->get('discount'); + } + + /** + * AMOUNT subtracts the value in "discount" from the total
QUANTITY subtracts the value in "discount" multiplied by quantity
PERCENT uses the value in "discount" as a percentage
FIX sets the value in "discount" as the new price. + */ + public function setDiscountType(string $discount_type): void + { + $this->data['discount_type'] = $discount_type; + } + + public function getDiscountType(): string + { + return $this->get('discount_type'); + } } diff --git a/src/Models/Traits/Data.php b/src/Models/Traits/Data.php index 0af7460..5ff513a 100644 --- a/src/Models/Traits/Data.php +++ b/src/Models/Traits/Data.php @@ -8,11 +8,23 @@ trait Data { protected array $data = []; + public function toArray(): array + { + return array_map(static function (mixed $val): mixed { + if ($val instanceof ToArrayInterface) { + return $val->toArray(); + } + + return $val; + }, $this->data); + } + protected function get(string $key): mixed { if (!array_key_exists($key, $this->data)) { throw new \RuntimeException(sprintf('Key "%s" not exists in $data', $key)); } + return $this->data[$key]; } @@ -22,16 +34,7 @@ protected function getInstance(string $key, string $className): mixed if ($data instanceof $className) { return $data; } - return $this->data[$key] = new $className($data); - } - public function toArray(): array - { - return array_map(static function (mixed $val): mixed { - if ($val instanceof ToArrayInterface) { - return $val->toArray(); - } - return $val; - }, $this->data); + return $this->data[$key] = new $className($data); } } diff --git a/tests/Models/CustomerTest.php b/tests/Models/CustomerTest.php index 834d588..dd49690 100644 --- a/tests/Models/CustomerTest.php +++ b/tests/Models/CustomerTest.php @@ -5,6 +5,10 @@ use easybill\SDK\Models\Customer; use PHPUnit\Framework\TestCase; +/** + * @internal + * @coversNothing + */ class CustomerTest extends TestCase { public function testToArray(): void diff --git a/tests/Models/PositionTest.php b/tests/Models/PositionTest.php index 085a89a..5063d12 100644 --- a/tests/Models/PositionTest.php +++ b/tests/Models/PositionTest.php @@ -6,6 +6,10 @@ use easybill\SDK\Models\PositionExportIdentifierExtended; use PHPUnit\Framework\TestCase; +/** + * @internal + * @coversNothing + */ class PositionTest extends TestCase { public function testToArray(): void From b0e2595883363ea9cd8547f3808d0be5f4f45215 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 14:34:26 +0100 Subject: [PATCH 14/37] Add github actions --- .github/workflows/php-cs-fixer.yaml | 35 +++++++++++++++++++++++++++ .github/workflows/phpunit.yaml | 37 +++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/php-cs-fixer.yaml create mode 100644 .github/workflows/phpunit.yaml diff --git a/.github/workflows/php-cs-fixer.yaml b/.github/workflows/php-cs-fixer.yaml new file mode 100644 index 0000000..2ef2aae --- /dev/null +++ b/.github/workflows/php-cs-fixer.yaml @@ -0,0 +1,35 @@ +name: php-cs-fixer + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - { operating-system: 'ubuntu-latest', php-version: '7.4', dependencies: '--ignore-platform-req=php' } + + name: PHP ${{ matrix.php-version }} + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: pcov + tools: composer:v2 + + - name: Install dependencies + run: | + composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }} + - name: Check code style + run: | + php vendor/bin/php-cs-fixer --using-cache=no --diff --dry-run --stop-on-violation --verbose fix \ No newline at end of file diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml new file mode 100644 index 0000000..3397262 --- /dev/null +++ b/.github/workflows/phpunit.yaml @@ -0,0 +1,37 @@ +name: PHPUnit + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - { operating-system: 'ubuntu-latest', php-version: '7.4', dependencies: '--ignore-platform-req=php' } + - { operating-system: 'ubuntu-latest', php-version: '8.0', dependencies: '--ignore-platform-req=php' } + - { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '--ignore-platform-req=php' } + + name: PHP ${{ matrix.php-version }} + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: pcov + tools: composer:v2 + + - name: Install dependencies + run: | + composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }} + - name: Run tests + run: | + php vendor/bin/phpunit \ No newline at end of file From cf635420290abf2ac836fe6e54334196a43b7ec0 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 14:34:38 +0100 Subject: [PATCH 15/37] update composer description --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bfa8393..a9eb320 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "easybill/php-sdk", - "description": "easybill PHP SDK (API)", + "description": "easybill PHP SDK (REST API)", "keywords": [ "PHP", "easybill", From 06553ead78c1e61fccd76d783494bde73d81f396 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 14:36:14 +0100 Subject: [PATCH 16/37] fix github workflow --- .github/workflows/phpunit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 3397262..c91078a 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -34,4 +34,4 @@ jobs: composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }} - name: Run tests run: | - php vendor/bin/phpunit \ No newline at end of file + php vendor/bin/phpunit tests \ No newline at end of file From 33a43da5db09d2a249adf8ee643f314bc5a33892 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 14:36:35 +0100 Subject: [PATCH 17/37] fix github workflow --- .github/workflows/php-cs-fixer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-cs-fixer.yaml b/.github/workflows/php-cs-fixer.yaml index 2ef2aae..a5dffa6 100644 --- a/.github/workflows/php-cs-fixer.yaml +++ b/.github/workflows/php-cs-fixer.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: include: - - { operating-system: 'ubuntu-latest', php-version: '7.4', dependencies: '--ignore-platform-req=php' } + - { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '--ignore-platform-req=php' } name: PHP ${{ matrix.php-version }} From c7b8c1f92b39a5686b5e0ae93bed15e11dabda38 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 14:37:41 +0100 Subject: [PATCH 18/37] drop php7.4 from github workflow --- .github/workflows/phpunit.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index c91078a..09bd967 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -13,7 +13,6 @@ jobs: strategy: matrix: include: - - { operating-system: 'ubuntu-latest', php-version: '7.4', dependencies: '--ignore-platform-req=php' } - { operating-system: 'ubuntu-latest', php-version: '8.0', dependencies: '--ignore-platform-req=php' } - { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '--ignore-platform-req=php' } From f285c58401e5efc359e348b7570bbc777a5f1479 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 15:40:56 +0100 Subject: [PATCH 19/37] support DateTime --- generators/models.php | 14 +- src/Models/Attachment.php | 16 +- src/Models/Contact.php | 48 ++--- src/Models/Customer.php | 166 +++++++++--------- src/Models/CustomerGroup.php | 10 +- src/Models/CustomerSnapshot.php | 160 ++++++++--------- src/Models/DiscountPosition.php | 10 +- src/Models/DiscountPositionGroup.php | 10 +- src/Models/Document.php | 140 +++++++-------- src/Models/DocumentAddress.php | 26 +-- src/Models/DocumentPayment.php | 24 +-- src/Models/DocumentPosition.php | 56 +++--- src/Models/DocumentRecurring.php | 40 ++--- src/Models/Login.php | 22 +-- src/Models/LoginSecurity.php | 6 +- src/Models/PDFTemplate.php | 8 +- src/Models/Position.php | 64 +++---- .../PositionExportIdentifierExtended.php | 20 +-- src/Models/PositionGroup.php | 12 +- src/Models/PostBox.php | 50 +++--- src/Models/PostBoxRequest.php | 20 +-- src/Models/Project.php | 30 ++-- src/Models/SEPAPayment.php | 62 +++---- src/Models/SerialNumber.php | 14 +- src/Models/ServiceDate.php | 22 +-- src/Models/Stock.php | 18 +- src/Models/Task.php | 46 ++--- src/Models/TextTemplate.php | 8 +- src/Models/TimeTracking.php | 40 ++--- src/Models/Traits/Data.php | 39 +++- src/Models/WebHook.php | 16 +- src/Models/WebHookLastResponse.php | 8 +- tests/Models/CustomerTest.php | 19 +- 33 files changed, 651 insertions(+), 593 deletions(-) diff --git a/generators/models.php b/generators/models.php index 2bb0a24..bbf8160 100644 --- a/generators/models.php +++ b/generators/models.php @@ -91,6 +91,7 @@ function typeMap(string $type): string $propertyInfo['type'] = trim($propertyInfo['type'] ?? ''); $propertyInfo['x-nullable'] = $propertyInfo['x-nullable'] ?? false; $propertyInfo['items'] = $propertyInfo['items'] ?? []; + $propertyInfo['format'] = $propertyInfo['format'] ?? ''; echo '==> ' . $className . '::' . $propertyName . "\n"; @@ -103,6 +104,13 @@ function typeMap(string $type): string $isObject = true; } + if ( + 'date' === $propertyInfo['format'] + || 'date-time' === $propertyInfo['format'] + ) { + $type = DateTimeImmutable::class; + } + $methodeName = str_replace('_', '', ucwords($propertyName, '_')); if (false === $classInfo['readOnly'] && false === $propertyInfo['readOnly']) { @@ -132,9 +140,11 @@ function typeMap(string $type): string $getter->addComment('@return \\' . classWithNamespace(classNameFromRef($propertyInfo['items']['$ref'])) . '[]'); } if ($isObject) { - $getter->setBody('return $this->getInstance(\'' . $propertyName . '\', \\' . $type . '::class);'); + $getter->setBody('return $this->attrInstance(\'' . $propertyName . '\', \\' . $type . '::class);'); + } elseif ('date' === $propertyInfo['format']) { + $getter->setBody('return $this->attrDate(\'' . $propertyName . '\');'); } else { - $getter->setBody('return $this->get(\'' . $propertyName . '\');'); + $getter->setBody('return $this->attr(\'' . $propertyName . '\');'); } } diff --git a/src/Models/Attachment.php b/src/Models/Attachment.php index 28d78a3..a1a3314 100644 --- a/src/Models/Attachment.php +++ b/src/Models/Attachment.php @@ -17,9 +17,9 @@ public function __construct(array $data = []) $this->data = $data; } - public function getCreatedAt(): string + public function getCreatedAt(): \DateTimeImmutable { - return $this->get('created_at'); + return $this->attrDate('created_at'); } public function setCustomerId(?int $customer_id): void @@ -29,7 +29,7 @@ public function setCustomerId(?int $customer_id): void public function getCustomerId(): ?int { - return $this->get('customer_id'); + return $this->attr('customer_id'); } public function setDocumentId(?int $document_id): void @@ -39,17 +39,17 @@ public function setDocumentId(?int $document_id): void public function getDocumentId(): ?int { - return $this->get('document_id'); + return $this->attr('document_id'); } public function getFileName(): string { - return $this->get('file_name'); + return $this->attr('file_name'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setProjectId(?int $project_id): void @@ -59,11 +59,11 @@ public function setProjectId(?int $project_id): void public function getProjectId(): ?int { - return $this->get('project_id'); + return $this->attr('project_id'); } public function getSize(): int { - return $this->get('size'); + return $this->attr('size'); } } diff --git a/src/Models/Contact.php b/src/Models/Contact.php index e4b6623..c042449 100644 --- a/src/Models/Contact.php +++ b/src/Models/Contact.php @@ -23,7 +23,7 @@ public function setCity(string $city): void public function getCity(): string { - return $this->get('city'); + return $this->attr('city'); } public function setState(string $state): void @@ -33,7 +33,7 @@ public function setState(string $state): void public function getState(): string { - return $this->get('state'); + return $this->attr('state'); } public function setCompanyName(?string $company_name): void @@ -43,7 +43,7 @@ public function setCompanyName(?string $company_name): void public function getCompanyName(): ?string { - return $this->get('company_name'); + return $this->attr('company_name'); } /** @@ -56,7 +56,7 @@ public function setCountry(string $country): void public function getCountry(): string { - return $this->get('country'); + return $this->attr('country'); } public function setDepartment(?string $department): void @@ -66,7 +66,7 @@ public function setDepartment(?string $department): void public function getDepartment(): ?string { - return $this->get('department'); + return $this->attr('department'); } public function setEmails(array $emails): void @@ -79,7 +79,7 @@ public function setEmails(array $emails): void */ public function getEmails(): array { - return $this->get('emails'); + return $this->attr('emails'); } public function setFax(?string $fax): void @@ -89,7 +89,7 @@ public function setFax(?string $fax): void public function getFax(): ?string { - return $this->get('fax'); + return $this->attr('fax'); } public function setFirstName(?string $first_name): void @@ -99,12 +99,12 @@ public function setFirstName(?string $first_name): void public function getFirstName(): ?string { - return $this->get('first_name'); + return $this->attr('first_name'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setLastName(?string $last_name): void @@ -114,12 +114,12 @@ public function setLastName(?string $last_name): void public function getLastName(): ?string { - return $this->get('last_name'); + return $this->attr('last_name'); } public function getLoginId(): int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setMobile(?string $mobile): void @@ -129,7 +129,7 @@ public function setMobile(?string $mobile): void public function getMobile(): ?string { - return $this->get('mobile'); + return $this->attr('mobile'); } public function setNote(?string $note): void @@ -139,7 +139,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->get('note'); + return $this->attr('note'); } public function setPersonal(bool $personal): void @@ -149,7 +149,7 @@ public function setPersonal(bool $personal): void public function getPersonal(): bool { - return $this->get('personal'); + return $this->attr('personal'); } public function setPhone1(?string $phone_1): void @@ -159,7 +159,7 @@ public function setPhone1(?string $phone_1): void public function getPhone1(): ?string { - return $this->get('phone_1'); + return $this->attr('phone_1'); } public function setPhone2(?string $phone_2): void @@ -169,7 +169,7 @@ public function setPhone2(?string $phone_2): void public function getPhone2(): ?string { - return $this->get('phone_2'); + return $this->attr('phone_2'); } /** @@ -182,7 +182,7 @@ public function setSalutation(int $salutation): void public function getSalutation(): int { - return $this->get('salutation'); + return $this->attr('salutation'); } public function setStreet(string $street): void @@ -192,7 +192,7 @@ public function setStreet(string $street): void public function getStreet(): string { - return $this->get('street'); + return $this->attr('street'); } public function setSuffix1(?string $suffix_1): void @@ -202,7 +202,7 @@ public function setSuffix1(?string $suffix_1): void public function getSuffix1(): ?string { - return $this->get('suffix_1'); + return $this->attr('suffix_1'); } public function setSuffix2(?string $suffix_2): void @@ -212,7 +212,7 @@ public function setSuffix2(?string $suffix_2): void public function getSuffix2(): ?string { - return $this->get('suffix_2'); + return $this->attr('suffix_2'); } public function setTitle(?string $title): void @@ -222,7 +222,7 @@ public function setTitle(?string $title): void public function getTitle(): ?string { - return $this->get('title'); + return $this->attr('title'); } public function setZipCode(?string $zip_code): void @@ -232,16 +232,16 @@ public function setZipCode(?string $zip_code): void public function getZipCode(): ?string { - return $this->get('zip_code'); + return $this->attr('zip_code'); } public function getCreatedAt(): string { - return $this->get('created_at'); + return $this->attr('created_at'); } public function getUpdatedAt(): string { - return $this->get('updated_at'); + return $this->attr('updated_at'); } } diff --git a/src/Models/Customer.php b/src/Models/Customer.php index 8ee305c..17d831c 100644 --- a/src/Models/Customer.php +++ b/src/Models/Customer.php @@ -26,7 +26,7 @@ public function setAcquireOptions(?int $acquire_options): void public function getAcquireOptions(): ?int { - return $this->get('acquire_options'); + return $this->attr('acquire_options'); } /** @@ -34,7 +34,7 @@ public function getAcquireOptions(): ?int */ public function getAdditionalGroupsIds(): array { - return $this->get('additional_groups_ids'); + return $this->attr('additional_groups_ids'); } public function setBankAccount(?string $bank_account): void @@ -44,7 +44,7 @@ public function setBankAccount(?string $bank_account): void public function getBankAccount(): ?string { - return $this->get('bank_account'); + return $this->attr('bank_account'); } public function setBankAccountOwner(?string $bank_account_owner): void @@ -54,7 +54,7 @@ public function setBankAccountOwner(?string $bank_account_owner): void public function getBankAccountOwner(): ?string { - return $this->get('bank_account_owner'); + return $this->attr('bank_account_owner'); } public function setBankBic(?string $bank_bic): void @@ -64,7 +64,7 @@ public function setBankBic(?string $bank_bic): void public function getBankBic(): ?string { - return $this->get('bank_bic'); + return $this->attr('bank_bic'); } public function setBankCode(?string $bank_code): void @@ -74,7 +74,7 @@ public function setBankCode(?string $bank_code): void public function getBankCode(): ?string { - return $this->get('bank_code'); + return $this->attr('bank_code'); } public function setBankIban(?string $bank_iban): void @@ -84,7 +84,7 @@ public function setBankIban(?string $bank_iban): void public function getBankIban(): ?string { - return $this->get('bank_iban'); + return $this->attr('bank_iban'); } public function setBankName(?string $bank_name): void @@ -94,17 +94,17 @@ public function setBankName(?string $bank_name): void public function getBankName(): ?string { - return $this->get('bank_name'); + return $this->attr('bank_name'); } - public function setBirthDate(?string $birth_date): void + public function setBirthDate(?\DateTimeImmutable $birth_date): void { $this->data['birth_date'] = $birth_date; } - public function getBirthDate(): ?string + public function getBirthDate(): ?\DateTimeImmutable { - return $this->get('birth_date'); + return $this->attrDate('birth_date'); } public function setCashAllowance(?float $cash_allowance): void @@ -114,7 +114,7 @@ public function setCashAllowance(?float $cash_allowance): void public function getCashAllowance(): ?float { - return $this->get('cash_allowance'); + return $this->attr('cash_allowance'); } public function setCashAllowanceDays(int $cash_allowance_days): void @@ -124,7 +124,7 @@ public function setCashAllowanceDays(int $cash_allowance_days): void public function getCashAllowanceDays(): int { - return $this->get('cash_allowance_days'); + return $this->attr('cash_allowance_days'); } public function setCashDiscount(?float $cash_discount): void @@ -134,7 +134,7 @@ public function setCashDiscount(?float $cash_discount): void public function getCashDiscount(): ?float { - return $this->get('cash_discount'); + return $this->attr('cash_discount'); } public function setCashDiscountType(?string $cash_discount_type): void @@ -144,7 +144,7 @@ public function setCashDiscountType(?string $cash_discount_type): void public function getCashDiscountType(): ?string { - return $this->get('cash_discount_type'); + return $this->attr('cash_discount_type'); } public function setCity(?string $city): void @@ -154,7 +154,7 @@ public function setCity(?string $city): void public function getCity(): ?string { - return $this->get('city'); + return $this->attr('city'); } public function setState(string $state): void @@ -164,7 +164,7 @@ public function setState(string $state): void public function getState(): string { - return $this->get('state'); + return $this->attr('state'); } public function setCompanyName(?string $company_name): void @@ -174,7 +174,7 @@ public function setCompanyName(?string $company_name): void public function getCompanyName(): ?string { - return $this->get('company_name'); + return $this->attr('company_name'); } public function setCountry(string $country): void @@ -184,17 +184,17 @@ public function setCountry(string $country): void public function getCountry(): string { - return $this->get('country'); + return $this->attr('country'); } - public function getCreatedAt(): string + public function getCreatedAt(): \DateTimeImmutable { - return $this->get('created_at'); + return $this->attrDate('created_at'); } public function getUpdatedAt(): string { - return $this->get('updated_at'); + return $this->attr('updated_at'); } public function setDeliveryTitle(string $delivery_title): void @@ -204,7 +204,7 @@ public function setDeliveryTitle(string $delivery_title): void public function getDeliveryTitle(): string { - return $this->get('delivery_title'); + return $this->attr('delivery_title'); } public function setDeliveryCity(?string $delivery_city): void @@ -214,7 +214,7 @@ public function setDeliveryCity(?string $delivery_city): void public function getDeliveryCity(): ?string { - return $this->get('delivery_city'); + return $this->attr('delivery_city'); } public function setDeliveryState(string $delivery_state): void @@ -224,7 +224,7 @@ public function setDeliveryState(string $delivery_state): void public function getDeliveryState(): string { - return $this->get('delivery_state'); + return $this->attr('delivery_state'); } public function setDeliveryCompanyName(?string $delivery_company_name): void @@ -234,7 +234,7 @@ public function setDeliveryCompanyName(?string $delivery_company_name): void public function getDeliveryCompanyName(): ?string { - return $this->get('delivery_company_name'); + return $this->attr('delivery_company_name'); } public function setDeliveryCountry(?string $delivery_country): void @@ -244,7 +244,7 @@ public function setDeliveryCountry(?string $delivery_country): void public function getDeliveryCountry(): ?string { - return $this->get('delivery_country'); + return $this->attr('delivery_country'); } public function setDeliveryFirstName(?string $delivery_first_name): void @@ -254,7 +254,7 @@ public function setDeliveryFirstName(?string $delivery_first_name): void public function getDeliveryFirstName(): ?string { - return $this->get('delivery_first_name'); + return $this->attr('delivery_first_name'); } public function setDeliveryLastName(?string $delivery_last_name): void @@ -264,7 +264,7 @@ public function setDeliveryLastName(?string $delivery_last_name): void public function getDeliveryLastName(): ?string { - return $this->get('delivery_last_name'); + return $this->attr('delivery_last_name'); } public function setDeliveryPersonal(bool $delivery_personal): void @@ -274,7 +274,7 @@ public function setDeliveryPersonal(bool $delivery_personal): void public function getDeliveryPersonal(): bool { - return $this->get('delivery_personal'); + return $this->attr('delivery_personal'); } /** @@ -287,7 +287,7 @@ public function setDeliverySalutation(int $delivery_salutation): void public function getDeliverySalutation(): int { - return $this->get('delivery_salutation'); + return $this->attr('delivery_salutation'); } public function setDeliveryStreet(?string $delivery_street): void @@ -297,7 +297,7 @@ public function setDeliveryStreet(?string $delivery_street): void public function getDeliveryStreet(): ?string { - return $this->get('delivery_street'); + return $this->attr('delivery_street'); } public function setDeliverySuffix1(?string $delivery_suffix_1): void @@ -307,7 +307,7 @@ public function setDeliverySuffix1(?string $delivery_suffix_1): void public function getDeliverySuffix1(): ?string { - return $this->get('delivery_suffix_1'); + return $this->attr('delivery_suffix_1'); } public function setDeliverySuffix2(?string $delivery_suffix_2): void @@ -317,7 +317,7 @@ public function setDeliverySuffix2(?string $delivery_suffix_2): void public function getDeliverySuffix2(): ?string { - return $this->get('delivery_suffix_2'); + return $this->attr('delivery_suffix_2'); } public function setDeliveryZipCode(?string $delivery_zip_code): void @@ -327,12 +327,12 @@ public function setDeliveryZipCode(?string $delivery_zip_code): void public function getDeliveryZipCode(): ?string { - return $this->get('delivery_zip_code'); + return $this->attr('delivery_zip_code'); } public function getDisplayName(): string { - return $this->get('display_name'); + return $this->attr('display_name'); } public function setEmails(array $emails): void @@ -345,7 +345,7 @@ public function setEmails(array $emails): void */ public function getEmails(): array { - return $this->get('emails'); + return $this->attr('emails'); } public function setFax(?string $fax): void @@ -355,7 +355,7 @@ public function setFax(?string $fax): void public function getFax(): ?string { - return $this->get('fax'); + return $this->attr('fax'); } public function setFirstName(?string $first_name): void @@ -365,7 +365,7 @@ public function setFirstName(?string $first_name): void public function getFirstName(): ?string { - return $this->get('first_name'); + return $this->attr('first_name'); } /** @@ -378,7 +378,7 @@ public function setGracePeriod(?int $grace_period): void public function getGracePeriod(): ?int { - return $this->get('grace_period'); + return $this->attr('grace_period'); } /** @@ -391,7 +391,7 @@ public function setDueInDays(?int $due_in_days): void public function getDueInDays(): ?int { - return $this->get('due_in_days'); + return $this->attr('due_in_days'); } public function setGroupId(?int $group_id): void @@ -401,12 +401,12 @@ public function setGroupId(?int $group_id): void public function getGroupId(): ?int { - return $this->get('group_id'); + return $this->attr('group_id'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setInfo1(?string $info_1): void @@ -416,7 +416,7 @@ public function setInfo1(?string $info_1): void public function getInfo1(): ?string { - return $this->get('info_1'); + return $this->attr('info_1'); } public function setInfo2(?string $info_2): void @@ -426,7 +426,7 @@ public function setInfo2(?string $info_2): void public function getInfo2(): ?string { - return $this->get('info_2'); + return $this->attr('info_2'); } public function setInternet(?string $internet): void @@ -436,7 +436,7 @@ public function setInternet(?string $internet): void public function getInternet(): ?string { - return $this->get('internet'); + return $this->attr('internet'); } public function setLastName(?string $last_name): void @@ -446,7 +446,7 @@ public function setLastName(?string $last_name): void public function getLastName(): ?string { - return $this->get('last_name'); + return $this->attr('last_name'); } public function setLoginId(int $login_id): void @@ -456,7 +456,7 @@ public function setLoginId(int $login_id): void public function getLoginId(): int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setMobile(?string $mobile): void @@ -466,7 +466,7 @@ public function setMobile(?string $mobile): void public function getMobile(): ?string { - return $this->get('mobile'); + return $this->attr('mobile'); } public function setNote(?string $note): void @@ -476,7 +476,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->get('note'); + return $this->attr('note'); } /** @@ -489,7 +489,7 @@ public function setNumber(string $number): void public function getNumber(): string { - return $this->get('number'); + return $this->attr('number'); } /** @@ -502,7 +502,7 @@ public function setPaymentOptions(?int $payment_options): void public function getPaymentOptions(): ?int { - return $this->get('payment_options'); + return $this->attr('payment_options'); } public function setPersonal(bool $personal): void @@ -512,7 +512,7 @@ public function setPersonal(bool $personal): void public function getPersonal(): bool { - return $this->get('personal'); + return $this->attr('personal'); } public function setPhone1(?string $phone_1): void @@ -522,7 +522,7 @@ public function setPhone1(?string $phone_1): void public function getPhone1(): ?string { - return $this->get('phone_1'); + return $this->attr('phone_1'); } public function setPhone2(?string $phone_2): void @@ -532,7 +532,7 @@ public function setPhone2(?string $phone_2): void public function getPhone2(): ?string { - return $this->get('phone_2'); + return $this->attr('phone_2'); } public function setPostbox(?string $postbox): void @@ -542,7 +542,7 @@ public function setPostbox(?string $postbox): void public function getPostbox(): ?string { - return $this->get('postbox'); + return $this->attr('postbox'); } public function setPostboxCity(?string $postbox_city): void @@ -552,7 +552,7 @@ public function setPostboxCity(?string $postbox_city): void public function getPostboxCity(): ?string { - return $this->get('postbox_city'); + return $this->attr('postbox_city'); } public function setPostboxState(string $postbox_state): void @@ -562,7 +562,7 @@ public function setPostboxState(string $postbox_state): void public function getPostboxState(): string { - return $this->get('postbox_state'); + return $this->attr('postbox_state'); } public function setPostboxCountry(?string $postbox_country): void @@ -572,7 +572,7 @@ public function setPostboxCountry(?string $postbox_country): void public function getPostboxCountry(): ?string { - return $this->get('postbox_country'); + return $this->attr('postbox_country'); } public function setPostboxZipCode(?string $postbox_zip_code): void @@ -582,7 +582,7 @@ public function setPostboxZipCode(?string $postbox_zip_code): void public function getPostboxZipCode(): ?string { - return $this->get('postbox_zip_code'); + return $this->attr('postbox_zip_code'); } public function setSalePriceLevel(?string $sale_price_level): void @@ -592,7 +592,7 @@ public function setSalePriceLevel(?string $sale_price_level): void public function getSalePriceLevel(): ?string { - return $this->get('sale_price_level'); + return $this->attr('sale_price_level'); } /** @@ -605,7 +605,7 @@ public function setSalutation(int $salutation): void public function getSalutation(): int { - return $this->get('salutation'); + return $this->attr('salutation'); } /** @@ -618,17 +618,17 @@ public function setSepaAgreement(?string $sepa_agreement): void public function getSepaAgreement(): ?string { - return $this->get('sepa_agreement'); + return $this->attr('sepa_agreement'); } - public function setSepaAgreementDate(?string $sepa_agreement_date): void + public function setSepaAgreementDate(?\DateTimeImmutable $sepa_agreement_date): void { $this->data['sepa_agreement_date'] = $sepa_agreement_date; } - public function getSepaAgreementDate(): ?string + public function getSepaAgreementDate(): ?\DateTimeImmutable { - return $this->get('sepa_agreement_date'); + return $this->attrDate('sepa_agreement_date'); } public function setSepaMandateReference(?string $sepa_mandate_reference): void @@ -638,17 +638,17 @@ public function setSepaMandateReference(?string $sepa_mandate_reference): void public function getSepaMandateReference(): ?string { - return $this->get('sepa_mandate_reference'); + return $this->attr('sepa_mandate_reference'); } - public function setSinceDate(?string $since_date): void + public function setSinceDate(?\DateTimeImmutable $since_date): void { $this->data['since_date'] = $since_date; } - public function getSinceDate(): ?string + public function getSinceDate(): ?\DateTimeImmutable { - return $this->get('since_date'); + return $this->attrDate('since_date'); } public function setStreet(?string $street): void @@ -658,7 +658,7 @@ public function setStreet(?string $street): void public function getStreet(): ?string { - return $this->get('street'); + return $this->attr('street'); } public function setSuffix1(?string $suffix_1): void @@ -668,7 +668,7 @@ public function setSuffix1(?string $suffix_1): void public function getSuffix1(): ?string { - return $this->get('suffix_1'); + return $this->attr('suffix_1'); } public function setSuffix2(?string $suffix_2): void @@ -678,7 +678,7 @@ public function setSuffix2(?string $suffix_2): void public function getSuffix2(): ?string { - return $this->get('suffix_2'); + return $this->attr('suffix_2'); } public function setTaxNumber(?string $tax_number): void @@ -688,7 +688,7 @@ public function setTaxNumber(?string $tax_number): void public function getTaxNumber(): ?string { - return $this->get('tax_number'); + return $this->attr('tax_number'); } public function setCourt(?string $court): void @@ -698,7 +698,7 @@ public function setCourt(?string $court): void public function getCourt(): ?string { - return $this->get('court'); + return $this->attr('court'); } public function setCourtRegistryNumber(?string $court_registry_number): void @@ -708,7 +708,7 @@ public function setCourtRegistryNumber(?string $court_registry_number): void public function getCourtRegistryNumber(): ?string { - return $this->get('court_registry_number'); + return $this->attr('court_registry_number'); } /** @@ -721,7 +721,7 @@ public function setTaxOptions(?string $tax_options): void public function getTaxOptions(): ?string { - return $this->get('tax_options'); + return $this->attr('tax_options'); } public function setTitle(?string $title): void @@ -731,7 +731,7 @@ public function setTitle(?string $title): void public function getTitle(): ?string { - return $this->get('title'); + return $this->attr('title'); } public function setVatIdentifier(?string $vat_identifier): void @@ -741,7 +741,7 @@ public function setVatIdentifier(?string $vat_identifier): void public function getVatIdentifier(): ?string { - return $this->get('vat_identifier'); + return $this->attr('vat_identifier'); } public function setZipCode(?string $zip_code): void @@ -751,7 +751,7 @@ public function setZipCode(?string $zip_code): void public function getZipCode(): ?string { - return $this->get('zip_code'); + return $this->attr('zip_code'); } /** @@ -764,7 +764,7 @@ public function setDocumentPdfType(string $documentPdfType): void public function getDocumentPdfType(): string { - return $this->get('documentPdfType'); + return $this->attr('documentPdfType'); } /** @@ -777,7 +777,7 @@ public function setBuyerReference(string $buyer_reference): void public function getBuyerReference(): string { - return $this->get('buyer_reference'); + return $this->attr('buyer_reference'); } /** @@ -790,6 +790,6 @@ public function setForeignSupplierNumber(string $foreign_supplier_number): void public function getForeignSupplierNumber(): string { - return $this->get('foreign_supplier_number'); + return $this->attr('foreign_supplier_number'); } } diff --git a/src/Models/CustomerGroup.php b/src/Models/CustomerGroup.php index 97507f8..d2dc8ff 100644 --- a/src/Models/CustomerGroup.php +++ b/src/Models/CustomerGroup.php @@ -23,7 +23,7 @@ public function setName(string $name): void public function getName(): string { - return $this->get('name'); + return $this->attr('name'); } public function setDescription(?string $description): void @@ -33,7 +33,7 @@ public function setDescription(?string $description): void public function getDescription(): ?string { - return $this->get('description'); + return $this->attr('description'); } /** @@ -46,16 +46,16 @@ public function setNumber(string $number): void public function getNumber(): string { - return $this->get('number'); + return $this->attr('number'); } public function getDisplayName(): string { - return $this->get('display_name'); + return $this->attr('display_name'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } } diff --git a/src/Models/CustomerSnapshot.php b/src/Models/CustomerSnapshot.php index 718859c..40c5408 100644 --- a/src/Models/CustomerSnapshot.php +++ b/src/Models/CustomerSnapshot.php @@ -19,7 +19,7 @@ public function __construct(array $data = []) public function getAcquireOptions(): ?int { - return $this->get('acquire_options'); + return $this->attr('acquire_options'); } /** @@ -27,162 +27,162 @@ public function getAcquireOptions(): ?int */ public function getAdditionalGroupsIds(): array { - return $this->get('additional_groups_ids'); + return $this->attr('additional_groups_ids'); } public function getBankAccount(): ?string { - return $this->get('bank_account'); + return $this->attr('bank_account'); } public function getBankAccountOwner(): ?string { - return $this->get('bank_account_owner'); + return $this->attr('bank_account_owner'); } public function getBankBic(): ?string { - return $this->get('bank_bic'); + return $this->attr('bank_bic'); } public function getBankCode(): ?string { - return $this->get('bank_code'); + return $this->attr('bank_code'); } public function getBankIban(): ?string { - return $this->get('bank_iban'); + return $this->attr('bank_iban'); } public function getBankName(): ?string { - return $this->get('bank_name'); + return $this->attr('bank_name'); } - public function getBirthDate(): ?string + public function getBirthDate(): ?\DateTimeImmutable { - return $this->get('birth_date'); + return $this->attrDate('birth_date'); } public function getCashAllowance(): ?float { - return $this->get('cash_allowance'); + return $this->attr('cash_allowance'); } public function getCashAllowanceDays(): int { - return $this->get('cash_allowance_days'); + return $this->attr('cash_allowance_days'); } public function getCashDiscount(): ?float { - return $this->get('cash_discount'); + return $this->attr('cash_discount'); } public function getCashDiscountType(): ?string { - return $this->get('cash_discount_type'); + return $this->attr('cash_discount_type'); } public function getCity(): ?string { - return $this->get('city'); + return $this->attr('city'); } public function getState(): string { - return $this->get('state'); + return $this->attr('state'); } public function getCompanyName(): ?string { - return $this->get('company_name'); + return $this->attr('company_name'); } public function getCountry(): string { - return $this->get('country'); + return $this->attr('country'); } - public function getCreatedAt(): string + public function getCreatedAt(): \DateTimeImmutable { - return $this->get('created_at'); + return $this->attrDate('created_at'); } public function getUpdatedAt(): string { - return $this->get('updated_at'); + return $this->attr('updated_at'); } public function getDeliveryTitle(): string { - return $this->get('delivery_title'); + return $this->attr('delivery_title'); } public function getDeliveryCity(): ?string { - return $this->get('delivery_city'); + return $this->attr('delivery_city'); } public function getDeliveryState(): string { - return $this->get('delivery_state'); + return $this->attr('delivery_state'); } public function getDeliveryCompanyName(): ?string { - return $this->get('delivery_company_name'); + return $this->attr('delivery_company_name'); } public function getDeliveryCountry(): ?string { - return $this->get('delivery_country'); + return $this->attr('delivery_country'); } public function getDeliveryFirstName(): ?string { - return $this->get('delivery_first_name'); + return $this->attr('delivery_first_name'); } public function getDeliveryLastName(): ?string { - return $this->get('delivery_last_name'); + return $this->attr('delivery_last_name'); } public function getDeliveryPersonal(): bool { - return $this->get('delivery_personal'); + return $this->attr('delivery_personal'); } public function getDeliverySalutation(): int { - return $this->get('delivery_salutation'); + return $this->attr('delivery_salutation'); } public function getDeliveryStreet(): ?string { - return $this->get('delivery_street'); + return $this->attr('delivery_street'); } public function getDeliverySuffix1(): ?string { - return $this->get('delivery_suffix_1'); + return $this->attr('delivery_suffix_1'); } public function getDeliverySuffix2(): ?string { - return $this->get('delivery_suffix_2'); + return $this->attr('delivery_suffix_2'); } public function getDeliveryZipCode(): ?string { - return $this->get('delivery_zip_code'); + return $this->attr('delivery_zip_code'); } public function getDisplayName(): string { - return $this->get('display_name'); + return $this->attr('display_name'); } /** @@ -190,216 +190,216 @@ public function getDisplayName(): string */ public function getEmails(): array { - return $this->get('emails'); + return $this->attr('emails'); } public function getFax(): ?string { - return $this->get('fax'); + return $this->attr('fax'); } public function getFirstName(): ?string { - return $this->get('first_name'); + return $this->attr('first_name'); } public function getGracePeriod(): ?int { - return $this->get('grace_period'); + return $this->attr('grace_period'); } public function getDueInDays(): ?int { - return $this->get('due_in_days'); + return $this->attr('due_in_days'); } public function getGroupId(): ?int { - return $this->get('group_id'); + return $this->attr('group_id'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function getInfo1(): ?string { - return $this->get('info_1'); + return $this->attr('info_1'); } public function getInfo2(): ?string { - return $this->get('info_2'); + return $this->attr('info_2'); } public function getInternet(): ?string { - return $this->get('internet'); + return $this->attr('internet'); } public function getLastName(): ?string { - return $this->get('last_name'); + return $this->attr('last_name'); } public function getLoginId(): int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function getMobile(): ?string { - return $this->get('mobile'); + return $this->attr('mobile'); } public function getNote(): ?string { - return $this->get('note'); + return $this->attr('note'); } public function getNumber(): string { - return $this->get('number'); + return $this->attr('number'); } public function getPaymentOptions(): ?int { - return $this->get('payment_options'); + return $this->attr('payment_options'); } public function getPersonal(): bool { - return $this->get('personal'); + return $this->attr('personal'); } public function getPhone1(): ?string { - return $this->get('phone_1'); + return $this->attr('phone_1'); } public function getPhone2(): ?string { - return $this->get('phone_2'); + return $this->attr('phone_2'); } public function getPostbox(): ?string { - return $this->get('postbox'); + return $this->attr('postbox'); } public function getPostboxCity(): ?string { - return $this->get('postbox_city'); + return $this->attr('postbox_city'); } public function getPostboxState(): string { - return $this->get('postbox_state'); + return $this->attr('postbox_state'); } public function getPostboxCountry(): ?string { - return $this->get('postbox_country'); + return $this->attr('postbox_country'); } public function getPostboxZipCode(): ?string { - return $this->get('postbox_zip_code'); + return $this->attr('postbox_zip_code'); } public function getSalePriceLevel(): ?string { - return $this->get('sale_price_level'); + return $this->attr('sale_price_level'); } public function getSalutation(): int { - return $this->get('salutation'); + return $this->attr('salutation'); } public function getSepaAgreement(): ?string { - return $this->get('sepa_agreement'); + return $this->attr('sepa_agreement'); } - public function getSepaAgreementDate(): ?string + public function getSepaAgreementDate(): ?\DateTimeImmutable { - return $this->get('sepa_agreement_date'); + return $this->attrDate('sepa_agreement_date'); } public function getSepaMandateReference(): ?string { - return $this->get('sepa_mandate_reference'); + return $this->attr('sepa_mandate_reference'); } - public function getSinceDate(): ?string + public function getSinceDate(): ?\DateTimeImmutable { - return $this->get('since_date'); + return $this->attrDate('since_date'); } public function getStreet(): ?string { - return $this->get('street'); + return $this->attr('street'); } public function getSuffix1(): ?string { - return $this->get('suffix_1'); + return $this->attr('suffix_1'); } public function getSuffix2(): ?string { - return $this->get('suffix_2'); + return $this->attr('suffix_2'); } public function getTaxNumber(): ?string { - return $this->get('tax_number'); + return $this->attr('tax_number'); } public function getCourt(): ?string { - return $this->get('court'); + return $this->attr('court'); } public function getCourtRegistryNumber(): ?string { - return $this->get('court_registry_number'); + return $this->attr('court_registry_number'); } public function getTaxOptions(): ?string { - return $this->get('tax_options'); + return $this->attr('tax_options'); } public function getTitle(): ?string { - return $this->get('title'); + return $this->attr('title'); } public function getVatIdentifier(): ?string { - return $this->get('vat_identifier'); + return $this->attr('vat_identifier'); } public function getZipCode(): ?string { - return $this->get('zip_code'); + return $this->attr('zip_code'); } public function getDocumentPdfType(): string { - return $this->get('documentPdfType'); + return $this->attr('documentPdfType'); } public function getBuyerReference(): string { - return $this->get('buyer_reference'); + return $this->attr('buyer_reference'); } public function getForeignSupplierNumber(): string { - return $this->get('foreign_supplier_number'); + return $this->attr('foreign_supplier_number'); } } diff --git a/src/Models/DiscountPosition.php b/src/Models/DiscountPosition.php index dd7acb5..410c6fa 100644 --- a/src/Models/DiscountPosition.php +++ b/src/Models/DiscountPosition.php @@ -23,12 +23,12 @@ public function setPositionId(int $position_id): void public function getPositionId(): int { - return $this->get('position_id'); + return $this->attr('position_id'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setCustomerId(int $customer_id): void @@ -38,7 +38,7 @@ public function setCustomerId(int $customer_id): void public function getCustomerId(): int { - return $this->get('customer_id'); + return $this->attr('customer_id'); } /** @@ -51,7 +51,7 @@ public function setDiscount(int $discount): void public function getDiscount(): int { - return $this->get('discount'); + return $this->attr('discount'); } /** @@ -64,6 +64,6 @@ public function setDiscountType(string $discount_type): void public function getDiscountType(): string { - return $this->get('discount_type'); + return $this->attr('discount_type'); } } diff --git a/src/Models/DiscountPositionGroup.php b/src/Models/DiscountPositionGroup.php index 3801b6a..0a10dbb 100644 --- a/src/Models/DiscountPositionGroup.php +++ b/src/Models/DiscountPositionGroup.php @@ -23,12 +23,12 @@ public function setPositionGroupId(int $position_group_id): void public function getPositionGroupId(): int { - return $this->get('position_group_id'); + return $this->attr('position_group_id'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setCustomerId(int $customer_id): void @@ -38,7 +38,7 @@ public function setCustomerId(int $customer_id): void public function getCustomerId(): int { - return $this->get('customer_id'); + return $this->attr('customer_id'); } /** @@ -51,7 +51,7 @@ public function setDiscount(int $discount): void public function getDiscount(): int { - return $this->get('discount'); + return $this->attr('discount'); } /** @@ -64,6 +64,6 @@ public function setDiscountType(string $discount_type): void public function getDiscountType(): string { - return $this->get('discount_type'); + return $this->attr('discount_type'); } } diff --git a/src/Models/Document.php b/src/Models/Document.php index fbf9c48..7040a01 100644 --- a/src/Models/Document.php +++ b/src/Models/Document.php @@ -18,7 +18,7 @@ public function __construct(array $data = []) public function getAddress(): DocumentAddress { - return $this->getInstance('address', \easybill\SDK\Models\DocumentAddress::class); + return $this->attrInstance('address', \easybill\SDK\Models\DocumentAddress::class); } /** @@ -26,22 +26,22 @@ public function getAddress(): DocumentAddress */ public function getAttachmentIds(): array { - return $this->get('attachment_ids'); + return $this->attr('attachment_ids'); } public function getLabelAddress(): DocumentAddress { - return $this->getInstance('label_address', \easybill\SDK\Models\DocumentAddress::class); + return $this->attrInstance('label_address', \easybill\SDK\Models\DocumentAddress::class); } public function getAmount(): int { - return $this->get('amount'); + return $this->attr('amount'); } public function getAmountNet(): int { - return $this->get('amount_net'); + return $this->attr('amount_net'); } public function setBankDebitForm(?string $bank_debit_form): void @@ -51,12 +51,12 @@ public function setBankDebitForm(?string $bank_debit_form): void public function getBankDebitForm(): ?string { - return $this->get('bank_debit_form'); + return $this->attr('bank_debit_form'); } public function getBillingCountry(): string { - return $this->get('billing_country'); + return $this->attr('billing_country'); } /** @@ -69,12 +69,12 @@ public function setCalcVatFrom(int $calc_vat_from): void public function getCalcVatFrom(): int { - return $this->get('calc_vat_from'); + return $this->attr('calc_vat_from'); } public function getCancelId(): int { - return $this->get('cancel_id'); + return $this->attr('cancel_id'); } public function setCashAllowance(?float $cash_allowance): void @@ -84,7 +84,7 @@ public function setCashAllowance(?float $cash_allowance): void public function getCashAllowance(): ?float { - return $this->get('cash_allowance'); + return $this->attr('cash_allowance'); } public function setCashAllowanceDays(?int $cash_allowance_days): void @@ -94,7 +94,7 @@ public function setCashAllowanceDays(?int $cash_allowance_days): void public function getCashAllowanceDays(): ?int { - return $this->get('cash_allowance_days'); + return $this->attr('cash_allowance_days'); } public function setCashAllowanceText(?string $cash_allowance_text): void @@ -104,7 +104,7 @@ public function setCashAllowanceText(?string $cash_allowance_text): void public function getCashAllowanceText(): ?string { - return $this->get('cash_allowance_text'); + return $this->attr('cash_allowance_text'); } public function setContactId(?int $contact_id): void @@ -114,7 +114,7 @@ public function setContactId(?int $contact_id): void public function getContactId(): ?int { - return $this->get('contact_id'); + return $this->attr('contact_id'); } public function setContactLabel(string $contact_label): void @@ -124,7 +124,7 @@ public function setContactLabel(string $contact_label): void public function getContactLabel(): string { - return $this->get('contact_label'); + return $this->attr('contact_label'); } public function setContactText(string $contact_text): void @@ -134,12 +134,12 @@ public function setContactText(string $contact_text): void public function getContactText(): string { - return $this->get('contact_text'); + return $this->attr('contact_text'); } - public function getCreatedAt(): string + public function getCreatedAt(): \DateTimeImmutable { - return $this->get('created_at'); + return $this->attr('created_at'); } public function setCurrency(string $currency): void @@ -149,7 +149,7 @@ public function setCurrency(string $currency): void public function getCurrency(): string { - return $this->get('currency'); + return $this->attr('currency'); } public function setCustomerId(?int $customer_id): void @@ -159,12 +159,12 @@ public function setCustomerId(?int $customer_id): void public function getCustomerId(): ?int { - return $this->get('customer_id'); + return $this->attr('customer_id'); } public function getCustomerSnapshot(): CustomerSnapshot { - return $this->getInstance('customer_snapshot', \easybill\SDK\Models\CustomerSnapshot::class); + return $this->attrInstance('customer_snapshot', \easybill\SDK\Models\CustomerSnapshot::class); } public function setDiscount(?string $discount): void @@ -174,7 +174,7 @@ public function setDiscount(?string $discount): void public function getDiscount(): ?string { - return $this->get('discount'); + return $this->attr('discount'); } public function setDiscountType(?string $discount_type): void @@ -184,27 +184,27 @@ public function setDiscountType(?string $discount_type): void public function getDiscountType(): ?string { - return $this->get('discount_type'); + return $this->attr('discount_type'); } - public function setDocumentDate(string $document_date): void + public function setDocumentDate(\DateTimeImmutable $document_date): void { $this->data['document_date'] = $document_date; } - public function getDocumentDate(): string + public function getDocumentDate(): \DateTimeImmutable { - return $this->get('document_date'); + return $this->attrDate('document_date'); } - public function getDueDate(): string + public function getDueDate(): \DateTimeImmutable { - return $this->get('due_date'); + return $this->attrDate('due_date'); } - public function getEditedAt(): string + public function getEditedAt(): \DateTimeImmutable { - return $this->get('edited_at'); + return $this->attr('edited_at'); } public function setExternalId(?string $external_id): void @@ -214,7 +214,7 @@ public function setExternalId(?string $external_id): void public function getExternalId(): ?string { - return $this->get('external_id'); + return $this->attr('external_id'); } public function setReplicaUrl(?string $replica_url): void @@ -224,7 +224,7 @@ public function setReplicaUrl(?string $replica_url): void public function getReplicaUrl(): ?string { - return $this->get('replica_url'); + return $this->attr('replica_url'); } /** @@ -237,7 +237,7 @@ public function setGracePeriod(?int $grace_period): void public function getGracePeriod(): ?int { - return $this->get('grace_period'); + return $this->attr('grace_period'); } /** @@ -250,12 +250,12 @@ public function setDueInDays(?int $due_in_days): void public function getDueInDays(): ?int { - return $this->get('due_in_days'); + return $this->attr('due_in_days'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setIsArchive(bool $is_archive): void @@ -265,12 +265,12 @@ public function setIsArchive(bool $is_archive): void public function getIsArchive(): bool { - return $this->get('is_archive'); + return $this->attr('is_archive'); } public function getIsDraft(): bool { - return $this->get('is_draft'); + return $this->attr('is_draft'); } /** @@ -283,12 +283,12 @@ public function setIsReplica(bool $is_replica): void public function getIsReplica(): bool { - return $this->get('is_replica'); + return $this->attr('is_replica'); } public function getIsCold(): bool { - return $this->get('is_cold'); + return $this->attr('is_cold'); } /** @@ -301,20 +301,20 @@ public function setIsOss(bool $is_oss): void public function getIsOss(): bool { - return $this->get('is_oss'); + return $this->attr('is_oss'); } /** * Signals when the document should be moved to the long term archive. */ - public function setColdstorageDueDate(?string $coldstorage_due_date): void + public function setColdstorageDueDate(?\DateTimeImmutable $coldstorage_due_date): void { $this->data['coldstorage_due_date'] = $coldstorage_due_date; } - public function getColdstorageDueDate(): ?string + public function getColdstorageDueDate(): ?\DateTimeImmutable { - return $this->get('coldstorage_due_date'); + return $this->attrDate('coldstorage_due_date'); } /** @@ -322,7 +322,7 @@ public function getColdstorageDueDate(): ?string */ public function getItemNotes(): array { - return $this->get('item_notes'); + return $this->attr('item_notes'); } public function setItems(array $items): void @@ -335,12 +335,12 @@ public function setItems(array $items): void */ public function getItems(): array { - return $this->get('items'); + return $this->attr('items'); } public function getLastPostboxId(): int { - return $this->get('last_postbox_id'); + return $this->attr('last_postbox_id'); } /** @@ -353,7 +353,7 @@ public function setLoginId(int $login_id): void public function getLoginId(): int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setNumber(?string $number): void @@ -363,7 +363,7 @@ public function setNumber(?string $number): void public function getNumber(): ?string { - return $this->get('number'); + return $this->attr('number'); } public function setOrderNumber(string $order_number): void @@ -373,7 +373,7 @@ public function setOrderNumber(string $order_number): void public function getOrderNumber(): string { - return $this->get('order_number'); + return $this->attr('order_number'); } public function setBuyerReference(string $buyer_reference): void @@ -383,22 +383,22 @@ public function setBuyerReference(string $buyer_reference): void public function getBuyerReference(): string { - return $this->get('buyer_reference'); + return $this->attr('buyer_reference'); } public function getPaidAmount(): int { - return $this->get('paid_amount'); + return $this->attr('paid_amount'); } - public function getPaidAt(): string + public function getPaidAt(): \DateTimeImmutable { - return $this->get('paid_at'); + return $this->attrDate('paid_at'); } public function getPdfPages(): int { - return $this->get('pdf_pages'); + return $this->attr('pdf_pages'); } /** @@ -411,7 +411,7 @@ public function setPdfTemplate(string $pdf_template): void public function getPdfTemplate(): string { - return $this->get('pdf_template'); + return $this->attr('pdf_template'); } public function setProjectId(?int $project_id): void @@ -421,7 +421,7 @@ public function setProjectId(?int $project_id): void public function getProjectId(): ?int { - return $this->get('project_id'); + return $this->attr('project_id'); } /** @@ -434,7 +434,7 @@ public function setRecurringOptions(DocumentRecurring $recurring_options): void public function getRecurringOptions(): DocumentRecurring { - return $this->getInstance('recurring_options', \easybill\SDK\Models\DocumentRecurring::class); + return $this->attrInstance('recurring_options', \easybill\SDK\Models\DocumentRecurring::class); } /** @@ -447,7 +447,7 @@ public function setRefId(?int $ref_id): void public function getRefId(): ?int { - return $this->get('ref_id'); + return $this->attr('ref_id'); } /** @@ -460,7 +460,7 @@ public function setServiceDate(ServiceDate $service_date): void public function getServiceDate(): ServiceDate { - return $this->getInstance('service_date', \easybill\SDK\Models\ServiceDate::class); + return $this->attrInstance('service_date', \easybill\SDK\Models\ServiceDate::class); } public function setShippingCountry(?string $shipping_country): void @@ -470,7 +470,7 @@ public function setShippingCountry(?string $shipping_country): void public function getShippingCountry(): ?string { - return $this->get('shipping_country'); + return $this->attr('shipping_country'); } /** @@ -483,7 +483,7 @@ public function setStatus(?string $status): void public function getStatus(): ?string { - return $this->get('status'); + return $this->attr('status'); } public function setText(string $text): void @@ -493,7 +493,7 @@ public function setText(string $text): void public function getText(): string { - return $this->get('text'); + return $this->attr('text'); } public function setTextPrefix(string $text_prefix): void @@ -503,7 +503,7 @@ public function setTextPrefix(string $text_prefix): void public function getTextPrefix(): string { - return $this->get('text_prefix'); + return $this->attr('text_prefix'); } /** @@ -516,7 +516,7 @@ public function setTextTax(?string $text_tax): void public function getTextTax(): ?string { - return $this->get('text_tax'); + return $this->attr('text_tax'); } public function setTitle(?string $title): void @@ -526,7 +526,7 @@ public function setTitle(?string $title): void public function getTitle(): ?string { - return $this->get('title'); + return $this->attr('title'); } /** @@ -539,7 +539,7 @@ public function setType(string $type): void public function getType(): string { - return $this->get('type'); + return $this->attr('type'); } /** @@ -552,7 +552,7 @@ public function setUseShippingAddress(bool $use_shipping_address): void public function getUseShippingAddress(): bool { - return $this->get('use_shipping_address'); + return $this->attr('use_shipping_address'); } public function setVatCountry(?string $vat_country): void @@ -562,12 +562,12 @@ public function setVatCountry(?string $vat_country): void public function getVatCountry(): ?string { - return $this->get('vat_country'); + return $this->attr('vat_country'); } public function getVatId(): string { - return $this->get('vat_id'); + return $this->attr('vat_id'); } public function setFulfillmentCountry(?string $fulfillment_country): void @@ -577,7 +577,7 @@ public function setFulfillmentCountry(?string $fulfillment_country): void public function getFulfillmentCountry(): ?string { - return $this->get('fulfillment_country'); + return $this->attr('fulfillment_country'); } /** @@ -590,6 +590,6 @@ public function setVatOption(?string $vat_option): void public function getVatOption(): ?string { - return $this->get('vat_option'); + return $this->attr('vat_option'); } } diff --git a/src/Models/DocumentAddress.php b/src/Models/DocumentAddress.php index 0f487de..6dff533 100644 --- a/src/Models/DocumentAddress.php +++ b/src/Models/DocumentAddress.php @@ -19,66 +19,66 @@ public function __construct(array $data = []) public function getSalutation(): int { - return $this->get('salutation'); + return $this->attr('salutation'); } public function getPersonal(): bool { - return $this->get('personal'); + return $this->attr('personal'); } public function getTitle(): string { - return $this->get('title'); + return $this->attr('title'); } public function getFirstName(): string { - return $this->get('first_name'); + return $this->attr('first_name'); } public function getLastName(): string { - return $this->get('last_name'); + return $this->attr('last_name'); } public function getSuffix1(): string { - return $this->get('suffix_1'); + return $this->attr('suffix_1'); } public function getSuffix2(): string { - return $this->get('suffix_2'); + return $this->attr('suffix_2'); } public function getCompanyName(): string { - return $this->get('company_name'); + return $this->attr('company_name'); } public function getStreet(): string { - return $this->get('street'); + return $this->attr('street'); } public function getZipCode(): string { - return $this->get('zip_code'); + return $this->attr('zip_code'); } public function getCity(): string { - return $this->get('city'); + return $this->attr('city'); } public function getState(): string { - return $this->get('state'); + return $this->attr('state'); } public function getCountry(): string { - return $this->get('country'); + return $this->attr('country'); } } diff --git a/src/Models/DocumentPayment.php b/src/Models/DocumentPayment.php index cc43397..e8a2ab1 100644 --- a/src/Models/DocumentPayment.php +++ b/src/Models/DocumentPayment.php @@ -23,7 +23,7 @@ public function setAmount(int $amount): void public function getAmount(): int { - return $this->get('amount'); + return $this->attr('amount'); } public function setDocumentId(int $document_id): void @@ -33,12 +33,12 @@ public function setDocumentId(int $document_id): void public function getDocumentId(): int { - return $this->get('document_id'); + return $this->attr('document_id'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setIsOverdueFee(bool $is_overdue_fee): void @@ -48,12 +48,12 @@ public function setIsOverdueFee(bool $is_overdue_fee): void public function getIsOverdueFee(): bool { - return $this->get('is_overdue_fee'); + return $this->attr('is_overdue_fee'); } public function getLoginId(): int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setNotice(string $notice): void @@ -63,17 +63,17 @@ public function setNotice(string $notice): void public function getNotice(): string { - return $this->get('notice'); + return $this->attr('notice'); } - public function setPaymentAt(string $payment_at): void + public function setPaymentAt(\DateTimeImmutable $payment_at): void { $this->data['payment_at'] = $payment_at; } - public function getPaymentAt(): string + public function getPaymentAt(): \DateTimeImmutable { - return $this->get('payment_at'); + return $this->attrDate('payment_at'); } public function setType(string $type): void @@ -83,7 +83,7 @@ public function setType(string $type): void public function getType(): string { - return $this->get('type'); + return $this->attr('type'); } public function setProvider(string $provider): void @@ -93,7 +93,7 @@ public function setProvider(string $provider): void public function getProvider(): string { - return $this->get('provider'); + return $this->attr('provider'); } public function setReference(string $reference): void @@ -103,6 +103,6 @@ public function setReference(string $reference): void public function getReference(): string { - return $this->get('reference'); + return $this->attr('reference'); } } diff --git a/src/Models/DocumentPosition.php b/src/Models/DocumentPosition.php index 325d6cb..5de5618 100644 --- a/src/Models/DocumentPosition.php +++ b/src/Models/DocumentPosition.php @@ -23,7 +23,7 @@ public function setNumber(?string $number): void public function getNumber(): ?string { - return $this->get('number'); + return $this->attr('number'); } public function setDescription(?string $description): void @@ -33,7 +33,7 @@ public function setDescription(?string $description): void public function getDescription(): ?string { - return $this->get('description'); + return $this->attr('description'); } /** @@ -46,7 +46,7 @@ public function setDocumentNote(string $document_note): void public function getDocumentNote(): string { - return $this->get('document_note'); + return $this->attr('document_note'); } public function setQuantity(float $quantity): void @@ -56,7 +56,7 @@ public function setQuantity(float $quantity): void public function getQuantity(): float { - return $this->get('quantity'); + return $this->attr('quantity'); } /** @@ -69,7 +69,7 @@ public function setQuantityStr(string $quantity_str): void public function getQuantityStr(): string { - return $this->get('quantity_str'); + return $this->attr('quantity_str'); } public function setUnit(?string $unit): void @@ -79,7 +79,7 @@ public function setUnit(?string $unit): void public function getUnit(): ?string { - return $this->get('unit'); + return $this->attr('unit'); } public function setType(string $type): void @@ -89,7 +89,7 @@ public function setType(string $type): void public function getType(): string { - return $this->get('type'); + return $this->attr('type'); } /** @@ -102,7 +102,7 @@ public function setPosition(int $position): void public function getPosition(): int { - return $this->get('position'); + return $this->attr('position'); } public function setSinglePriceNet(?float $single_price_net): void @@ -112,12 +112,12 @@ public function setSinglePriceNet(?float $single_price_net): void public function getSinglePriceNet(): ?float { - return $this->get('single_price_net'); + return $this->attr('single_price_net'); } public function getSinglePriceGross(): float { - return $this->get('single_price_gross'); + return $this->attr('single_price_gross'); } public function setVatPercent(float $vat_percent): void @@ -127,7 +127,7 @@ public function setVatPercent(float $vat_percent): void public function getVatPercent(): float { - return $this->get('vat_percent'); + return $this->attr('vat_percent'); } public function setDiscount(?float $discount): void @@ -137,7 +137,7 @@ public function setDiscount(?float $discount): void public function getDiscount(): ?float { - return $this->get('discount'); + return $this->attr('discount'); } public function setDiscountType(?string $discount_type): void @@ -147,7 +147,7 @@ public function setDiscountType(?string $discount_type): void public function getDiscountType(): ?string { - return $this->get('discount_type'); + return $this->attr('discount_type'); } /** @@ -160,32 +160,32 @@ public function setPositionId(?int $position_id): void public function getPositionId(): ?int { - return $this->get('position_id'); + return $this->attr('position_id'); } public function getTotalPriceNet(): float { - return $this->get('total_price_net'); + return $this->attr('total_price_net'); } public function getTotalPriceGross(): float { - return $this->get('total_price_gross'); + return $this->attr('total_price_gross'); } public function getTotalVat(): float { - return $this->get('total_vat'); + return $this->attr('total_vat'); } public function getSerialNumberId(): string { - return $this->get('serial_number_id'); + return $this->attr('serial_number_id'); } public function getSerialNumber(): string { - return $this->get('serial_number'); + return $this->attr('serial_number'); } public function setBookingAccount(?string $booking_account): void @@ -195,7 +195,7 @@ public function setBookingAccount(?string $booking_account): void public function getBookingAccount(): ?string { - return $this->get('booking_account'); + return $this->attr('booking_account'); } public function setExportCost1(?string $export_cost_1): void @@ -205,7 +205,7 @@ public function setExportCost1(?string $export_cost_1): void public function getExportCost1(): ?string { - return $this->get('export_cost_1'); + return $this->attr('export_cost_1'); } public function setExportCost2(?string $export_cost_2): void @@ -215,7 +215,7 @@ public function setExportCost2(?string $export_cost_2): void public function getExportCost2(): ?string { - return $this->get('export_cost_2'); + return $this->attr('export_cost_2'); } public function setCostPriceNet(?float $cost_price_net): void @@ -225,22 +225,22 @@ public function setCostPriceNet(?float $cost_price_net): void public function getCostPriceNet(): ?float { - return $this->get('cost_price_net'); + return $this->attr('cost_price_net'); } public function getCostPriceTotal(): float { - return $this->get('cost_price_total'); + return $this->attr('cost_price_total'); } public function getCostPriceCharge(): float { - return $this->get('cost_price_charge'); + return $this->attr('cost_price_charge'); } public function getCostPriceChargeType(): string { - return $this->get('cost_price_charge_type'); + return $this->attr('cost_price_charge_type'); } public function setItemType(string $itemType): void @@ -250,11 +250,11 @@ public function setItemType(string $itemType): void public function getItemType(): string { - return $this->get('itemType'); + return $this->attr('itemType'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } } diff --git a/src/Models/DocumentRecurring.php b/src/Models/DocumentRecurring.php index 3735c97..6d8babf 100644 --- a/src/Models/DocumentRecurring.php +++ b/src/Models/DocumentRecurring.php @@ -19,14 +19,14 @@ public function __construct(array $data = []) /** * Must be in the future. */ - public function setNextDate(string $next_date): void + public function setNextDate(\DateTimeImmutable $next_date): void { $this->data['next_date'] = $next_date; } - public function getNextDate(): string + public function getNextDate(): \DateTimeImmutable { - return $this->get('next_date'); + return $this->attrDate('next_date'); } public function setFrequency(string $frequency): void @@ -36,7 +36,7 @@ public function setFrequency(string $frequency): void public function getFrequency(): string { - return $this->get('frequency'); + return $this->attr('frequency'); } public function setFrequencySpecial(?string $frequency_special): void @@ -46,7 +46,7 @@ public function setFrequencySpecial(?string $frequency_special): void public function getFrequencySpecial(): ?string { - return $this->get('frequency_special'); + return $this->attr('frequency_special'); } public function setInterval(int $interval): void @@ -56,7 +56,7 @@ public function setInterval(int $interval): void public function getInterval(): int { - return $this->get('interval'); + return $this->attr('interval'); } /** @@ -69,7 +69,7 @@ public function setEndDateOrCount(?string $end_date_or_count): void public function getEndDateOrCount(): ?string { - return $this->get('end_date_or_count'); + return $this->attr('end_date_or_count'); } public function setStatus(string $status): void @@ -79,7 +79,7 @@ public function setStatus(string $status): void public function getStatus(): string { - return $this->get('status'); + return $this->attr('status'); } public function setAsDraft(bool $as_draft): void @@ -89,7 +89,7 @@ public function setAsDraft(bool $as_draft): void public function getAsDraft(): bool { - return $this->get('as_draft'); + return $this->attr('as_draft'); } public function setIsNotify(bool $is_notify): void @@ -99,7 +99,7 @@ public function setIsNotify(bool $is_notify): void public function getIsNotify(): bool { - return $this->get('is_notify'); + return $this->attr('is_notify'); } public function setSendAs(?string $send_as): void @@ -109,7 +109,7 @@ public function setSendAs(?string $send_as): void public function getSendAs(): ?string { - return $this->get('send_as'); + return $this->attr('send_as'); } public function setIsSign(bool $is_sign): void @@ -119,7 +119,7 @@ public function setIsSign(bool $is_sign): void public function getIsSign(): bool { - return $this->get('is_sign'); + return $this->attr('is_sign'); } public function setIsPaid(bool $is_paid): void @@ -129,7 +129,7 @@ public function setIsPaid(bool $is_paid): void public function getIsPaid(): bool { - return $this->get('is_paid'); + return $this->attr('is_paid'); } /** @@ -142,7 +142,7 @@ public function setPaidDateOption(string $paid_date_option): void public function getPaidDateOption(): string { - return $this->get('paid_date_option'); + return $this->attr('paid_date_option'); } public function setIsSepa(bool $is_sepa): void @@ -152,7 +152,7 @@ public function setIsSepa(bool $is_sepa): void public function getIsSepa(): bool { - return $this->get('is_sepa'); + return $this->attr('is_sepa'); } public function setSepaLocalInstrument(?string $sepa_local_instrument): void @@ -162,7 +162,7 @@ public function setSepaLocalInstrument(?string $sepa_local_instrument): void public function getSepaLocalInstrument(): ?string { - return $this->get('sepa_local_instrument'); + return $this->attr('sepa_local_instrument'); } public function setSepaSequenceType(?string $sepa_sequence_type): void @@ -172,7 +172,7 @@ public function setSepaSequenceType(?string $sepa_sequence_type): void public function getSepaSequenceType(): ?string { - return $this->get('sepa_sequence_type'); + return $this->attr('sepa_sequence_type'); } public function setSepaReference(?string $sepa_reference): void @@ -182,7 +182,7 @@ public function setSepaReference(?string $sepa_reference): void public function getSepaReference(): ?string { - return $this->get('sepa_reference'); + return $this->attr('sepa_reference'); } public function setSepaRemittanceInformation(?string $sepa_remittance_information): void @@ -192,7 +192,7 @@ public function setSepaRemittanceInformation(?string $sepa_remittance_informatio public function getSepaRemittanceInformation(): ?string { - return $this->get('sepa_remittance_information'); + return $this->attr('sepa_remittance_information'); } /** @@ -205,6 +205,6 @@ public function setTargetType(string $target_type): void public function getTargetType(): string { - return $this->get('target_type'); + return $this->attr('target_type'); } } diff --git a/src/Models/Login.php b/src/Models/Login.php index c0d76c7..b83a833 100644 --- a/src/Models/Login.php +++ b/src/Models/Login.php @@ -18,7 +18,7 @@ public function __construct(array $data = []) public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setFirstName(string $first_name): void @@ -28,7 +28,7 @@ public function setFirstName(string $first_name): void public function getFirstName(): string { - return $this->get('first_name'); + return $this->attr('first_name'); } public function setLastName(string $last_name): void @@ -38,12 +38,12 @@ public function setLastName(string $last_name): void public function getLastName(): string { - return $this->get('last_name'); + return $this->attr('last_name'); } public function getDisplayName(): string { - return $this->get('display_name'); + return $this->attr('display_name'); } public function setPhone(string $phone): void @@ -53,7 +53,7 @@ public function setPhone(string $phone): void public function getPhone(): string { - return $this->get('phone'); + return $this->attr('phone'); } public function setEmail(string $email): void @@ -63,7 +63,7 @@ public function setEmail(string $email): void public function getEmail(): string { - return $this->get('email'); + return $this->attr('email'); } public function setEmailSignature(string $email_signature): void @@ -73,7 +73,7 @@ public function setEmailSignature(string $email_signature): void public function getEmailSignature(): string { - return $this->get('email_signature'); + return $this->attr('email_signature'); } public function setLoginType(string $login_type): void @@ -83,7 +83,7 @@ public function setLoginType(string $login_type): void public function getLoginType(): string { - return $this->get('login_type'); + return $this->attr('login_type'); } public function setLocale(string $locale): void @@ -93,7 +93,7 @@ public function setLocale(string $locale): void public function getLocale(): string { - return $this->get('locale'); + return $this->attr('locale'); } public function setTimeZone(string $time_zone): void @@ -103,7 +103,7 @@ public function setTimeZone(string $time_zone): void public function getTimeZone(): string { - return $this->get('time_zone'); + return $this->attr('time_zone'); } public function setSecurity(LoginSecurity $security): void @@ -113,6 +113,6 @@ public function setSecurity(LoginSecurity $security): void public function getSecurity(): LoginSecurity { - return $this->getInstance('security', \easybill\SDK\Models\LoginSecurity::class); + return $this->attrInstance('security', \easybill\SDK\Models\LoginSecurity::class); } } diff --git a/src/Models/LoginSecurity.php b/src/Models/LoginSecurity.php index 1fcfc1b..6880b2c 100644 --- a/src/Models/LoginSecurity.php +++ b/src/Models/LoginSecurity.php @@ -19,16 +19,16 @@ public function __construct(array $data = []) public function getTwoFactorEnabled(): bool { - return $this->get('two_factor_enabled'); + return $this->attr('two_factor_enabled'); } public function getRecoveryCodesEnabled(): bool { - return $this->get('recovery_codes_enabled'); + return $this->attr('recovery_codes_enabled'); } public function getNotifyOnNewLoginEnabled(): bool { - return $this->get('notify_on_new_login_enabled'); + return $this->attr('notify_on_new_login_enabled'); } } diff --git a/src/Models/PDFTemplate.php b/src/Models/PDFTemplate.php index 7c6c28a..46cf18e 100644 --- a/src/Models/PDFTemplate.php +++ b/src/Models/PDFTemplate.php @@ -23,7 +23,7 @@ public function setId(string $id): void public function getId(): string { - return $this->get('id'); + return $this->attr('id'); } public function setName(string $name): void @@ -33,7 +33,7 @@ public function setName(string $name): void public function getName(): string { - return $this->get('name'); + return $this->attr('name'); } public function setPdfTemplate(string $pdf_template): void @@ -43,7 +43,7 @@ public function setPdfTemplate(string $pdf_template): void public function getPdfTemplate(): string { - return $this->get('pdf_template'); + return $this->attr('pdf_template'); } public function setDocumentType(string $document_type): void @@ -53,6 +53,6 @@ public function setDocumentType(string $document_type): void public function getDocumentType(): string { - return $this->get('document_type'); + return $this->attr('document_type'); } } diff --git a/src/Models/Position.php b/src/Models/Position.php index db33833..86caac3 100644 --- a/src/Models/Position.php +++ b/src/Models/Position.php @@ -18,7 +18,7 @@ public function __construct(array $data = []) public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setType(string $type): void @@ -28,7 +28,7 @@ public function setType(string $type): void public function getType(): string { - return $this->get('type'); + return $this->attr('type'); } public function setNumber(string $number): void @@ -38,7 +38,7 @@ public function setNumber(string $number): void public function getNumber(): string { - return $this->get('number'); + return $this->attr('number'); } /** @@ -51,7 +51,7 @@ public function setDescription(string $description): void public function getDescription(): string { - return $this->get('description'); + return $this->attr('description'); } /** @@ -64,7 +64,7 @@ public function setDocumentNote(string $document_note): void public function getDocumentNote(): string { - return $this->get('document_note'); + return $this->attr('document_note'); } /** @@ -77,7 +77,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->get('note'); + return $this->attr('note'); } public function setUnit(?string $unit): void @@ -87,7 +87,7 @@ public function setUnit(?string $unit): void public function getUnit(): ?string { - return $this->get('unit'); + return $this->attr('unit'); } /** @@ -100,7 +100,7 @@ public function setExportIdentifier(?string $export_identifier): void public function getExportIdentifier(): ?string { - return $this->get('export_identifier'); + return $this->attr('export_identifier'); } public function setExportIdentifierExtended(PositionExportIdentifierExtended $export_identifier_extended): void @@ -110,12 +110,12 @@ public function setExportIdentifierExtended(PositionExportIdentifierExtended $ex public function getExportIdentifierExtended(): PositionExportIdentifierExtended { - return $this->getInstance('export_identifier_extended', \easybill\SDK\Models\PositionExportIdentifierExtended::class); + return $this->attrInstance('export_identifier_extended', \easybill\SDK\Models\PositionExportIdentifierExtended::class); } public function getLoginId(): int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setPriceType(string $price_type): void @@ -125,7 +125,7 @@ public function setPriceType(string $price_type): void public function getPriceType(): string { - return $this->get('price_type'); + return $this->attr('price_type'); } public function setVatPercent(float $vat_percent): void @@ -135,7 +135,7 @@ public function setVatPercent(float $vat_percent): void public function getVatPercent(): float { - return $this->get('vat_percent'); + return $this->attr('vat_percent'); } /** @@ -148,7 +148,7 @@ public function setSalePrice(float $sale_price): void public function getSalePrice(): float { - return $this->get('sale_price'); + return $this->attr('sale_price'); } /** @@ -161,7 +161,7 @@ public function setSalePrice2(?float $sale_price2): void public function getSalePrice2(): ?float { - return $this->get('sale_price2'); + return $this->attr('sale_price2'); } /** @@ -174,7 +174,7 @@ public function setSalePrice3(?float $sale_price3): void public function getSalePrice3(): ?float { - return $this->get('sale_price3'); + return $this->attr('sale_price3'); } /** @@ -187,7 +187,7 @@ public function setSalePrice4(?float $sale_price4): void public function getSalePrice4(): ?float { - return $this->get('sale_price4'); + return $this->attr('sale_price4'); } /** @@ -200,7 +200,7 @@ public function setSalePrice5(?float $sale_price5): void public function getSalePrice5(): ?float { - return $this->get('sale_price5'); + return $this->attr('sale_price5'); } /** @@ -213,7 +213,7 @@ public function setSalePrice6(?float $sale_price6): void public function getSalePrice6(): ?float { - return $this->get('sale_price6'); + return $this->attr('sale_price6'); } /** @@ -226,7 +226,7 @@ public function setSalePrice7(?float $sale_price7): void public function getSalePrice7(): ?float { - return $this->get('sale_price7'); + return $this->attr('sale_price7'); } /** @@ -239,7 +239,7 @@ public function setSalePrice8(?float $sale_price8): void public function getSalePrice8(): ?float { - return $this->get('sale_price8'); + return $this->attr('sale_price8'); } /** @@ -252,7 +252,7 @@ public function setSalePrice9(?float $sale_price9): void public function getSalePrice9(): ?float { - return $this->get('sale_price9'); + return $this->attr('sale_price9'); } /** @@ -265,7 +265,7 @@ public function setSalePrice10(?float $sale_price10): void public function getSalePrice10(): ?float { - return $this->get('sale_price10'); + return $this->attr('sale_price10'); } /** @@ -278,7 +278,7 @@ public function setCostPrice(?float $cost_price): void public function getCostPrice(): ?float { - return $this->get('cost_price'); + return $this->attr('cost_price'); } public function setExportCost1(?string $export_cost1): void @@ -288,7 +288,7 @@ public function setExportCost1(?string $export_cost1): void public function getExportCost1(): ?string { - return $this->get('export_cost1'); + return $this->attr('export_cost1'); } public function setExportCost2(?string $export_cost2): void @@ -298,7 +298,7 @@ public function setExportCost2(?string $export_cost2): void public function getExportCost2(): ?string { - return $this->get('export_cost2'); + return $this->attr('export_cost2'); } public function setGroupId(?int $group_id): void @@ -308,7 +308,7 @@ public function setGroupId(?int $group_id): void public function getGroupId(): ?int { - return $this->get('group_id'); + return $this->attr('group_id'); } /** @@ -321,12 +321,12 @@ public function setStock(string $stock): void public function getStock(): string { - return $this->get('stock'); + return $this->attr('stock'); } public function getStockCount(): int { - return $this->get('stock_count'); + return $this->attr('stock_count'); } /** @@ -339,7 +339,7 @@ public function setStockLimitNotify(bool $stock_limit_notify): void public function getStockLimitNotify(): bool { - return $this->get('stock_limit_notify'); + return $this->attr('stock_limit_notify'); } /** @@ -352,7 +352,7 @@ public function setStockLimitNotifyFrequency(string $stock_limit_notify_frequenc public function getStockLimitNotifyFrequency(): string { - return $this->get('stock_limit_notify_frequency'); + return $this->attr('stock_limit_notify_frequency'); } public function setStockLimit(int $stock_limit): void @@ -362,7 +362,7 @@ public function setStockLimit(int $stock_limit): void public function getStockLimit(): int { - return $this->get('stock_limit'); + return $this->attr('stock_limit'); } /** @@ -375,6 +375,6 @@ public function setQuantity(?float $quantity): void public function getQuantity(): ?float { - return $this->get('quantity'); + return $this->attr('quantity'); } } diff --git a/src/Models/PositionExportIdentifierExtended.php b/src/Models/PositionExportIdentifierExtended.php index acea148..35504e0 100644 --- a/src/Models/PositionExportIdentifierExtended.php +++ b/src/Models/PositionExportIdentifierExtended.php @@ -26,7 +26,7 @@ public function setNULL(?string $NULL): void public function getNULL(): ?string { - return $this->get('NULL'); + return $this->attr('NULL'); } /** @@ -39,7 +39,7 @@ public function setNStb(?string $nStb): void public function getNStb(): ?string { - return $this->get('nStb'); + return $this->attr('nStb'); } /** @@ -52,7 +52,7 @@ public function setNStbUstID(?string $nStbUstID): void public function getNStbUstID(): ?string { - return $this->get('nStbUstID'); + return $this->attr('nStbUstID'); } /** @@ -65,7 +65,7 @@ public function setNStbNoneUstID(?string $nStbNoneUstID): void public function getNStbNoneUstID(): ?string { - return $this->get('nStbNoneUstID'); + return $this->attr('nStbNoneUstID'); } /** @@ -78,7 +78,7 @@ public function setNStbIm(?string $nStbIm): void public function getNStbIm(): ?string { - return $this->get('nStbIm'); + return $this->attr('nStbIm'); } /** @@ -91,7 +91,7 @@ public function setRevc(?string $revc): void public function getRevc(): ?string { - return $this->get('revc'); + return $this->attr('revc'); } /** @@ -104,7 +104,7 @@ public function setIG(?string $IG): void public function getIG(): ?string { - return $this->get('IG'); + return $this->attr('IG'); } /** @@ -117,7 +117,7 @@ public function setAL(?string $AL): void public function getAL(): ?string { - return $this->get('AL'); + return $this->attr('AL'); } /** @@ -130,7 +130,7 @@ public function setSStfr(?string $sStfr): void public function getSStfr(): ?string { - return $this->get('sStfr'); + return $this->attr('sStfr'); } /** @@ -143,6 +143,6 @@ public function setSmallBusiness(?string $smallBusiness): void public function getSmallBusiness(): ?string { - return $this->get('smallBusiness'); + return $this->attr('smallBusiness'); } } diff --git a/src/Models/PositionGroup.php b/src/Models/PositionGroup.php index a00a6e9..04bb065 100644 --- a/src/Models/PositionGroup.php +++ b/src/Models/PositionGroup.php @@ -23,12 +23,12 @@ public function setDescription(?string $description): void public function getDescription(): ?string { - return $this->get('description'); + return $this->attr('description'); } public function getLoginId(): int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setName(string $name): void @@ -38,7 +38,7 @@ public function setName(string $name): void public function getName(): string { - return $this->get('name'); + return $this->attr('name'); } public function setNumber(string $number): void @@ -48,16 +48,16 @@ public function setNumber(string $number): void public function getNumber(): string { - return $this->get('number'); + return $this->attr('number'); } public function getDisplayName(): string { - return $this->get('display_name'); + return $this->attr('display_name'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } } diff --git a/src/Models/PostBox.php b/src/Models/PostBox.php index 04883bf..003dc74 100644 --- a/src/Models/PostBox.php +++ b/src/Models/PostBox.php @@ -18,7 +18,7 @@ public function __construct(array $data = []) public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setDocumentId(int $document_id): void @@ -28,7 +28,7 @@ public function setDocumentId(int $document_id): void public function getDocumentId(): int { - return $this->get('document_id'); + return $this->attr('document_id'); } public function setTo(string $to): void @@ -38,7 +38,7 @@ public function setTo(string $to): void public function getTo(): string { - return $this->get('to'); + return $this->attr('to'); } public function setCc(string $cc): void @@ -48,7 +48,7 @@ public function setCc(string $cc): void public function getCc(): string { - return $this->get('cc'); + return $this->attr('cc'); } public function setFrom(string $from): void @@ -58,7 +58,7 @@ public function setFrom(string $from): void public function getFrom(): string { - return $this->get('from'); + return $this->attr('from'); } public function setSubject(string $subject): void @@ -68,7 +68,7 @@ public function setSubject(string $subject): void public function getSubject(): string { - return $this->get('subject'); + return $this->attr('subject'); } public function setMessage(string $message): void @@ -78,37 +78,37 @@ public function setMessage(string $message): void public function getMessage(): string { - return $this->get('message'); + return $this->attr('message'); } - public function setDate(string $date): void + public function setDate(\DateTimeImmutable $date): void { $this->data['date'] = $date; } - public function getDate(): string + public function getDate(): \DateTimeImmutable { - return $this->get('date'); + return $this->attrDate('date'); } - public function setCreatedAt(string $created_at): void + public function setCreatedAt(\DateTimeImmutable $created_at): void { $this->data['created_at'] = $created_at; } - public function getCreatedAt(): string + public function getCreatedAt(): \DateTimeImmutable { - return $this->get('created_at'); + return $this->attr('created_at'); } - public function setProcessedAt(string $processed_at): void + public function setProcessedAt(\DateTimeImmutable $processed_at): void { $this->data['processed_at'] = $processed_at; } - public function getProcessedAt(): string + public function getProcessedAt(): \DateTimeImmutable { - return $this->get('processed_at'); + return $this->attr('processed_at'); } public function setSendBySelf(bool $send_by_self): void @@ -118,7 +118,7 @@ public function setSendBySelf(bool $send_by_self): void public function getSendBySelf(): bool { - return $this->get('send_by_self'); + return $this->attr('send_by_self'); } public function setSendWithAttachment(bool $send_with_attachment): void @@ -128,7 +128,7 @@ public function setSendWithAttachment(bool $send_with_attachment): void public function getSendWithAttachment(): bool { - return $this->get('send_with_attachment'); + return $this->attr('send_with_attachment'); } public function setType(string $type): void @@ -138,7 +138,7 @@ public function setType(string $type): void public function getType(): string { - return $this->get('type'); + return $this->attr('type'); } public function setStatus(string $status): void @@ -148,7 +148,7 @@ public function setStatus(string $status): void public function getStatus(): string { - return $this->get('status'); + return $this->attr('status'); } public function setStatusMsg(string $status_msg): void @@ -158,12 +158,12 @@ public function setStatusMsg(string $status_msg): void public function getStatusMsg(): string { - return $this->get('status_msg'); + return $this->attr('status_msg'); } public function getLoginId(): int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setDocumentFileType(?string $document_file_type): void @@ -173,7 +173,7 @@ public function setDocumentFileType(?string $document_file_type): void public function getDocumentFileType(): ?string { - return $this->get('document_file_type'); + return $this->attr('document_file_type'); } /** @@ -194,11 +194,11 @@ public function setPostSendType(string $post_send_type): void public function getPostSendType(): string { - return $this->get('post_send_type'); + return $this->attr('post_send_type'); } public function getTrackingIdentifier(): string { - return $this->get('tracking_identifier'); + return $this->attr('tracking_identifier'); } } diff --git a/src/Models/PostBoxRequest.php b/src/Models/PostBoxRequest.php index ce518bc..7aa1454 100644 --- a/src/Models/PostBoxRequest.php +++ b/src/Models/PostBoxRequest.php @@ -23,7 +23,7 @@ public function setTo(string $to): void public function getTo(): string { - return $this->get('to'); + return $this->attr('to'); } public function setCc(string $cc): void @@ -33,7 +33,7 @@ public function setCc(string $cc): void public function getCc(): string { - return $this->get('cc'); + return $this->attr('cc'); } public function setFrom(string $from): void @@ -43,7 +43,7 @@ public function setFrom(string $from): void public function getFrom(): string { - return $this->get('from'); + return $this->attr('from'); } public function setSubject(string $subject): void @@ -53,7 +53,7 @@ public function setSubject(string $subject): void public function getSubject(): string { - return $this->get('subject'); + return $this->attr('subject'); } public function setMessage(string $message): void @@ -63,17 +63,17 @@ public function setMessage(string $message): void public function getMessage(): string { - return $this->get('message'); + return $this->attr('message'); } - public function setDate(string $date): void + public function setDate(\DateTimeImmutable $date): void { $this->data['date'] = $date; } - public function getDate(): string + public function getDate(): \DateTimeImmutable { - return $this->get('date'); + return $this->attrDate('date'); } /** @@ -86,7 +86,7 @@ public function setDocumentFileType(?string $document_file_type): void public function getDocumentFileType(): ?string { - return $this->get('document_file_type'); + return $this->attr('document_file_type'); } /** @@ -107,6 +107,6 @@ public function setPostSendType(string $post_send_type): void public function getPostSendType(): string { - return $this->get('post_send_type'); + return $this->attr('post_send_type'); } } diff --git a/src/Models/Project.php b/src/Models/Project.php index 1ad5272..1cec89e 100644 --- a/src/Models/Project.php +++ b/src/Models/Project.php @@ -26,7 +26,7 @@ public function setBudgetAmount(int $budget_amount): void public function getBudgetAmount(): int { - return $this->get('budget_amount'); + return $this->attr('budget_amount'); } /** @@ -39,7 +39,7 @@ public function setBudgetTime(int $budget_time): void public function getBudgetTime(): int { - return $this->get('budget_time'); + return $this->attr('budget_time'); } public function setCustomerId(?int $customer_id): void @@ -49,7 +49,7 @@ public function setCustomerId(?int $customer_id): void public function getCustomerId(): ?int { - return $this->get('customer_id'); + return $this->attr('customer_id'); } /** @@ -62,12 +62,12 @@ public function setHourlyRate(float $hourly_rate): void public function getHourlyRate(): float { - return $this->get('hourly_rate'); + return $this->attr('hourly_rate'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } /** @@ -80,7 +80,7 @@ public function setLoginId(?int $login_id): void public function getLoginId(): ?int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setName(string $name): void @@ -90,7 +90,7 @@ public function setName(string $name): void public function getName(): string { - return $this->get('name'); + return $this->attr('name'); } public function setNote(?string $note): void @@ -100,7 +100,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->get('note'); + return $this->attr('note'); } public function setStatus(string $status): void @@ -110,17 +110,17 @@ public function setStatus(string $status): void public function getStatus(): string { - return $this->get('status'); + return $this->attr('status'); } - public function setDueAt(?string $due_at): void + public function setDueAt(?\DateTimeImmutable $due_at): void { $this->data['due_at'] = $due_at; } - public function getDueAt(): ?string + public function getDueAt(): ?\DateTimeImmutable { - return $this->get('due_at'); + return $this->attrDate('due_at'); } public function setBudgetNotifyFrequency(string $budget_notify_frequency): void @@ -130,16 +130,16 @@ public function setBudgetNotifyFrequency(string $budget_notify_frequency): void public function getBudgetNotifyFrequency(): string { - return $this->get('budget_notify_frequency'); + return $this->attr('budget_notify_frequency'); } public function getConsumedTime(): int { - return $this->get('consumed_time'); + return $this->attr('consumed_time'); } public function getConsumedAmount(): int { - return $this->get('consumed_amount'); + return $this->attr('consumed_amount'); } } diff --git a/src/Models/SEPAPayment.php b/src/Models/SEPAPayment.php index aca1803..bcf03a5 100644 --- a/src/Models/SEPAPayment.php +++ b/src/Models/SEPAPayment.php @@ -26,12 +26,12 @@ public function setAmount(int $amount): void public function getAmount(): int { - return $this->get('amount'); + return $this->attr('amount'); } - public function getCreatedAt(): string + public function getCreatedAt(): \DateTimeImmutable { - return $this->get('created_at'); + return $this->attr('created_at'); } /** @@ -44,7 +44,7 @@ public function setCreditorBic(?string $creditor_bic): void public function getCreditorBic(): ?string { - return $this->get('creditor_bic'); + return $this->attr('creditor_bic'); } /** @@ -57,7 +57,7 @@ public function setCreditorIban(?string $creditor_iban): void public function getCreditorIban(): ?string { - return $this->get('creditor_iban'); + return $this->attr('creditor_iban'); } /** @@ -70,7 +70,7 @@ public function setCreditorName(?string $creditor_name): void public function getCreditorName(): ?string { - return $this->get('creditor_name'); + return $this->attr('creditor_name'); } /** @@ -83,7 +83,7 @@ public function setDebitorBic(?string $debitor_bic): void public function getDebitorBic(): ?string { - return $this->get('debitor_bic'); + return $this->attr('debitor_bic'); } /** @@ -96,7 +96,7 @@ public function setDebitorIban(?string $debitor_iban): void public function getDebitorIban(): ?string { - return $this->get('debitor_iban'); + return $this->attr('debitor_iban'); } /** @@ -109,7 +109,7 @@ public function setDebitorName(?string $debitor_name): void public function getDebitorName(): ?string { - return $this->get('debitor_name'); + return $this->attr('debitor_name'); } /** @@ -122,7 +122,7 @@ public function setDebitorAddressLine1(string $debitor_address_line_1): void public function getDebitorAddressLine1(): string { - return $this->get('debitor_address_line_1'); + return $this->attr('debitor_address_line_1'); } /** @@ -135,7 +135,7 @@ public function setDebitorAddressLine2(string $debitor_address_line2): void public function getDebitorAddressLine2(): string { - return $this->get('debitor_address_line2'); + return $this->attr('debitor_address_line2'); } /** @@ -148,7 +148,7 @@ public function setDebitorCountry(string $debitor_country): void public function getDebitorCountry(): string { - return $this->get('debitor_country'); + return $this->attr('debitor_country'); } public function setDocumentId(int $document_id): void @@ -158,30 +158,30 @@ public function setDocumentId(int $document_id): void public function getDocumentId(): int { - return $this->get('document_id'); + return $this->attr('document_id'); } /** * If a date is set, this record is marked as exported. */ - public function setExportAt(?string $export_at): void + public function setExportAt(?\DateTimeImmutable $export_at): void { $this->data['export_at'] = $export_at; } - public function getExportAt(): ?string + public function getExportAt(): ?\DateTimeImmutable { - return $this->get('export_at'); + return $this->attr('export_at'); } public function getExportError(): string { - return $this->get('export_error'); + return $this->attr('export_error'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } /** @@ -194,17 +194,17 @@ public function setLocalInstrument(string $local_instrument): void public function getLocalInstrument(): string { - return $this->get('local_instrument'); + return $this->attr('local_instrument'); } - public function setMandateDateOfSignature(string $mandate_date_of_signature): void + public function setMandateDateOfSignature(\DateTimeImmutable $mandate_date_of_signature): void { $this->data['mandate_date_of_signature'] = $mandate_date_of_signature; } - public function getMandateDateOfSignature(): string + public function getMandateDateOfSignature(): \DateTimeImmutable { - return $this->get('mandate_date_of_signature'); + return $this->attrDate('mandate_date_of_signature'); } public function setMandateId(string $mandate_id): void @@ -214,7 +214,7 @@ public function setMandateId(string $mandate_id): void public function getMandateId(): string { - return $this->get('mandate_id'); + return $this->attr('mandate_id'); } public function setReference(string $reference): void @@ -224,7 +224,7 @@ public function setReference(string $reference): void public function getReference(): string { - return $this->get('reference'); + return $this->attr('reference'); } public function setRemittanceInformation(?string $remittance_information): void @@ -234,20 +234,20 @@ public function setRemittanceInformation(?string $remittance_information): void public function getRemittanceInformation(): ?string { - return $this->get('remittance_information'); + return $this->attr('remittance_information'); } /** * Booking date. */ - public function setRequestedAt(string $requested_at): void + public function setRequestedAt(\DateTimeImmutable $requested_at): void { $this->data['requested_at'] = $requested_at; } - public function getRequestedAt(): string + public function getRequestedAt(): \DateTimeImmutable { - return $this->get('requested_at'); + return $this->attrDate('requested_at'); } /** @@ -260,12 +260,12 @@ public function setSequenceType(string $sequence_type): void public function getSequenceType(): string { - return $this->get('sequence_type'); + return $this->attr('sequence_type'); } public function getUpdatedAt(): string { - return $this->get('updated_at'); + return $this->attr('updated_at'); } public function setType(string $type): void @@ -275,6 +275,6 @@ public function setType(string $type): void public function getType(): string { - return $this->get('type'); + return $this->attr('type'); } } diff --git a/src/Models/SerialNumber.php b/src/Models/SerialNumber.php index 9cea8e6..77cd7c9 100644 --- a/src/Models/SerialNumber.php +++ b/src/Models/SerialNumber.php @@ -18,7 +18,7 @@ public function __construct(array $data = []) public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setSerialNumber(string $serial_number): void @@ -28,7 +28,7 @@ public function setSerialNumber(string $serial_number): void public function getSerialNumber(): string { - return $this->get('serial_number'); + return $this->attr('serial_number'); } public function setPositionId(int $position_id): void @@ -38,26 +38,26 @@ public function setPositionId(int $position_id): void public function getPositionId(): int { - return $this->get('position_id'); + return $this->attr('position_id'); } public function getDocumentId(): ?int { - return $this->get('document_id'); + return $this->attr('document_id'); } public function getDocumentPositionId(): ?int { - return $this->get('document_position_id'); + return $this->attr('document_position_id'); } public function getUsedAt(): ?string { - return $this->get('used_at'); + return $this->attr('used_at'); } public function getCreatedAt(): string { - return $this->get('created_at'); + return $this->attr('created_at'); } } diff --git a/src/Models/ServiceDate.php b/src/Models/ServiceDate.php index 09bfe21..d532354 100644 --- a/src/Models/ServiceDate.php +++ b/src/Models/ServiceDate.php @@ -26,37 +26,37 @@ public function setType(string $type): void public function getType(): string { - return $this->get('type'); + return $this->attr('type'); } - public function setDate(?string $date): void + public function setDate(?\DateTimeImmutable $date): void { $this->data['date'] = $date; } - public function getDate(): ?string + public function getDate(): ?\DateTimeImmutable { - return $this->get('date'); + return $this->attrDate('date'); } - public function setDateFrom(?string $date_from): void + public function setDateFrom(?\DateTimeImmutable $date_from): void { $this->data['date_from'] = $date_from; } - public function getDateFrom(): ?string + public function getDateFrom(): ?\DateTimeImmutable { - return $this->get('date_from'); + return $this->attrDate('date_from'); } - public function setDateTo(?string $date_to): void + public function setDateTo(?\DateTimeImmutable $date_to): void { $this->data['date_to'] = $date_to; } - public function getDateTo(): ?string + public function getDateTo(): ?\DateTimeImmutable { - return $this->get('date_to'); + return $this->attrDate('date_to'); } public function setText(?string $text): void @@ -66,6 +66,6 @@ public function setText(?string $text): void public function getText(): ?string { - return $this->get('text'); + return $this->attr('text'); } } diff --git a/src/Models/Stock.php b/src/Models/Stock.php index 5b8652f..ae864e7 100644 --- a/src/Models/Stock.php +++ b/src/Models/Stock.php @@ -18,7 +18,7 @@ public function __construct(array $data = []) public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setNote(string $note): void @@ -28,7 +28,7 @@ public function setNote(string $note): void public function getNote(): string { - return $this->get('note'); + return $this->attr('note'); } public function setStockCount(int $stock_count): void @@ -38,7 +38,7 @@ public function setStockCount(int $stock_count): void public function getStockCount(): int { - return $this->get('stock_count'); + return $this->attr('stock_count'); } public function setPositionId(int $position_id): void @@ -48,17 +48,17 @@ public function setPositionId(int $position_id): void public function getPositionId(): int { - return $this->get('position_id'); + return $this->attr('position_id'); } public function getDocumentId(): ?int { - return $this->get('document_id'); + return $this->attr('document_id'); } public function getDocumentPositionId(): ?int { - return $this->get('document_position_id'); + return $this->attr('document_position_id'); } public function setStoredAt(?string $stored_at): void @@ -68,16 +68,16 @@ public function setStoredAt(?string $stored_at): void public function getStoredAt(): ?string { - return $this->get('stored_at'); + return $this->attr('stored_at'); } public function getCreatedAt(): string { - return $this->get('created_at'); + return $this->attr('created_at'); } public function getUpdatedAt(): string { - return $this->get('updated_at'); + return $this->attr('updated_at'); } } diff --git a/src/Models/Task.php b/src/Models/Task.php index 4843963..b3a726b 100644 --- a/src/Models/Task.php +++ b/src/Models/Task.php @@ -23,7 +23,7 @@ public function setCategory(?string $category): void public function getCategory(): ?string { - return $this->get('category'); + return $this->attr('category'); } /** @@ -36,12 +36,12 @@ public function setCategoryCustom(?string $category_custom): void public function getCategoryCustom(): ?string { - return $this->get('category_custom'); + return $this->attr('category_custom'); } - public function getCreatedAt(): string + public function getCreatedAt(): \DateTimeImmutable { - return $this->get('created_at'); + return $this->attr('created_at'); } public function setCustomerId(?int $customer_id): void @@ -51,7 +51,7 @@ public function setCustomerId(?int $customer_id): void public function getCustomerId(): ?int { - return $this->get('customer_id'); + return $this->attr('customer_id'); } public function setDescription(?string $description): void @@ -61,7 +61,7 @@ public function setDescription(?string $description): void public function getDescription(): ?string { - return $this->get('description'); + return $this->attr('description'); } public function setDocumentId(?int $document_id): void @@ -71,30 +71,30 @@ public function setDocumentId(?int $document_id): void public function getDocumentId(): ?int { - return $this->get('document_id'); + return $this->attr('document_id'); } /** * The deadline. */ - public function setEndAt(?string $end_at): void + public function setEndAt(?\DateTimeImmutable $end_at): void { $this->data['end_at'] = $end_at; } - public function getEndAt(): ?string + public function getEndAt(): ?\DateTimeImmutable { - return $this->get('end_at'); + return $this->attr('end_at'); } - public function getFinishAt(): ?string + public function getFinishAt(): ?\DateTimeImmutable { - return $this->get('finish_at'); + return $this->attr('finish_at'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } /** @@ -107,7 +107,7 @@ public function setLoginId(?int $login_id): void public function getLoginId(): ?int { - return $this->get('login_id'); + return $this->attr('login_id'); } public function setName(string $name): void @@ -117,7 +117,7 @@ public function setName(string $name): void public function getName(): string { - return $this->get('name'); + return $this->attr('name'); } public function setPositionId(?int $position_id): void @@ -127,7 +127,7 @@ public function setPositionId(?int $position_id): void public function getPositionId(): ?int { - return $this->get('position_id'); + return $this->attr('position_id'); } public function setPriority(string $priority): void @@ -137,7 +137,7 @@ public function setPriority(string $priority): void public function getPriority(): string { - return $this->get('priority'); + return $this->attr('priority'); } public function setProjectId(?int $project_id): void @@ -147,17 +147,17 @@ public function setProjectId(?int $project_id): void public function getProjectId(): ?int { - return $this->get('project_id'); + return $this->attr('project_id'); } - public function setStartAt(?string $start_at): void + public function setStartAt(?\DateTimeImmutable $start_at): void { $this->data['start_at'] = $start_at; } - public function getStartAt(): ?string + public function getStartAt(): ?\DateTimeImmutable { - return $this->get('start_at'); + return $this->attr('start_at'); } public function setStatus(string $status): void @@ -167,7 +167,7 @@ public function setStatus(string $status): void public function getStatus(): string { - return $this->get('status'); + return $this->attr('status'); } public function setStatusPercent(?int $status_percent): void @@ -177,6 +177,6 @@ public function setStatusPercent(?int $status_percent): void public function getStatusPercent(): ?int { - return $this->get('status_percent'); + return $this->attr('status_percent'); } } diff --git a/src/Models/TextTemplate.php b/src/Models/TextTemplate.php index ed6963e..0c95090 100644 --- a/src/Models/TextTemplate.php +++ b/src/Models/TextTemplate.php @@ -18,12 +18,12 @@ public function __construct(array $data = []) public function getCanModify(): bool { - return $this->get('can_modify'); + return $this->attr('can_modify'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setText(string $text): void @@ -33,7 +33,7 @@ public function setText(string $text): void public function getText(): string { - return $this->get('text'); + return $this->attr('text'); } public function setTitle(string $title): void @@ -43,6 +43,6 @@ public function setTitle(string $title): void public function getTitle(): string { - return $this->get('title'); + return $this->attr('title'); } } diff --git a/src/Models/TimeTracking.php b/src/Models/TimeTracking.php index 76022ca..6583ae4 100644 --- a/src/Models/TimeTracking.php +++ b/src/Models/TimeTracking.php @@ -16,39 +16,39 @@ public function __construct(array $data = []) $this->data = $data; } - public function setClearedAt(?string $cleared_at): void + public function setClearedAt(?\DateTimeImmutable $cleared_at): void { $this->data['cleared_at'] = $cleared_at; } - public function getClearedAt(): ?string + public function getClearedAt(): ?\DateTimeImmutable { - return $this->get('cleared_at'); + return $this->attr('cleared_at'); } - public function getCreatedAt(): string + public function getCreatedAt(): \DateTimeImmutable { - return $this->get('created_at'); + return $this->attr('created_at'); } - public function setDateFromAt(?string $date_from_at): void + public function setDateFromAt(?\DateTimeImmutable $date_from_at): void { $this->data['date_from_at'] = $date_from_at; } - public function getDateFromAt(): ?string + public function getDateFromAt(): ?\DateTimeImmutable { - return $this->get('date_from_at'); + return $this->attr('date_from_at'); } - public function setDateThruAt(?string $date_thru_at): void + public function setDateThruAt(?\DateTimeImmutable $date_thru_at): void { $this->data['date_thru_at'] = $date_thru_at; } - public function getDateThruAt(): ?string + public function getDateThruAt(): ?\DateTimeImmutable { - return $this->get('date_thru_at'); + return $this->attr('date_thru_at'); } public function setDescription(string $description): void @@ -58,7 +58,7 @@ public function setDescription(string $description): void public function getDescription(): string { - return $this->get('description'); + return $this->attr('description'); } /** @@ -71,12 +71,12 @@ public function setHourlyRate(float $hourly_rate): void public function getHourlyRate(): float { - return $this->get('hourly_rate'); + return $this->attr('hourly_rate'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setNote(?string $note): void @@ -86,7 +86,7 @@ public function setNote(?string $note): void public function getNote(): ?string { - return $this->get('note'); + return $this->attr('note'); } /** @@ -99,7 +99,7 @@ public function setNumber(?string $number): void public function getNumber(): ?string { - return $this->get('number'); + return $this->attr('number'); } public function setPositionId(?int $position_id): void @@ -109,7 +109,7 @@ public function setPositionId(?int $position_id): void public function getPositionId(): ?int { - return $this->get('position_id'); + return $this->attr('position_id'); } public function setProjectId(?int $project_id): void @@ -119,7 +119,7 @@ public function setProjectId(?int $project_id): void public function getProjectId(): ?int { - return $this->get('project_id'); + return $this->attr('project_id'); } /** @@ -132,7 +132,7 @@ public function setLoginId(?int $login_id): void public function getLoginId(): ?int { - return $this->get('login_id'); + return $this->attr('login_id'); } /** @@ -145,6 +145,6 @@ public function setTimerValue(?int $timer_value): void public function getTimerValue(): ?int { - return $this->get('timer_value'); + return $this->attr('timer_value'); } } diff --git a/src/Models/Traits/Data.php b/src/Models/Traits/Data.php index 5ff513a..ad5af0d 100644 --- a/src/Models/Traits/Data.php +++ b/src/Models/Traits/Data.php @@ -15,26 +15,57 @@ public function toArray(): array return $val->toArray(); } + if ($val instanceof \DateTimeInterface) { + return $val->format('Y-m-d H:i:s'); + } + return $val; }, $this->data); } - protected function get(string $key): mixed + protected function attr(string $key): mixed { if (!array_key_exists($key, $this->data)) { - throw new \RuntimeException(sprintf('Key "%s" not exists in $data', $key)); + throw new \RuntimeException(sprintf('Attr "%s" not found in $data', $key)); } return $this->data[$key]; } - protected function getInstance(string $key, string $className): mixed + protected function attrInstance(string $key, string $className): mixed { - $data = $this->get($key); + $data = $this->attr($key); if ($data instanceof $className) { return $data; } return $this->data[$key] = new $className($data); } + + protected function attrDate(string $key): ?\DateTimeImmutable + { + $data = $this->attr($key); + if ($data instanceof \DateTimeImmutable) { + return $data; + } + if (null === $data) { + return null; + } + + return $this->data[$key] = \DateTimeImmutable::createFromFormat('!Y-m-d', $data, new \DateTimeZone('Europe/Berlin')); + } + + protected function attrDateTime(string $key): ?\DateTimeImmutable + { + $data = $this->attr($key); + if ($data instanceof \DateTimeImmutable) { + return $data; + } + + if (null === $data) { + return null; + } + + return $this->data[$key] = \DateTimeImmutable::createFromFormat('!Y-m-d H:i:s', $data, new \DateTimeZone('Europe/Berlin')); + } } diff --git a/src/Models/WebHook.php b/src/Models/WebHook.php index 9b8bb6f..51dd0e6 100644 --- a/src/Models/WebHook.php +++ b/src/Models/WebHook.php @@ -23,7 +23,7 @@ public function setContentType(string $content_type): void public function getContentType(): string { - return $this->get('content_type'); + return $this->attr('content_type'); } public function setDescription(string $description): void @@ -33,7 +33,7 @@ public function setDescription(string $description): void public function getDescription(): string { - return $this->get('description'); + return $this->attr('description'); } public function setEvents(array $events): void @@ -46,12 +46,12 @@ public function setEvents(array $events): void */ public function getEvents(): array { - return $this->get('events'); + return $this->attr('events'); } public function getId(): int { - return $this->get('id'); + return $this->attr('id'); } public function setIsActive(bool $is_active): void @@ -61,12 +61,12 @@ public function setIsActive(bool $is_active): void public function getIsActive(): bool { - return $this->get('is_active'); + return $this->attr('is_active'); } public function getLastResponse(): WebHookLastResponse { - return $this->getInstance('last_response', \easybill\SDK\Models\WebHookLastResponse::class); + return $this->attrInstance('last_response', \easybill\SDK\Models\WebHookLastResponse::class); } public function setSecret(string $secret): void @@ -76,7 +76,7 @@ public function setSecret(string $secret): void public function getSecret(): string { - return $this->get('secret'); + return $this->attr('secret'); } public function setUrl(string $url): void @@ -86,6 +86,6 @@ public function setUrl(string $url): void public function getUrl(): string { - return $this->get('url'); + return $this->attr('url'); } } diff --git a/src/Models/WebHookLastResponse.php b/src/Models/WebHookLastResponse.php index d7c3295..e1b29be 100644 --- a/src/Models/WebHookLastResponse.php +++ b/src/Models/WebHookLastResponse.php @@ -16,18 +16,18 @@ public function __construct(array $data = []) $this->data = $data; } - public function getDate(): string + public function getDate(): \DateTimeImmutable { - return $this->get('date'); + return $this->attr('date'); } public function getCode(): int { - return $this->get('code'); + return $this->attr('code'); } public function getResponse(): string { - return $this->get('response'); + return $this->attr('response'); } } diff --git a/tests/Models/CustomerTest.php b/tests/Models/CustomerTest.php index dd49690..9981341 100644 --- a/tests/Models/CustomerTest.php +++ b/tests/Models/CustomerTest.php @@ -4,6 +4,7 @@ use easybill\SDK\Models\Customer; use PHPUnit\Framework\TestCase; +use RuntimeException; /** * @internal @@ -15,6 +16,22 @@ public function testToArray(): void { $customer = new Customer(); $customer->setNumber('31337'); - static::assertSame(['number' => '31337'], $customer->toArray()); + $customer->setBirthDate(\DateTimeImmutable::createFromFormat('!Y-m-d', '1984-12-18')); + static::assertSame(['number' => '31337', 'birth_date' => '1984-12-18 00:00:00'], $customer->toArray()); + } + + public function testBirthDay(): void + { + static::assertNull((new Customer(['birth_date' => null]))->getBirthDate()); + static::assertInstanceOf(\DateTimeImmutable::class, (new Customer(['birth_date' => '1984-12-18']))->getBirthDate()); + static::assertSame('1984-12-18', (new Customer(['birth_date' => '1984-12-18']))->getBirthDate()->format('Y-m-d')); + static::assertSame('1984-12-18 00:00:00', (new Customer(['birth_date' => '1984-12-18']))->getBirthDate()->format('Y-m-d H:i:s')); + } + + public function testAttrNotFoundException(): void + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('Attr "birth_date" not found in $data'); + (new Customer())->getBirthDate(); } } From 91c518d2a73342bafe7bcbea877757697914f5b6 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 16:00:51 +0100 Subject: [PATCH 20/37] Add enum to comment and DocumentPosition support in document --- generators/models.php | 7 +++++ src/Models/Customer.php | 47 ++++++++++++++++++++++++++++ src/Models/CustomerSnapshot.php | 27 ++++++++++++++++ src/Models/DiscountPosition.php | 5 +++ src/Models/DiscountPositionGroup.php | 5 +++ src/Models/Document.php | 26 +++++++++++++++ src/Models/DocumentPosition.php | 21 +++++++++++++ src/Models/DocumentRecurring.php | 46 +++++++++++++++++++++++++++ src/Models/Login.php | 6 ++++ src/Models/Position.php | 22 +++++++++++++ src/Models/PostBox.php | 23 ++++++++++++++ src/Models/PostBoxRequest.php | 10 ++++++ src/Models/Project.php | 12 +++++++ src/Models/SEPAPayment.php | 16 ++++++++++ src/Models/ServiceDate.php | 5 +++ src/Models/Task.php | 18 +++++++++++ src/Models/Traits/Data.php | 28 ++++++++++------- src/Models/WebHook.php | 6 ++++ tests/Models/DocumentTest.php | 30 ++++++++++++++++++ 19 files changed, 349 insertions(+), 11 deletions(-) create mode 100644 tests/Models/DocumentTest.php diff --git a/generators/models.php b/generators/models.php index bbf8160..5341160 100644 --- a/generators/models.php +++ b/generators/models.php @@ -92,6 +92,7 @@ function typeMap(string $type): string $propertyInfo['x-nullable'] = $propertyInfo['x-nullable'] ?? false; $propertyInfo['items'] = $propertyInfo['items'] ?? []; $propertyInfo['format'] = $propertyInfo['format'] ?? ''; + $propertyInfo['enum'] = $propertyInfo['enum'] ?? []; echo '==> ' . $className . '::' . $propertyName . "\n"; @@ -126,6 +127,9 @@ function typeMap(string $type): string if ($propertyInfo['x-nullable']) { $property->setNullable(); } + if ($propertyInfo['enum']) { + $setter->addComment('@enum ' . json_encode($propertyInfo['enum'], JSON_THROW_ON_ERROR)); + } } $getter = $class->addMethod('get' . $methodeName); @@ -146,6 +150,9 @@ function typeMap(string $type): string } else { $getter->setBody('return $this->attr(\'' . $propertyName . '\');'); } + if ($propertyInfo['enum']) { + $getter->addComment('@enum ' . json_encode($propertyInfo['enum'], JSON_THROW_ON_ERROR)); + } } $content = (new Nette\PhpGenerator\PsrPrinter())->printFile($file); diff --git a/src/Models/Customer.php b/src/Models/Customer.php index 17d831c..d4d64cd 100644 --- a/src/Models/Customer.php +++ b/src/Models/Customer.php @@ -18,12 +18,17 @@ public function __construct(array $data = []) /** * 1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform. + * + * @enum [1,2,3,4,5,6,7,8] */ public function setAcquireOptions(?int $acquire_options): void { $this->data['acquire_options'] = $acquire_options; } + /** + * @enum [1,2,3,4,5,6,7,8] + */ public function getAcquireOptions(): ?int { return $this->attr('acquire_options'); @@ -137,11 +142,17 @@ public function getCashDiscount(): ?float return $this->attr('cash_discount'); } + /** + * @enum ["PERCENT","AMOUNT"] + */ public function setCashDiscountType(?string $cash_discount_type): void { $this->data['cash_discount_type'] = $cash_discount_type; } + /** + * @enum ["PERCENT","AMOUNT"] + */ public function getCashDiscountType(): ?string { return $this->attr('cash_discount_type'); @@ -279,12 +290,17 @@ public function getDeliveryPersonal(): bool /** * 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family. + * + * @enum [0,1,2,3,4,5,6] */ public function setDeliverySalutation(int $delivery_salutation): void { $this->data['delivery_salutation'] = $delivery_salutation; } + /** + * @enum [0,1,2,3,4,5,6] + */ public function getDeliverySalutation(): int { return $this->attr('delivery_salutation'); @@ -494,12 +510,17 @@ public function getNumber(): string /** * 1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung. + * + * @enum [1,2,3,5] */ public function setPaymentOptions(?int $payment_options): void { $this->data['payment_options'] = $payment_options; } + /** + * @enum [1,2,3,5] + */ public function getPaymentOptions(): ?int { return $this->attr('payment_options'); @@ -585,11 +606,17 @@ public function getPostboxZipCode(): ?string return $this->attr('postbox_zip_code'); } + /** + * @enum ["SALEPRICE2","SALEPRICE3","SALEPRICE4","SALEPRICE5","SALEPRICE6","SALEPRICE7","SALEPRICE8","SALEPRICE9","SALEPRICE10"] + */ public function setSalePriceLevel(?string $sale_price_level): void { $this->data['sale_price_level'] = $sale_price_level; } + /** + * @enum ["SALEPRICE2","SALEPRICE3","SALEPRICE4","SALEPRICE5","SALEPRICE6","SALEPRICE7","SALEPRICE8","SALEPRICE9","SALEPRICE10"] + */ public function getSalePriceLevel(): ?string { return $this->attr('sale_price_level'); @@ -597,12 +624,17 @@ public function getSalePriceLevel(): ?string /** * 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family. + * + * @enum [0,1,2,3,4,5,6] */ public function setSalutation(int $salutation): void { $this->data['salutation'] = $salutation; } + /** + * @enum [0,1,2,3,4,5,6] + */ public function getSalutation(): int { return $this->attr('salutation'); @@ -610,12 +642,17 @@ public function getSalutation(): int /** * BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1, COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt. + * + * @enum ["BASIC","COR1","COMPANY","NULL"] */ public function setSepaAgreement(?string $sepa_agreement): void { $this->data['sepa_agreement'] = $sepa_agreement; } + /** + * @enum ["BASIC","COR1","COMPANY","NULL"] + */ public function getSepaAgreement(): ?string { return $this->attr('sepa_agreement'); @@ -713,12 +750,17 @@ public function getCourtRegistryNumber(): ?string /** * nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig. + * + * @enum ["nStb","nStbUstID","nStbNoneUstID","nStbIm","revc","IG","AL","sStfr","NULL"] */ public function setTaxOptions(?string $tax_options): void { $this->data['tax_options'] = $tax_options; } + /** + * @enum ["nStb","nStbUstID","nStbNoneUstID","nStbIm","revc","IG","AL","sStfr","NULL"] + */ public function getTaxOptions(): ?string { return $this->attr('tax_options'); @@ -756,12 +798,17 @@ public function getZipCode(): ?string /** * Type of PDF to use when sending a Document to the Customer. + * + * @enum ["default","zugferd1","zugferd2","xrechnung","xrechnung_xml"] */ public function setDocumentPdfType(string $documentPdfType): void { $this->data['documentPdfType'] = $documentPdfType; } + /** + * @enum ["default","zugferd1","zugferd2","xrechnung","xrechnung_xml"] + */ public function getDocumentPdfType(): string { return $this->attr('documentPdfType'); diff --git a/src/Models/CustomerSnapshot.php b/src/Models/CustomerSnapshot.php index 40c5408..9e3f2ea 100644 --- a/src/Models/CustomerSnapshot.php +++ b/src/Models/CustomerSnapshot.php @@ -17,6 +17,9 @@ public function __construct(array $data = []) $this->data = $data; } + /** + * @enum [1,2,3,4,5,6,7,8] + */ public function getAcquireOptions(): ?int { return $this->attr('acquire_options'); @@ -80,6 +83,9 @@ public function getCashDiscount(): ?float return $this->attr('cash_discount'); } + /** + * @enum ["PERCENT","AMOUNT"] + */ public function getCashDiscountType(): ?string { return $this->attr('cash_discount_type'); @@ -155,6 +161,9 @@ public function getDeliveryPersonal(): bool return $this->attr('delivery_personal'); } + /** + * @enum [0,1,2,3,4,5,6] + */ public function getDeliverySalutation(): int { return $this->attr('delivery_salutation'); @@ -263,6 +272,9 @@ public function getNumber(): string return $this->attr('number'); } + /** + * @enum [1,2,3,5] + */ public function getPaymentOptions(): ?int { return $this->attr('payment_options'); @@ -308,16 +320,25 @@ public function getPostboxZipCode(): ?string return $this->attr('postbox_zip_code'); } + /** + * @enum ["SALEPRICE2","SALEPRICE3","SALEPRICE4","SALEPRICE5","SALEPRICE6","SALEPRICE7","SALEPRICE8","SALEPRICE9","SALEPRICE10"] + */ public function getSalePriceLevel(): ?string { return $this->attr('sale_price_level'); } + /** + * @enum [0,1,2,3,4,5,6] + */ public function getSalutation(): int { return $this->attr('salutation'); } + /** + * @enum ["BASIC","COR1","COMPANY","NULL"] + */ public function getSepaAgreement(): ?string { return $this->attr('sepa_agreement'); @@ -368,6 +389,9 @@ public function getCourtRegistryNumber(): ?string return $this->attr('court_registry_number'); } + /** + * @enum ["nStb","nStbUstID","nStbNoneUstID","nStbIm","revc","IG","AL","sStfr","NULL"] + */ public function getTaxOptions(): ?string { return $this->attr('tax_options'); @@ -388,6 +412,9 @@ public function getZipCode(): ?string return $this->attr('zip_code'); } + /** + * @enum ["default","zugferd1","zugferd2","xrechnung","xrechnung_xml"] + */ public function getDocumentPdfType(): string { return $this->attr('documentPdfType'); diff --git a/src/Models/DiscountPosition.php b/src/Models/DiscountPosition.php index 410c6fa..448311f 100644 --- a/src/Models/DiscountPosition.php +++ b/src/Models/DiscountPosition.php @@ -56,12 +56,17 @@ public function getDiscount(): int /** * AMOUNT subtracts the value in "discount" from the total
QUANTITY subtracts the value in "discount" multiplied by quantity
PERCENT uses the value in "discount" as a percentage
FIX sets the value in "discount" as the new price. + * + * @enum ["AMOUNT","PERCENT","QUANTITY","FIX"] */ public function setDiscountType(string $discount_type): void { $this->data['discount_type'] = $discount_type; } + /** + * @enum ["AMOUNT","PERCENT","QUANTITY","FIX"] + */ public function getDiscountType(): string { return $this->attr('discount_type'); diff --git a/src/Models/DiscountPositionGroup.php b/src/Models/DiscountPositionGroup.php index 0a10dbb..d87eb20 100644 --- a/src/Models/DiscountPositionGroup.php +++ b/src/Models/DiscountPositionGroup.php @@ -56,12 +56,17 @@ public function getDiscount(): int /** * AMOUNT subtracts the value in "discount" from the total
QUANTITY subtracts the value in "discount" multiplied by quantity
PERCENT uses the value in "discount" as a percentage
FIX sets the value in "discount" as the new price. + * + * @enum ["AMOUNT","PERCENT","QUANTITY","FIX"] */ public function setDiscountType(string $discount_type): void { $this->data['discount_type'] = $discount_type; } + /** + * @enum ["AMOUNT","PERCENT","QUANTITY","FIX"] + */ public function getDiscountType(): string { return $this->attr('discount_type'); diff --git a/src/Models/Document.php b/src/Models/Document.php index 7040a01..c973151 100644 --- a/src/Models/Document.php +++ b/src/Models/Document.php @@ -61,12 +61,17 @@ public function getBillingCountry(): string /** * 0 === Net, 1 === Gross. + * + * @enum [0,1] */ public function setCalcVatFrom(int $calc_vat_from): void { $this->data['calc_vat_from'] = $calc_vat_from; } + /** + * @enum [0,1] + */ public function getCalcVatFrom(): int { return $this->attr('calc_vat_from'); @@ -177,11 +182,17 @@ public function getDiscount(): ?string return $this->attr('discount'); } + /** + * @enum ["PERCENT","AMOUNT"] + */ public function setDiscountType(?string $discount_type): void { $this->data['discount_type'] = $discount_type; } + /** + * @enum ["PERCENT","AMOUNT"] + */ public function getDiscountType(): ?string { return $this->attr('discount_type'); @@ -475,12 +486,17 @@ public function getShippingCountry(): ?string /** * This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set. + * + * @enum ["ACCEPT","DONE","DROPSHIPPING","CANCEL"] */ public function setStatus(?string $status): void { $this->data['status'] = $status; } + /** + * @enum ["ACCEPT","DONE","DROPSHIPPING","CANCEL"] + */ public function getStatus(): ?string { return $this->attr('status'); @@ -531,12 +547,17 @@ public function getTitle(): ?string /** * Can only set on create. + * + * @enum ["INVOICE","RECURRING","CREDIT","OFFER","REMINDER","DUNNING","STORNO","STORNO_CREDIT","DELIVERY","PDF","CHARGE","CHARGE_CONFIRM","LETTER","ORDER","PROFORMA_INVOICE","STORNO_PROFORMA_INVOICE"] */ public function setType(string $type): void { $this->data['type'] = $type; } + /** + * @enum ["INVOICE","RECURRING","CREDIT","OFFER","REMINDER","DUNNING","STORNO","STORNO_CREDIT","DELIVERY","PDF","CHARGE","CHARGE_CONFIRM","LETTER","ORDER","PROFORMA_INVOICE","STORNO_PROFORMA_INVOICE"] + */ public function getType(): string { return $this->attr('type'); @@ -582,12 +603,17 @@ public function getFulfillmentCountry(): ?string /** * NULL: Normal steuerbar
nStb: Nicht steuerbar (Drittland)
nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)
nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)
nStbIm: Nicht steuerbarer Innenumsatz
revc: Steuerschuldwechsel §13b (Inland)
IG: Innergemeinschaftliche Lieferung
AL: Ausfuhrlieferung
sStfr: sonstige Steuerbefreiung
smallBusiness: Kleinunternehmen (Keine MwSt.). + * + * @enum ["NULL","nStb","nStbUstID","nStbNoneUstID","nStbIm","revc","IG","AL","sStfr","smallBusiness"] */ public function setVatOption(?string $vat_option): void { $this->data['vat_option'] = $vat_option; } + /** + * @enum ["NULL","nStb","nStbUstID","nStbNoneUstID","nStbIm","revc","IG","AL","sStfr","smallBusiness"] + */ public function getVatOption(): ?string { return $this->attr('vat_option'); diff --git a/src/Models/DocumentPosition.php b/src/Models/DocumentPosition.php index 5de5618..3a10909 100644 --- a/src/Models/DocumentPosition.php +++ b/src/Models/DocumentPosition.php @@ -82,11 +82,17 @@ public function getUnit(): ?string return $this->attr('unit'); } + /** + * @enum ["POSITION","POSITION_NOCALC","TEXT"] + */ public function setType(string $type): void { $this->data['type'] = $type; } + /** + * @enum ["POSITION","POSITION_NOCALC","TEXT"] + */ public function getType(): string { return $this->attr('type'); @@ -140,11 +146,17 @@ public function getDiscount(): ?float return $this->attr('discount'); } + /** + * @enum ["PERCENT","AMOUNT"] + */ public function setDiscountType(?string $discount_type): void { $this->data['discount_type'] = $discount_type; } + /** + * @enum ["PERCENT","AMOUNT"] + */ public function getDiscountType(): ?string { return $this->attr('discount_type'); @@ -238,16 +250,25 @@ public function getCostPriceCharge(): float return $this->attr('cost_price_charge'); } + /** + * @enum ["PERCENT","AMOUNT"] + */ public function getCostPriceChargeType(): string { return $this->attr('cost_price_charge_type'); } + /** + * @enum ["PRODUCT","SERVICE","UNDEFINED"] + */ public function setItemType(string $itemType): void { $this->data['itemType'] = $itemType; } + /** + * @enum ["PRODUCT","SERVICE","UNDEFINED"] + */ public function getItemType(): string { return $this->attr('itemType'); diff --git a/src/Models/DocumentRecurring.php b/src/Models/DocumentRecurring.php index 6d8babf..140473f 100644 --- a/src/Models/DocumentRecurring.php +++ b/src/Models/DocumentRecurring.php @@ -29,21 +29,33 @@ public function getNextDate(): \DateTimeImmutable return $this->attrDate('next_date'); } + /** + * @enum ["DAILY","WEEKLY","MONTHLY","YEARLY"] + */ public function setFrequency(string $frequency): void { $this->data['frequency'] = $frequency; } + /** + * @enum ["DAILY","WEEKLY","MONTHLY","YEARLY"] + */ public function getFrequency(): string { return $this->attr('frequency'); } + /** + * @enum ["LASTDAYOFMONTH"] + */ public function setFrequencySpecial(?string $frequency_special): void { $this->data['frequency_special'] = $frequency_special; } + /** + * @enum ["LASTDAYOFMONTH"] + */ public function getFrequencySpecial(): ?string { return $this->attr('frequency_special'); @@ -72,11 +84,17 @@ public function getEndDateOrCount(): ?string return $this->attr('end_date_or_count'); } + /** + * @enum ["RUNNING","PAUSE","STOP","WAITING"] + */ public function setStatus(string $status): void { $this->data['status'] = $status; } + /** + * @enum ["RUNNING","PAUSE","STOP","WAITING"] + */ public function getStatus(): string { return $this->attr('status'); @@ -102,11 +120,17 @@ public function getIsNotify(): bool return $this->attr('is_notify'); } + /** + * @enum ["EMAIL","FAX","POST"] + */ public function setSendAs(?string $send_as): void { $this->data['send_as'] = $send_as; } + /** + * @enum ["EMAIL","FAX","POST"] + */ public function getSendAs(): ?string { return $this->attr('send_as'); @@ -134,12 +158,17 @@ public function getIsPaid(): bool /** * Option is used to determine what date is used for the payment if is_paid is true. "next_valid_date" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday. + * + * @enum ["created_date","due_date","next_valid_date"] */ public function setPaidDateOption(string $paid_date_option): void { $this->data['paid_date_option'] = $paid_date_option; } + /** + * @enum ["created_date","due_date","next_valid_date"] + */ public function getPaidDateOption(): string { return $this->attr('paid_date_option'); @@ -155,21 +184,33 @@ public function getIsSepa(): bool return $this->attr('is_sepa'); } + /** + * @enum ["CORE","COR1","B2B"] + */ public function setSepaLocalInstrument(?string $sepa_local_instrument): void { $this->data['sepa_local_instrument'] = $sepa_local_instrument; } + /** + * @enum ["CORE","COR1","B2B"] + */ public function getSepaLocalInstrument(): ?string { return $this->attr('sepa_local_instrument'); } + /** + * @enum ["FRST","OOFF","FNAL","RCUR"] + */ public function setSepaSequenceType(?string $sepa_sequence_type): void { $this->data['sepa_sequence_type'] = $sepa_sequence_type; } + /** + * @enum ["FRST","OOFF","FNAL","RCUR"] + */ public function getSepaSequenceType(): ?string { return $this->attr('sepa_sequence_type'); @@ -197,12 +238,17 @@ public function getSepaRemittanceInformation(): ?string /** * The document type that will be generated. Can not be changed on existing documents. + * + * @enum ["INVOICE","CREDIT","ORDER","OFFER"] */ public function setTargetType(string $target_type): void { $this->data['target_type'] = $target_type; } + /** + * @enum ["INVOICE","CREDIT","ORDER","OFFER"] + */ public function getTargetType(): string { return $this->attr('target_type'); diff --git a/src/Models/Login.php b/src/Models/Login.php index b83a833..452ce51 100644 --- a/src/Models/Login.php +++ b/src/Models/Login.php @@ -76,11 +76,17 @@ public function getEmailSignature(): string return $this->attr('email_signature'); } + /** + * @enum ["ADMIN","ASSISTANT"] + */ public function setLoginType(string $login_type): void { $this->data['login_type'] = $login_type; } + /** + * @enum ["ADMIN","ASSISTANT"] + */ public function getLoginType(): string { return $this->attr('login_type'); diff --git a/src/Models/Position.php b/src/Models/Position.php index 86caac3..692cf18 100644 --- a/src/Models/Position.php +++ b/src/Models/Position.php @@ -21,11 +21,17 @@ public function getId(): int return $this->attr('id'); } + /** + * @enum ["PRODUCT","SERVICE","TEXT"] + */ public function setType(string $type): void { $this->data['type'] = $type; } + /** + * @enum ["PRODUCT","SERVICE","TEXT"] + */ public function getType(): string { return $this->attr('type'); @@ -118,11 +124,17 @@ public function getLoginId(): int return $this->attr('login_id'); } + /** + * @enum ["BRUTTO","NETTO"] + */ public function setPriceType(string $price_type): void { $this->data['price_type'] = $price_type; } + /** + * @enum ["BRUTTO","NETTO"] + */ public function getPriceType(): string { return $this->attr('price_type'); @@ -313,12 +325,17 @@ public function getGroupId(): ?int /** * Activates stock management for this position. + * + * @enum ["YES","NO"] */ public function setStock(string $stock): void { $this->data['stock'] = $stock; } + /** + * @enum ["YES","NO"] + */ public function getStock(): string { return $this->attr('stock'); @@ -344,12 +361,17 @@ public function getStockLimitNotify(): bool /** * Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE). + * + * @enum ["ALWAYS","ONCE"] */ public function setStockLimitNotifyFrequency(string $stock_limit_notify_frequency): void { $this->data['stock_limit_notify_frequency'] = $stock_limit_notify_frequency; } + /** + * @enum ["ALWAYS","ONCE"] + */ public function getStockLimitNotifyFrequency(): string { return $this->attr('stock_limit_notify_frequency'); diff --git a/src/Models/PostBox.php b/src/Models/PostBox.php index 003dc74..6889698 100644 --- a/src/Models/PostBox.php +++ b/src/Models/PostBox.php @@ -131,21 +131,33 @@ public function getSendWithAttachment(): bool return $this->attr('send_with_attachment'); } + /** + * @enum ["FAX","EMAIL","POST"] + */ public function setType(string $type): void { $this->data['type'] = $type; } + /** + * @enum ["FAX","EMAIL","POST"] + */ public function getType(): string { return $this->attr('type'); } + /** + * @enum ["WAITING","PREPARE","ERROR","OK","PROCESSING"] + */ public function setStatus(string $status): void { $this->data['status'] = $status; } + /** + * @enum ["WAITING","PREPARE","ERROR","OK","PROCESSING"] + */ public function getStatus(): string { return $this->attr('status'); @@ -166,11 +178,17 @@ public function getLoginId(): int return $this->attr('login_id'); } + /** + * @enum ["default","zugferd1","zugferd2","xrechnung","xrechnung_xml"] + */ public function setDocumentFileType(?string $document_file_type): void { $this->data['document_file_type'] = $document_file_type; } + /** + * @enum ["default","zugferd1","zugferd2","xrechnung","xrechnung_xml"] + */ public function getDocumentFileType(): ?string { return $this->attr('document_file_type'); @@ -186,12 +204,17 @@ public function getDocumentFileType(): ?string * post_send_type_standard will be used. * * For postbox with a different type than "POST" this field will hold a empty string. + * + * @enum ["post_send_type_standard","post_send_type_registered","post_send_type_registered_and_personal","post_send_type_registered_and_receipt","post_send_type_registered_throwin","post_send_type_prio"] */ public function setPostSendType(string $post_send_type): void { $this->data['post_send_type'] = $post_send_type; } + /** + * @enum ["post_send_type_standard","post_send_type_registered","post_send_type_registered_and_personal","post_send_type_registered_and_receipt","post_send_type_registered_throwin","post_send_type_prio"] + */ public function getPostSendType(): string { return $this->attr('post_send_type'); diff --git a/src/Models/PostBoxRequest.php b/src/Models/PostBoxRequest.php index 7aa1454..0323efe 100644 --- a/src/Models/PostBoxRequest.php +++ b/src/Models/PostBoxRequest.php @@ -78,12 +78,17 @@ public function getDate(): \DateTimeImmutable /** * When set to null, the setting on the customer is used. + * + * @enum ["default","zugferd1","zugferd2","xrechnung","xrechnung_xml"] */ public function setDocumentFileType(?string $document_file_type): void { $this->data['document_file_type'] = $document_file_type; } + /** + * @enum ["default","zugferd1","zugferd2","xrechnung","xrechnung_xml"] + */ public function getDocumentFileType(): ?string { return $this->attr('document_file_type'); @@ -99,12 +104,17 @@ public function getDocumentFileType(): ?string * post_send_type_standard will be used. * * For postbox with a different type than "POST" this field will hold a empty string. + * + * @enum ["post_send_type_standard","post_send_type_registered","post_send_type_registered_and_personal","post_send_type_registered_and_receipt","post_send_type_registered_throwin","post_send_type_prio"] */ public function setPostSendType(string $post_send_type): void { $this->data['post_send_type'] = $post_send_type; } + /** + * @enum ["post_send_type_standard","post_send_type_registered","post_send_type_registered_and_personal","post_send_type_registered_and_receipt","post_send_type_registered_throwin","post_send_type_prio"] + */ public function getPostSendType(): string { return $this->attr('post_send_type'); diff --git a/src/Models/Project.php b/src/Models/Project.php index 1cec89e..01b92e8 100644 --- a/src/Models/Project.php +++ b/src/Models/Project.php @@ -103,11 +103,17 @@ public function getNote(): ?string return $this->attr('note'); } + /** + * @enum ["OPEN","DONE","CANCEL"] + */ public function setStatus(string $status): void { $this->data['status'] = $status; } + /** + * @enum ["OPEN","DONE","CANCEL"] + */ public function getStatus(): string { return $this->attr('status'); @@ -123,11 +129,17 @@ public function getDueAt(): ?\DateTimeImmutable return $this->attrDate('due_at'); } + /** + * @enum ["ALWAYS","ONCE","NEVER"] + */ public function setBudgetNotifyFrequency(string $budget_notify_frequency): void { $this->data['budget_notify_frequency'] = $budget_notify_frequency; } + /** + * @enum ["ALWAYS","ONCE","NEVER"] + */ public function getBudgetNotifyFrequency(): string { return $this->attr('budget_notify_frequency'); diff --git a/src/Models/SEPAPayment.php b/src/Models/SEPAPayment.php index bcf03a5..3deae65 100644 --- a/src/Models/SEPAPayment.php +++ b/src/Models/SEPAPayment.php @@ -186,12 +186,17 @@ public function getId(): int /** * CORE: SEPA Core Direct Debit
COR1: SEPA-Basislastschrift COR1
B2B: SEPA Business to Business Direct Debit. + * + * @enum ["CORE","COR1","B2B"] */ public function setLocalInstrument(string $local_instrument): void { $this->data['local_instrument'] = $local_instrument; } + /** + * @enum ["CORE","COR1","B2B"] + */ public function getLocalInstrument(): string { return $this->attr('local_instrument'); @@ -252,12 +257,17 @@ public function getRequestedAt(): \DateTimeImmutable /** * FRST: Erstlastschrift
RCUR: Folgelastschrift
OOFF: Einmallastschrift
FNAL: Letztmalige Lastschrift. + * + * @enum ["FRST","OOFF","FNAL","RCUR"] */ public function setSequenceType(string $sequence_type): void { $this->data['sequence_type'] = $sequence_type; } + /** + * @enum ["FRST","OOFF","FNAL","RCUR"] + */ public function getSequenceType(): string { return $this->attr('sequence_type'); @@ -268,11 +278,17 @@ public function getUpdatedAt(): string return $this->attr('updated_at'); } + /** + * @enum ["DEBIT","CREDIT"] + */ public function setType(string $type): void { $this->data['type'] = $type; } + /** + * @enum ["DEBIT","CREDIT"] + */ public function getType(): string { return $this->attr('type'); diff --git a/src/Models/ServiceDate.php b/src/Models/ServiceDate.php index d532354..34a4d29 100644 --- a/src/Models/ServiceDate.php +++ b/src/Models/ServiceDate.php @@ -18,12 +18,17 @@ public function __construct(array $data = []) /** * With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.
For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text. + * + * @enum ["DEFAULT","SERVICE","DELIVERY"] */ public function setType(string $type): void { $this->data['type'] = $type; } + /** + * @enum ["DEFAULT","SERVICE","DELIVERY"] + */ public function getType(): string { return $this->attr('type'); diff --git a/src/Models/Task.php b/src/Models/Task.php index b3a726b..8db8105 100644 --- a/src/Models/Task.php +++ b/src/Models/Task.php @@ -16,11 +16,17 @@ public function __construct(array $data = []) $this->data = $data; } + /** + * @enum ["CALL","EMAIL","FAX","LUNCH","MEETING","TRAVEL","CUSTOM"] + */ public function setCategory(?string $category): void { $this->data['category'] = $category; } + /** + * @enum ["CALL","EMAIL","FAX","LUNCH","MEETING","TRAVEL","CUSTOM"] + */ public function getCategory(): ?string { return $this->attr('category'); @@ -130,11 +136,17 @@ public function getPositionId(): ?int return $this->attr('position_id'); } + /** + * @enum ["LOW","NORMAL","HIGH"] + */ public function setPriority(string $priority): void { $this->data['priority'] = $priority; } + /** + * @enum ["LOW","NORMAL","HIGH"] + */ public function getPriority(): string { return $this->attr('priority'); @@ -160,11 +172,17 @@ public function getStartAt(): ?\DateTimeImmutable return $this->attr('start_at'); } + /** + * @enum ["WAITING","PROCESSING","DONE","CANCEL"] + */ public function setStatus(string $status): void { $this->data['status'] = $status; } + /** + * @enum ["WAITING","PROCESSING","DONE","CANCEL"] + */ public function getStatus(): string { return $this->attr('status'); diff --git a/src/Models/Traits/Data.php b/src/Models/Traits/Data.php index ad5af0d..cc2bfa8 100644 --- a/src/Models/Traits/Data.php +++ b/src/Models/Traits/Data.php @@ -8,19 +8,25 @@ trait Data { protected array $data = []; - public function toArray(): array - { - return array_map(static function (mixed $val): mixed { - if ($val instanceof ToArrayInterface) { - return $val->toArray(); - } + protected function callToArray(mixed $val): mixed { + if ($val instanceof ToArrayInterface) { + return $val->toArray(); + } + + if ($val instanceof \DateTimeInterface) { + return $val->format('Y-m-d H:i:s'); + } - if ($val instanceof \DateTimeInterface) { - return $val->format('Y-m-d H:i:s'); - } + if (is_array($val)) { + return array_map(fn($val1) => $this->callToArray($val1), $val); + } + + return $val; + } - return $val; - }, $this->data); + public function toArray(): array + { + return array_map(fn($val) => $this->callToArray($val), $this->data); } protected function attr(string $key): mixed diff --git a/src/Models/WebHook.php b/src/Models/WebHook.php index 51dd0e6..1e5d15b 100644 --- a/src/Models/WebHook.php +++ b/src/Models/WebHook.php @@ -16,11 +16,17 @@ public function __construct(array $data = []) $this->data = $data; } + /** + * @enum ["form","json"] + */ public function setContentType(string $content_type): void { $this->data['content_type'] = $content_type; } + /** + * @enum ["form","json"] + */ public function getContentType(): string { return $this->attr('content_type'); diff --git a/tests/Models/DocumentTest.php b/tests/Models/DocumentTest.php new file mode 100644 index 0000000..4b85f49 --- /dev/null +++ b/tests/Models/DocumentTest.php @@ -0,0 +1,30 @@ +setItems([ + $position = new DocumentPosition(), + ]); + + $position->setType('POSITION'); + $position->setNumber('31337'); + $position->setDescription('Foobar is not Barfoo!'); + + + static::assertSame(['items' => [['type' => 'POSITION', 'number' => '31337', 'description' => 'Foobar is not Barfoo!']]], $document->toArray()); + + } +} From 8a487c83b4617ea754edc1571a14b962de1527df Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 16:01:54 +0100 Subject: [PATCH 21/37] fix naming --- src/Models/Traits/Data.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Models/Traits/Data.php b/src/Models/Traits/Data.php index cc2bfa8..933d9f4 100644 --- a/src/Models/Traits/Data.php +++ b/src/Models/Traits/Data.php @@ -8,7 +8,7 @@ trait Data { protected array $data = []; - protected function callToArray(mixed $val): mixed { + protected function toArrayMap(mixed $val): mixed { if ($val instanceof ToArrayInterface) { return $val->toArray(); } @@ -18,7 +18,7 @@ protected function callToArray(mixed $val): mixed { } if (is_array($val)) { - return array_map(fn($val1) => $this->callToArray($val1), $val); + return array_map(fn($val1) => $this->toArrayMap($val1), $val); } return $val; @@ -26,7 +26,7 @@ protected function callToArray(mixed $val): mixed { public function toArray(): array { - return array_map(fn($val) => $this->callToArray($val), $this->data); + return array_map(fn($val) => $this->toArrayMap($val), $this->data); } protected function attr(string $key): mixed From 47ce1e9dae1aca53e7ead2010345ac1b477d7ea4 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 16:03:22 +0100 Subject: [PATCH 22/37] php cs fix --- src/Models/Traits/Data.php | 15 ++++++++------- tests/Models/DocumentTest.php | 2 -- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Models/Traits/Data.php b/src/Models/Traits/Data.php index 933d9f4..4bfe511 100644 --- a/src/Models/Traits/Data.php +++ b/src/Models/Traits/Data.php @@ -8,7 +8,13 @@ trait Data { protected array $data = []; - protected function toArrayMap(mixed $val): mixed { + public function toArray(): array + { + return array_map(fn ($val) => $this->toArrayMap($val), $this->data); + } + + protected function toArrayMap(mixed $val): mixed + { if ($val instanceof ToArrayInterface) { return $val->toArray(); } @@ -18,17 +24,12 @@ protected function toArrayMap(mixed $val): mixed { } if (is_array($val)) { - return array_map(fn($val1) => $this->toArrayMap($val1), $val); + return array_map(fn ($val1) => $this->toArrayMap($val1), $val); } return $val; } - public function toArray(): array - { - return array_map(fn($val) => $this->toArrayMap($val), $this->data); - } - protected function attr(string $key): mixed { if (!array_key_exists($key, $this->data)) { diff --git a/tests/Models/DocumentTest.php b/tests/Models/DocumentTest.php index 4b85f49..eaf3904 100644 --- a/tests/Models/DocumentTest.php +++ b/tests/Models/DocumentTest.php @@ -23,8 +23,6 @@ public function testPositionsToArray(): void $position->setNumber('31337'); $position->setDescription('Foobar is not Barfoo!'); - static::assertSame(['items' => [['type' => 'POSITION', 'number' => '31337', 'description' => 'Foobar is not Barfoo!']]], $document->toArray()); - } } From ac2d227de732b00e8bd2bb1d0593fc33d43e1b1f Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 16:23:45 +0100 Subject: [PATCH 23/37] Add versions to generated files --- generators/models.php | 2 ++ src/Models/Attachment.php | 5 ++++- src/Models/Contact.php | 3 +++ src/Models/Customer.php | 3 +++ src/Models/CustomerGroup.php | 3 +++ src/Models/CustomerSnapshot.php | 5 ++++- src/Models/DiscountPosition.php | 3 +++ src/Models/DiscountPositionGroup.php | 3 +++ src/Models/Document.php | 3 +++ src/Models/DocumentAddress.php | 5 ++++- src/Models/DocumentPayment.php | 3 +++ src/Models/DocumentPosition.php | 3 +++ src/Models/DocumentRecurring.php | 3 +++ src/Models/Login.php | 3 +++ src/Models/LoginSecurity.php | 5 ++++- src/Models/PDFTemplate.php | 3 +++ src/Models/Position.php | 3 +++ src/Models/PositionExportIdentifierExtended.php | 3 +++ src/Models/PositionGroup.php | 3 +++ src/Models/PostBox.php | 3 +++ src/Models/PostBoxRequest.php | 3 +++ src/Models/Project.php | 3 +++ src/Models/SEPAPayment.php | 3 +++ src/Models/SerialNumber.php | 3 +++ src/Models/ServiceDate.php | 3 +++ src/Models/Stock.php | 3 +++ src/Models/Task.php | 3 +++ src/Models/TextTemplate.php | 3 +++ src/Models/TimeTracking.php | 3 +++ src/Models/WebHook.php | 3 +++ src/Models/WebHookLastResponse.php | 3 +++ 31 files changed, 96 insertions(+), 4 deletions(-) diff --git a/generators/models.php b/generators/models.php index 5341160..63387bd 100644 --- a/generators/models.php +++ b/generators/models.php @@ -72,6 +72,8 @@ function typeMap(string $type): string $file->setStrictTypes(); $class = $file->addClass(classWithNamespace($className)); $class->addComment('Auto-generated with `composer sdk:models`'); + $class->addComment('@version swagger ' . $swagger['info']['version']); + $class->addComment('@version rest v1'); if ('' !== $classInfo['description']) { $class->addComment($classInfo['description']); diff --git a/src/Models/Attachment.php b/src/Models/Attachment.php index a1a3314..bc0d237 100644 --- a/src/Models/Attachment.php +++ b/src/Models/Attachment.php @@ -5,7 +5,10 @@ namespace easybill\SDK\Models; /** - * Auto-generated with `composer sdk:models` + * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 * If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination). */ class Attachment implements ToArrayInterface diff --git a/src/Models/Contact.php b/src/Models/Contact.php index c042449..e69e1dd 100644 --- a/src/Models/Contact.php +++ b/src/Models/Contact.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class Contact implements ToArrayInterface { diff --git a/src/Models/Customer.php b/src/Models/Customer.php index d4d64cd..20e2887 100644 --- a/src/Models/Customer.php +++ b/src/Models/Customer.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class Customer implements ToArrayInterface { diff --git a/src/Models/CustomerGroup.php b/src/Models/CustomerGroup.php index d2dc8ff..e11ef67 100644 --- a/src/Models/CustomerGroup.php +++ b/src/Models/CustomerGroup.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class CustomerGroup implements ToArrayInterface { diff --git a/src/Models/CustomerSnapshot.php b/src/Models/CustomerSnapshot.php index 9e3f2ea..6da4cd4 100644 --- a/src/Models/CustomerSnapshot.php +++ b/src/Models/CustomerSnapshot.php @@ -5,7 +5,10 @@ namespace easybill\SDK\Models; /** - * Auto-generated with `composer sdk:models` + * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 * A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state. */ class CustomerSnapshot implements ToArrayInterface diff --git a/src/Models/DiscountPosition.php b/src/Models/DiscountPosition.php index 448311f..d2d8270 100644 --- a/src/Models/DiscountPosition.php +++ b/src/Models/DiscountPosition.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class DiscountPosition implements ToArrayInterface { diff --git a/src/Models/DiscountPositionGroup.php b/src/Models/DiscountPositionGroup.php index d87eb20..43d7b91 100644 --- a/src/Models/DiscountPositionGroup.php +++ b/src/Models/DiscountPositionGroup.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class DiscountPositionGroup implements ToArrayInterface { diff --git a/src/Models/Document.php b/src/Models/Document.php index c973151..6d6058a 100644 --- a/src/Models/Document.php +++ b/src/Models/Document.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class Document implements ToArrayInterface { diff --git a/src/Models/DocumentAddress.php b/src/Models/DocumentAddress.php index 6dff533..3e1c62a 100644 --- a/src/Models/DocumentAddress.php +++ b/src/Models/DocumentAddress.php @@ -5,7 +5,10 @@ namespace easybill\SDK\Models; /** - * Auto-generated with `composer sdk:models` + * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 * This information comes from the customer which can be set with customer_id. */ class DocumentAddress implements ToArrayInterface diff --git a/src/Models/DocumentPayment.php b/src/Models/DocumentPayment.php index e8a2ab1..d22d23d 100644 --- a/src/Models/DocumentPayment.php +++ b/src/Models/DocumentPayment.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class DocumentPayment implements ToArrayInterface { diff --git a/src/Models/DocumentPosition.php b/src/Models/DocumentPosition.php index 3a10909..0c9786d 100644 --- a/src/Models/DocumentPosition.php +++ b/src/Models/DocumentPosition.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class DocumentPosition implements ToArrayInterface { diff --git a/src/Models/DocumentRecurring.php b/src/Models/DocumentRecurring.php index 140473f..d9e6cff 100644 --- a/src/Models/DocumentRecurring.php +++ b/src/Models/DocumentRecurring.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class DocumentRecurring implements ToArrayInterface { diff --git a/src/Models/Login.php b/src/Models/Login.php index 452ce51..8b86952 100644 --- a/src/Models/Login.php +++ b/src/Models/Login.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class Login implements ToArrayInterface { diff --git a/src/Models/LoginSecurity.php b/src/Models/LoginSecurity.php index 6880b2c..687cfae 100644 --- a/src/Models/LoginSecurity.php +++ b/src/Models/LoginSecurity.php @@ -5,7 +5,10 @@ namespace easybill\SDK\Models; /** - * Auto-generated with `composer sdk:models` + * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 * This object is only displayed if your request the login resource as an admin. Otherwise this property will be null. */ class LoginSecurity implements ToArrayInterface diff --git a/src/Models/PDFTemplate.php b/src/Models/PDFTemplate.php index 46cf18e..7fbf772 100644 --- a/src/Models/PDFTemplate.php +++ b/src/Models/PDFTemplate.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class PDFTemplate implements ToArrayInterface { diff --git a/src/Models/Position.php b/src/Models/Position.php index 692cf18..93942d5 100644 --- a/src/Models/Position.php +++ b/src/Models/Position.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class Position implements ToArrayInterface { diff --git a/src/Models/PositionExportIdentifierExtended.php b/src/Models/PositionExportIdentifierExtended.php index 35504e0..5d48183 100644 --- a/src/Models/PositionExportIdentifierExtended.php +++ b/src/Models/PositionExportIdentifierExtended.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class PositionExportIdentifierExtended implements ToArrayInterface { diff --git a/src/Models/PositionGroup.php b/src/Models/PositionGroup.php index 04bb065..917df10 100644 --- a/src/Models/PositionGroup.php +++ b/src/Models/PositionGroup.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class PositionGroup implements ToArrayInterface { diff --git a/src/Models/PostBox.php b/src/Models/PostBox.php index 6889698..120d535 100644 --- a/src/Models/PostBox.php +++ b/src/Models/PostBox.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class PostBox implements ToArrayInterface { diff --git a/src/Models/PostBoxRequest.php b/src/Models/PostBoxRequest.php index 0323efe..cbe3f79 100644 --- a/src/Models/PostBoxRequest.php +++ b/src/Models/PostBoxRequest.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class PostBoxRequest implements ToArrayInterface { diff --git a/src/Models/Project.php b/src/Models/Project.php index 01b92e8..da07975 100644 --- a/src/Models/Project.php +++ b/src/Models/Project.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class Project implements ToArrayInterface { diff --git a/src/Models/SEPAPayment.php b/src/Models/SEPAPayment.php index 3deae65..388bab7 100644 --- a/src/Models/SEPAPayment.php +++ b/src/Models/SEPAPayment.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class SEPAPayment implements ToArrayInterface { diff --git a/src/Models/SerialNumber.php b/src/Models/SerialNumber.php index 77cd7c9..93decb1 100644 --- a/src/Models/SerialNumber.php +++ b/src/Models/SerialNumber.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class SerialNumber implements ToArrayInterface { diff --git a/src/Models/ServiceDate.php b/src/Models/ServiceDate.php index 34a4d29..ebd6490 100644 --- a/src/Models/ServiceDate.php +++ b/src/Models/ServiceDate.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class ServiceDate implements ToArrayInterface { diff --git a/src/Models/Stock.php b/src/Models/Stock.php index ae864e7..b8216f5 100644 --- a/src/Models/Stock.php +++ b/src/Models/Stock.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class Stock implements ToArrayInterface { diff --git a/src/Models/Task.php b/src/Models/Task.php index 8db8105..79fd2d2 100644 --- a/src/Models/Task.php +++ b/src/Models/Task.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class Task implements ToArrayInterface { diff --git a/src/Models/TextTemplate.php b/src/Models/TextTemplate.php index 0c95090..56487fe 100644 --- a/src/Models/TextTemplate.php +++ b/src/Models/TextTemplate.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class TextTemplate implements ToArrayInterface { diff --git a/src/Models/TimeTracking.php b/src/Models/TimeTracking.php index 6583ae4..3f1d4ff 100644 --- a/src/Models/TimeTracking.php +++ b/src/Models/TimeTracking.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class TimeTracking implements ToArrayInterface { diff --git a/src/Models/WebHook.php b/src/Models/WebHook.php index 1e5d15b..ac9fba0 100644 --- a/src/Models/WebHook.php +++ b/src/Models/WebHook.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class WebHook implements ToArrayInterface { diff --git a/src/Models/WebHookLastResponse.php b/src/Models/WebHookLastResponse.php index e1b29be..64a31ee 100644 --- a/src/Models/WebHookLastResponse.php +++ b/src/Models/WebHookLastResponse.php @@ -6,6 +6,9 @@ /** * Auto-generated with `composer sdk:models`. + * + * @version swagger 1.68.0 + * @version rest v1 */ class WebHookLastResponse implements ToArrayInterface { From 38968c80694522cc7a0cf6e0837c9ccdc54d289b Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Tue, 21 Dec 2021 16:35:45 +0100 Subject: [PATCH 24/37] Update composer scripts descriptions --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a9eb320..6f71a30 100644 --- a/composer.json +++ b/composer.json @@ -48,6 +48,7 @@ }, "scripts-descriptions": { "sdk:models": "Gnerate models from swagger.json file.", - "sdk:cs-fix": "Run php-cs-fixer to reformat php files." + "sdk:cs-fix": "Run php-cs-fixer to reformat php files.", + "sdk:test": "Run test with PHPUnit" } } From ad6eeacc48357f215cdd7284d884d05e5b0ac6c8 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 22 Dec 2021 11:45:33 +0100 Subject: [PATCH 25/37] Add date time support --- generators/models.php | 2 ++ src/Models/Document.php | 4 ++-- src/Models/PostBox.php | 4 ++-- src/Models/SEPAPayment.php | 4 ++-- src/Models/Task.php | 8 ++++---- src/Models/TimeTracking.php | 8 ++++---- src/Models/WebHookLastResponse.php | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/generators/models.php b/generators/models.php index 63387bd..e3ed3ed 100644 --- a/generators/models.php +++ b/generators/models.php @@ -149,6 +149,8 @@ function typeMap(string $type): string $getter->setBody('return $this->attrInstance(\'' . $propertyName . '\', \\' . $type . '::class);'); } elseif ('date' === $propertyInfo['format']) { $getter->setBody('return $this->attrDate(\'' . $propertyName . '\');'); + } elseif ('date-time' === $propertyInfo['format']) { + $getter->setBody('return $this->attrDateTime(\'' . $propertyName . '\');'); } else { $getter->setBody('return $this->attr(\'' . $propertyName . '\');'); } diff --git a/src/Models/Document.php b/src/Models/Document.php index 6d6058a..a33faba 100644 --- a/src/Models/Document.php +++ b/src/Models/Document.php @@ -147,7 +147,7 @@ public function getContactText(): string public function getCreatedAt(): \DateTimeImmutable { - return $this->attr('created_at'); + return $this->attrDateTime('created_at'); } public function setCurrency(string $currency): void @@ -218,7 +218,7 @@ public function getDueDate(): \DateTimeImmutable public function getEditedAt(): \DateTimeImmutable { - return $this->attr('edited_at'); + return $this->attrDateTime('edited_at'); } public function setExternalId(?string $external_id): void diff --git a/src/Models/PostBox.php b/src/Models/PostBox.php index 120d535..1c18888 100644 --- a/src/Models/PostBox.php +++ b/src/Models/PostBox.php @@ -101,7 +101,7 @@ public function setCreatedAt(\DateTimeImmutable $created_at): void public function getCreatedAt(): \DateTimeImmutable { - return $this->attr('created_at'); + return $this->attrDateTime('created_at'); } public function setProcessedAt(\DateTimeImmutable $processed_at): void @@ -111,7 +111,7 @@ public function setProcessedAt(\DateTimeImmutable $processed_at): void public function getProcessedAt(): \DateTimeImmutable { - return $this->attr('processed_at'); + return $this->attrDateTime('processed_at'); } public function setSendBySelf(bool $send_by_self): void diff --git a/src/Models/SEPAPayment.php b/src/Models/SEPAPayment.php index 388bab7..6c409a8 100644 --- a/src/Models/SEPAPayment.php +++ b/src/Models/SEPAPayment.php @@ -34,7 +34,7 @@ public function getAmount(): int public function getCreatedAt(): \DateTimeImmutable { - return $this->attr('created_at'); + return $this->attrDateTime('created_at'); } /** @@ -174,7 +174,7 @@ public function setExportAt(?\DateTimeImmutable $export_at): void public function getExportAt(): ?\DateTimeImmutable { - return $this->attr('export_at'); + return $this->attrDateTime('export_at'); } public function getExportError(): string diff --git a/src/Models/Task.php b/src/Models/Task.php index 79fd2d2..cbf570d 100644 --- a/src/Models/Task.php +++ b/src/Models/Task.php @@ -50,7 +50,7 @@ public function getCategoryCustom(): ?string public function getCreatedAt(): \DateTimeImmutable { - return $this->attr('created_at'); + return $this->attrDateTime('created_at'); } public function setCustomerId(?int $customer_id): void @@ -93,12 +93,12 @@ public function setEndAt(?\DateTimeImmutable $end_at): void public function getEndAt(): ?\DateTimeImmutable { - return $this->attr('end_at'); + return $this->attrDateTime('end_at'); } public function getFinishAt(): ?\DateTimeImmutable { - return $this->attr('finish_at'); + return $this->attrDateTime('finish_at'); } public function getId(): int @@ -172,7 +172,7 @@ public function setStartAt(?\DateTimeImmutable $start_at): void public function getStartAt(): ?\DateTimeImmutable { - return $this->attr('start_at'); + return $this->attrDateTime('start_at'); } /** diff --git a/src/Models/TimeTracking.php b/src/Models/TimeTracking.php index 3f1d4ff..ba3860c 100644 --- a/src/Models/TimeTracking.php +++ b/src/Models/TimeTracking.php @@ -26,12 +26,12 @@ public function setClearedAt(?\DateTimeImmutable $cleared_at): void public function getClearedAt(): ?\DateTimeImmutable { - return $this->attr('cleared_at'); + return $this->attrDateTime('cleared_at'); } public function getCreatedAt(): \DateTimeImmutable { - return $this->attr('created_at'); + return $this->attrDateTime('created_at'); } public function setDateFromAt(?\DateTimeImmutable $date_from_at): void @@ -41,7 +41,7 @@ public function setDateFromAt(?\DateTimeImmutable $date_from_at): void public function getDateFromAt(): ?\DateTimeImmutable { - return $this->attr('date_from_at'); + return $this->attrDateTime('date_from_at'); } public function setDateThruAt(?\DateTimeImmutable $date_thru_at): void @@ -51,7 +51,7 @@ public function setDateThruAt(?\DateTimeImmutable $date_thru_at): void public function getDateThruAt(): ?\DateTimeImmutable { - return $this->attr('date_thru_at'); + return $this->attrDateTime('date_thru_at'); } public function setDescription(string $description): void diff --git a/src/Models/WebHookLastResponse.php b/src/Models/WebHookLastResponse.php index 64a31ee..3093ec8 100644 --- a/src/Models/WebHookLastResponse.php +++ b/src/Models/WebHookLastResponse.php @@ -21,7 +21,7 @@ public function __construct(array $data = []) public function getDate(): \DateTimeImmutable { - return $this->attr('date'); + return $this->attrDateTime('date'); } public function getCode(): int From 724e08fb1c921002351e5b84ac298f2488b5704d Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 22 Dec 2021 13:20:48 +0100 Subject: [PATCH 26/37] Add support for array with object items --- generators/models.php | 2 ++ src/Models/Document.php | 2 +- src/Models/Traits/Data.php | 13 +++++++++++++ tests/Models/DocumentTest.php | 11 +++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/generators/models.php b/generators/models.php index e3ed3ed..4a0fd52 100644 --- a/generators/models.php +++ b/generators/models.php @@ -151,6 +151,8 @@ function typeMap(string $type): string $getter->setBody('return $this->attrDate(\'' . $propertyName . '\');'); } elseif ('date-time' === $propertyInfo['format']) { $getter->setBody('return $this->attrDateTime(\'' . $propertyName . '\');'); + } elseif ('array' === $type && array_key_exists('$ref', $propertyInfo['items'])) { + $getter->setBody('return $this->attrInstances(\'' . $propertyName . '\', ' . classNameFromRef($propertyInfo['items']['$ref']) . '::class);'); } else { $getter->setBody('return $this->attr(\'' . $propertyName . '\');'); } diff --git a/src/Models/Document.php b/src/Models/Document.php index a33faba..8cb141f 100644 --- a/src/Models/Document.php +++ b/src/Models/Document.php @@ -349,7 +349,7 @@ public function setItems(array $items): void */ public function getItems(): array { - return $this->attr('items'); + return $this->attrInstances('items', DocumentPosition::class); } public function getLastPostboxId(): int diff --git a/src/Models/Traits/Data.php b/src/Models/Traits/Data.php index 4bfe511..27b1e3c 100644 --- a/src/Models/Traits/Data.php +++ b/src/Models/Traits/Data.php @@ -49,6 +49,19 @@ protected function attrInstance(string $key, string $className): mixed return $this->data[$key] = new $className($data); } + protected function attrInstances(string $key, string $className): array + { + $data = $this->attr($key); + if (!is_array($data)) { + throw new \RuntimeException(sprintf('Attr "%s" not found an array.', $key)); + } + if ([] === $data) { + return $data; + } + + return $this->data[$key] = array_map(static fn (object|array $item): object => is_array($item) ? new $className($item) : $item, $data); + } + protected function attrDate(string $key): ?\DateTimeImmutable { $data = $this->attr($key); diff --git a/tests/Models/DocumentTest.php b/tests/Models/DocumentTest.php index eaf3904..a0239b1 100644 --- a/tests/Models/DocumentTest.php +++ b/tests/Models/DocumentTest.php @@ -25,4 +25,15 @@ public function testPositionsToArray(): void static::assertSame(['items' => [['type' => 'POSITION', 'number' => '31337', 'description' => 'Foobar is not Barfoo!']]], $document->toArray()); } + + public function testPositionsArrayToInstaces(): void + { + $document = new Document([ + 'items' => [ + ['number' => '31337'], + ], + ]); + + static::assertSame('31337', $document->getItems()[0]->getNumber()); + } } From daa4fce91351d945aba26b8afbbaf3ee1a07f56a Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 22 Dec 2021 13:25:45 +0100 Subject: [PATCH 27/37] Improve phpdoc --- generators/models.php | 5 ++++- src/Models/Document.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/generators/models.php b/generators/models.php index 4a0fd52..9b0c118 100644 --- a/generators/models.php +++ b/generators/models.php @@ -129,6 +129,9 @@ function typeMap(string $type): string if ($propertyInfo['x-nullable']) { $property->setNullable(); } + if ('array' === $type && array_key_exists('$ref', $propertyInfo['items'])) { + $setter->addComment('@param ' . classNameFromRef($propertyInfo['items']['$ref']) . '[] $' . $propertyName); + } if ($propertyInfo['enum']) { $setter->addComment('@enum ' . json_encode($propertyInfo['enum'], JSON_THROW_ON_ERROR)); } @@ -143,7 +146,7 @@ function typeMap(string $type): string $getter->addComment('@return ' . typeMap($propertyInfo['items']['type']) . '[]'); } if ('array' === $type && array_key_exists('$ref', $propertyInfo['items'])) { - $getter->addComment('@return \\' . classWithNamespace(classNameFromRef($propertyInfo['items']['$ref'])) . '[]'); + $getter->addComment('@return ' . classNameFromRef($propertyInfo['items']['$ref']) . '[]'); } if ($isObject) { $getter->setBody('return $this->attrInstance(\'' . $propertyName . '\', \\' . $type . '::class);'); diff --git a/src/Models/Document.php b/src/Models/Document.php index 8cb141f..99f180b 100644 --- a/src/Models/Document.php +++ b/src/Models/Document.php @@ -339,13 +339,16 @@ public function getItemNotes(): array return $this->attr('item_notes'); } + /** + * @param DocumentPosition[] $items + */ public function setItems(array $items): void { $this->data['items'] = $items; } /** - * @return \easybill\SDK\Models\DocumentPosition[] + * @return DocumentPosition[] */ public function getItems(): array { From d5483f2ff5b8d6bfab45c899d85ebae26c77e45e Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 22 Dec 2021 14:57:43 +0100 Subject: [PATCH 28/37] update readme --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5235c10..f0e97fc 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,26 @@ composer require easybill/php-sdk ```php use easybill\SDK\Client; use easybill\SDK\Endpoint; +use easybill\SDK\Models\Customer; $client = new Client(new Endpoint('... your API key ...')); -$result = $client->request('GET', 'documents'); +$customerCreate = new Customer(); +$customerCreate->setFirstName('Foo'); +$customerCreate->setLastName('Bar'); +$customerCreate->setCompanyName('FooBar GmbH'); +$customerCreate->setEmails(['foo.bar@foobar.com']); -print_r($result); +$result = $client->request('POST', 'customers', $customerCreate->toArray()); + +$customer = new Customer($result); + +var_dump($customer) ``` ## More examples -Check the **examples** folder and run: +Check the [examples](examples) folder and run: ```shell API_KEY= php examples/customers_01_load-list.php From f640f96bb8d3a40d4011374055e7ccfbb0e51dfb Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 22 Dec 2021 15:22:34 +0100 Subject: [PATCH 29/37] code cleanup and add some type hints --- src/Client.php | 24 ++++++++++++------------ src/HttpClient/BaseHttpClient.php | 11 ++++------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/Client.php b/src/Client.php index 4d277e5..dc5d78c 100644 --- a/src/Client.php +++ b/src/Client.php @@ -10,17 +10,17 @@ class Client { - private Endpoint $endpoint; private HttpClientInterface $httpClient; - /** @var string[] */ - private array $headers; - public function __construct(Endpoint $endpoint, ?HttpClientInterface $httpClient = null, array $headers = []) - { - $this->endpoint = $endpoint; - $this->headers = $headers; - - if ($httpClient) { + /** + * @param string[] $headers + */ + public function __construct( + private Endpoint $endpoint, + ?HttpClientInterface $httpClient = null, + private array $headers = [], + ) { + if (null !== $httpClient) { $this->httpClient = $httpClient; } else { $this->httpClient = new BaseHttpClient(new GuzzleHttpClient()); @@ -28,9 +28,9 @@ public function __construct(Endpoint $endpoint, ?HttpClientInterface $httpClient } /** - * @return mixed|string + * @throws \JsonException */ - public function request(string $method, string $uri = '', array $body = null, bool $raw = false) + public function request(string $method, string $uri = '', array $body = null, bool $raw = false): string|array { $request = new Request( $method, @@ -38,7 +38,7 @@ public function request(string $method, string $uri = '', array $body = null, bo array_merge([ 'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $this->endpoint->getApiKey(), - 'User-Agent' => 'easybill-php-sdk (rest-master)', + 'User-Agent' => 'easybill-php-sdk v4', ], $this->headers), is_array($body) ? json_encode($body, JSON_THROW_ON_ERROR) : null ); diff --git a/src/HttpClient/BaseHttpClient.php b/src/HttpClient/BaseHttpClient.php index def419b..a2d95db 100644 --- a/src/HttpClient/BaseHttpClient.php +++ b/src/HttpClient/BaseHttpClient.php @@ -10,16 +10,13 @@ class BaseHttpClient implements HttpClientInterface { - private HttpClientInterface $httpClient; - private int $maxApiCallsPerMinute; - /** @var int[] */ private array $apiCalls = []; - public function __construct(HttpClientInterface $httpClient, int $maxApiCallsPerMinute = 60) - { - $this->httpClient = $httpClient; - $this->maxApiCallsPerMinute = $maxApiCallsPerMinute; + public function __construct( + private HttpClientInterface $httpClient, + private int $maxApiCallsPerMinute = 60, + ) { } public function send(RequestInterface $request, array $options = []): ResponseInterface From 1b7ac02943627ff303da74b807d9ef34d3c933e8 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 22 Dec 2021 15:54:48 +0100 Subject: [PATCH 30/37] Add UPGRADE.md --- UPGRADE.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 UPGRADE.md diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 0000000..a1748ea --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,8 @@ +easybill PHP SDK Upgrade Guide +============================== + +3.0 to 4.0 +---------- + +- Namespace from `easybill\` to `Easybill\` +- Requires min PHP 8.0 \ No newline at end of file From 72adc533ef4049f42d0bbf8045e5cd7879e45fb4 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 22 Dec 2021 15:57:52 +0100 Subject: [PATCH 31/37] Rename namespace --- README.md | 6 +++--- composer.json | 4 ++-- examples/customers_01_load-list.php | 4 ++-- examples/customers_02_create.php | 4 ++-- examples/customers_03_update.php | 4 ++-- examples/customers_04_delete.php | 4 ++-- examples/documents_01_load-list.php | 4 ++-- examples/documents_02_filter-by-number.php | 4 ++-- examples/documents_03_load-page-2.php | 4 ++-- examples/documents_04_create.php | 4 ++-- examples/documents_05_pdf_download.php | 4 ++-- examples/with_models/customers_create.php | 6 +++--- examples/with_models/logins_list.php | 6 +++--- generators/models.php | 6 +++--- src/Client.php | 6 +++--- src/Endpoint.php | 2 +- src/HttpClient/BaseHttpClient.php | 4 ++-- src/HttpClient/GuzzleHttpClient.php | 4 ++-- src/HttpClientInterface.php | 2 +- src/Models/Attachment.php | 2 +- src/Models/Contact.php | 2 +- src/Models/Customer.php | 2 +- src/Models/CustomerGroup.php | 2 +- src/Models/CustomerSnapshot.php | 2 +- src/Models/DiscountPosition.php | 2 +- src/Models/DiscountPositionGroup.php | 2 +- src/Models/Document.php | 12 ++++++------ src/Models/DocumentAddress.php | 2 +- src/Models/DocumentPayment.php | 2 +- src/Models/DocumentPosition.php | 2 +- src/Models/DocumentRecurring.php | 2 +- src/Models/Login.php | 4 ++-- src/Models/LoginSecurity.php | 2 +- src/Models/PDFTemplate.php | 2 +- src/Models/Position.php | 4 ++-- src/Models/PositionExportIdentifierExtended.php | 2 +- src/Models/PositionGroup.php | 2 +- src/Models/PostBox.php | 2 +- src/Models/PostBoxRequest.php | 2 +- src/Models/Project.php | 2 +- src/Models/SEPAPayment.php | 2 +- src/Models/SerialNumber.php | 2 +- src/Models/ServiceDate.php | 2 +- src/Models/Stock.php | 2 +- src/Models/Task.php | 2 +- src/Models/TextTemplate.php | 2 +- src/Models/TimeTracking.php | 2 +- src/Models/ToArrayInterface.php | 2 +- src/Models/Traits/Data.php | 4 ++-- src/Models/WebHook.php | 4 ++-- src/Models/WebHookLastResponse.php | 2 +- tests/Models/CustomerTest.php | 4 ++-- tests/Models/DocumentTest.php | 6 +++--- tests/Models/PositionTest.php | 6 +++--- 54 files changed, 90 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index f0e97fc..00b0bf9 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ composer require easybill/php-sdk ## Usage ```php -use easybill\SDK\Client; -use easybill\SDK\Endpoint; -use easybill\SDK\Models\Customer; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; +use Easybill\SDK\Models\Customer; $client = new Client(new Endpoint('... your API key ...')); diff --git a/composer.json b/composer.json index 6f71a30..ebbb181 100644 --- a/composer.json +++ b/composer.json @@ -25,12 +25,12 @@ }, "autoload": { "psr-4": { - "easybill\\SDK\\": "src/" + "Easybill\\SDK\\": "src/" } }, "autoload-dev": { "psr-4": { - "easybill\\SDK\\Tests\\": "tests/" + "Easybill\\SDK\\Tests\\": "tests/" } }, "require-dev": { diff --git a/examples/customers_01_load-list.php b/examples/customers_01_load-list.php index 131f65d..9b4ac8e 100644 --- a/examples/customers_01_load-list.php +++ b/examples/customers_01_load-list.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/customers_02_create.php b/examples/customers_02_create.php index 582555b..5186dbc 100644 --- a/examples/customers_02_create.php +++ b/examples/customers_02_create.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/customers_03_update.php b/examples/customers_03_update.php index df29ac0..dbb1dc6 100644 --- a/examples/customers_03_update.php +++ b/examples/customers_03_update.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/customers_04_delete.php b/examples/customers_04_delete.php index 0b6c102..d19694a 100644 --- a/examples/customers_04_delete.php +++ b/examples/customers_04_delete.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/documents_01_load-list.php b/examples/documents_01_load-list.php index 0fca462..d27f1c1 100644 --- a/examples/documents_01_load-list.php +++ b/examples/documents_01_load-list.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/documents_02_filter-by-number.php b/examples/documents_02_filter-by-number.php index e61655b..8fc4230 100644 --- a/examples/documents_02_filter-by-number.php +++ b/examples/documents_02_filter-by-number.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/documents_03_load-page-2.php b/examples/documents_03_load-page-2.php index 6b887d7..fc99897 100644 --- a/examples/documents_03_load-page-2.php +++ b/examples/documents_03_load-page-2.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/documents_04_create.php b/examples/documents_04_create.php index 630e971..191cb26 100644 --- a/examples/documents_04_create.php +++ b/examples/documents_04_create.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/documents_05_pdf_download.php b/examples/documents_05_pdf_download.php index 81c2ffe..6d1dd71 100644 --- a/examples/documents_05_pdf_download.php +++ b/examples/documents_05_pdf_download.php @@ -4,8 +4,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/with_models/customers_create.php b/examples/with_models/customers_create.php index ae593c0..aaa6066 100644 --- a/examples/with_models/customers_create.php +++ b/examples/with_models/customers_create.php @@ -4,9 +4,9 @@ require_once __DIR__ . '../../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; -use easybill\SDK\Models\Customer; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; +use Easybill\SDK\Models\Customer; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/examples/with_models/logins_list.php b/examples/with_models/logins_list.php index c629dee..6ccb067 100644 --- a/examples/with_models/logins_list.php +++ b/examples/with_models/logins_list.php @@ -4,9 +4,9 @@ require_once __DIR__ . '/../../vendor/autoload.php'; -use easybill\SDK\Client; -use easybill\SDK\Endpoint; -use easybill\SDK\Models\Login; +use Easybill\SDK\Client; +use Easybill\SDK\Endpoint; +use Easybill\SDK\Models\Login; $client = new Client(new Endpoint(getenv('API_KEY'))); diff --git a/generators/models.php b/generators/models.php index 9b0c118..95b47c3 100644 --- a/generators/models.php +++ b/generators/models.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use easybill\SDK\Models\ToArrayInterface; -use easybill\SDK\Models\Traits\Data; +use Easybill\SDK\Models\ToArrayInterface; +use Easybill\SDK\Models\Traits\Data; require_once __DIR__ . '/../vendor/autoload.php'; @@ -19,7 +19,7 @@ function classNameFromRef(string $ref): string function classWithNamespace(string $className): string { - $namespace = str_contains($className, 'ResultList') ? 'easybill\SDK\ResultLists\\' : 'easybill\SDK\Models\\'; + $namespace = str_contains($className, 'ResultList') ? 'Easybill\SDK\ResultLists\\' : 'Easybill\SDK\Models\\'; return $namespace . $className; } diff --git a/src/Client.php b/src/Client.php index dc5d78c..c80a1c4 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,9 +1,9 @@ attrInstance('address', \easybill\SDK\Models\DocumentAddress::class); + return $this->attrInstance('address', \Easybill\SDK\Models\DocumentAddress::class); } /** @@ -34,7 +34,7 @@ public function getAttachmentIds(): array public function getLabelAddress(): DocumentAddress { - return $this->attrInstance('label_address', \easybill\SDK\Models\DocumentAddress::class); + return $this->attrInstance('label_address', \Easybill\SDK\Models\DocumentAddress::class); } public function getAmount(): int @@ -172,7 +172,7 @@ public function getCustomerId(): ?int public function getCustomerSnapshot(): CustomerSnapshot { - return $this->attrInstance('customer_snapshot', \easybill\SDK\Models\CustomerSnapshot::class); + return $this->attrInstance('customer_snapshot', \Easybill\SDK\Models\CustomerSnapshot::class); } public function setDiscount(?string $discount): void @@ -451,7 +451,7 @@ public function setRecurringOptions(DocumentRecurring $recurring_options): void public function getRecurringOptions(): DocumentRecurring { - return $this->attrInstance('recurring_options', \easybill\SDK\Models\DocumentRecurring::class); + return $this->attrInstance('recurring_options', \Easybill\SDK\Models\DocumentRecurring::class); } /** @@ -477,7 +477,7 @@ public function setServiceDate(ServiceDate $service_date): void public function getServiceDate(): ServiceDate { - return $this->attrInstance('service_date', \easybill\SDK\Models\ServiceDate::class); + return $this->attrInstance('service_date', \Easybill\SDK\Models\ServiceDate::class); } public function setShippingCountry(?string $shipping_country): void diff --git a/src/Models/DocumentAddress.php b/src/Models/DocumentAddress.php index 3e1c62a..a94651d 100644 --- a/src/Models/DocumentAddress.php +++ b/src/Models/DocumentAddress.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/DocumentPayment.php b/src/Models/DocumentPayment.php index d22d23d..a4ecdc5 100644 --- a/src/Models/DocumentPayment.php +++ b/src/Models/DocumentPayment.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/DocumentPosition.php b/src/Models/DocumentPosition.php index 0c9786d..2e039e7 100644 --- a/src/Models/DocumentPosition.php +++ b/src/Models/DocumentPosition.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/DocumentRecurring.php b/src/Models/DocumentRecurring.php index d9e6cff..e6b6fdb 100644 --- a/src/Models/DocumentRecurring.php +++ b/src/Models/DocumentRecurring.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/Login.php b/src/Models/Login.php index 8b86952..5d02a58 100644 --- a/src/Models/Login.php +++ b/src/Models/Login.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. @@ -122,6 +122,6 @@ public function setSecurity(LoginSecurity $security): void public function getSecurity(): LoginSecurity { - return $this->attrInstance('security', \easybill\SDK\Models\LoginSecurity::class); + return $this->attrInstance('security', \Easybill\SDK\Models\LoginSecurity::class); } } diff --git a/src/Models/LoginSecurity.php b/src/Models/LoginSecurity.php index 687cfae..4c330b9 100644 --- a/src/Models/LoginSecurity.php +++ b/src/Models/LoginSecurity.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/PDFTemplate.php b/src/Models/PDFTemplate.php index 7fbf772..e05b399 100644 --- a/src/Models/PDFTemplate.php +++ b/src/Models/PDFTemplate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/Position.php b/src/Models/Position.php index 93942d5..b1078e6 100644 --- a/src/Models/Position.php +++ b/src/Models/Position.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. @@ -119,7 +119,7 @@ public function setExportIdentifierExtended(PositionExportIdentifierExtended $ex public function getExportIdentifierExtended(): PositionExportIdentifierExtended { - return $this->attrInstance('export_identifier_extended', \easybill\SDK\Models\PositionExportIdentifierExtended::class); + return $this->attrInstance('export_identifier_extended', \Easybill\SDK\Models\PositionExportIdentifierExtended::class); } public function getLoginId(): int diff --git a/src/Models/PositionExportIdentifierExtended.php b/src/Models/PositionExportIdentifierExtended.php index 5d48183..bb309ed 100644 --- a/src/Models/PositionExportIdentifierExtended.php +++ b/src/Models/PositionExportIdentifierExtended.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/PositionGroup.php b/src/Models/PositionGroup.php index 917df10..394872f 100644 --- a/src/Models/PositionGroup.php +++ b/src/Models/PositionGroup.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/PostBox.php b/src/Models/PostBox.php index 1c18888..c1a9b27 100644 --- a/src/Models/PostBox.php +++ b/src/Models/PostBox.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/PostBoxRequest.php b/src/Models/PostBoxRequest.php index cbe3f79..b2997e3 100644 --- a/src/Models/PostBoxRequest.php +++ b/src/Models/PostBoxRequest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/Project.php b/src/Models/Project.php index da07975..0438ce6 100644 --- a/src/Models/Project.php +++ b/src/Models/Project.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/SEPAPayment.php b/src/Models/SEPAPayment.php index 6c409a8..f113a65 100644 --- a/src/Models/SEPAPayment.php +++ b/src/Models/SEPAPayment.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/SerialNumber.php b/src/Models/SerialNumber.php index 93decb1..a2fc342 100644 --- a/src/Models/SerialNumber.php +++ b/src/Models/SerialNumber.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/ServiceDate.php b/src/Models/ServiceDate.php index ebd6490..ef68b5c 100644 --- a/src/Models/ServiceDate.php +++ b/src/Models/ServiceDate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/Stock.php b/src/Models/Stock.php index b8216f5..42d6035 100644 --- a/src/Models/Stock.php +++ b/src/Models/Stock.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/Task.php b/src/Models/Task.php index cbf570d..3746c24 100644 --- a/src/Models/Task.php +++ b/src/Models/Task.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/TextTemplate.php b/src/Models/TextTemplate.php index 56487fe..5de9f9b 100644 --- a/src/Models/TextTemplate.php +++ b/src/Models/TextTemplate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/TimeTracking.php b/src/Models/TimeTracking.php index ba3860c..2941115 100644 --- a/src/Models/TimeTracking.php +++ b/src/Models/TimeTracking.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/src/Models/ToArrayInterface.php b/src/Models/ToArrayInterface.php index 7d65d13..92538b3 100644 --- a/src/Models/ToArrayInterface.php +++ b/src/Models/ToArrayInterface.php @@ -1,6 +1,6 @@ attrInstance('last_response', \easybill\SDK\Models\WebHookLastResponse::class); + return $this->attrInstance('last_response', \Easybill\SDK\Models\WebHookLastResponse::class); } public function setSecret(string $secret): void diff --git a/src/Models/WebHookLastResponse.php b/src/Models/WebHookLastResponse.php index 3093ec8..042e0ff 100644 --- a/src/Models/WebHookLastResponse.php +++ b/src/Models/WebHookLastResponse.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace easybill\SDK\Models; +namespace Easybill\SDK\Models; /** * Auto-generated with `composer sdk:models`. diff --git a/tests/Models/CustomerTest.php b/tests/Models/CustomerTest.php index 9981341..e9f682c 100644 --- a/tests/Models/CustomerTest.php +++ b/tests/Models/CustomerTest.php @@ -1,8 +1,8 @@ Date: Wed, 22 Dec 2021 16:27:27 +0100 Subject: [PATCH 32/37] add declare(strict_types=1) to all php files --- src/Client.php | 2 ++ src/Endpoint.php | 2 ++ src/HttpClient/BaseHttpClient.php | 2 ++ src/HttpClient/GuzzleHttpClient.php | 2 ++ src/HttpClientInterface.php | 2 ++ src/Models/.gitkeep | 0 src/Models/Traits/Data.php | 2 ++ 7 files changed, 12 insertions(+) delete mode 100644 src/Models/.gitkeep diff --git a/src/Client.php b/src/Client.php index c80a1c4..ba319ef 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,5 +1,7 @@ Date: Wed, 19 Jan 2022 20:35:08 +0100 Subject: [PATCH 33/37] Update models from url. --- generators/models.php | 2 +- generators/swagger.json | 6924 ----------------- src/Models/Attachment.php | 2 +- src/Models/Contact.php | 2 +- src/Models/Customer.php | 2 +- src/Models/CustomerGroup.php | 2 +- src/Models/CustomerSnapshot.php | 2 +- src/Models/DiscountPosition.php | 2 +- src/Models/DiscountPositionGroup.php | 2 +- src/Models/Document.php | 8 +- src/Models/DocumentAddress.php | 2 +- src/Models/DocumentPayment.php | 2 +- src/Models/DocumentPosition.php | 7 +- src/Models/DocumentRecurring.php | 3 +- src/Models/Login.php | 2 +- src/Models/LoginSecurity.php | 2 +- src/Models/PDFTemplate.php | 2 +- src/Models/Position.php | 2 +- .../PositionExportIdentifierExtended.php | 2 +- src/Models/PositionGroup.php | 2 +- src/Models/PostBox.php | 2 +- src/Models/PostBoxRequest.php | 2 +- src/Models/Project.php | 2 +- src/Models/SEPAPayment.php | 2 +- src/Models/SerialNumber.php | 2 +- src/Models/ServiceDate.php | 3 +- src/Models/Stock.php | 2 +- src/Models/Task.php | 2 +- src/Models/TextTemplate.php | 2 +- src/Models/TimeTracking.php | 2 +- src/Models/WebHook.php | 2 +- src/Models/WebHookLastResponse.php | 2 +- 32 files changed, 38 insertions(+), 6961 deletions(-) delete mode 100644 generators/swagger.json diff --git a/generators/models.php b/generators/models.php index 95b47c3..627f768 100644 --- a/generators/models.php +++ b/generators/models.php @@ -7,7 +7,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; -$swagger = json_decode(file_get_contents(__DIR__ . '/swagger.json'), true); +$swagger = json_decode(file_get_contents('https://api.easybill.de/rest/v1/swagger.json'), true); function classNameFromRef(string $ref): string { diff --git a/generators/swagger.json b/generators/swagger.json deleted file mode 100644 index 12a0bca..0000000 --- a/generators/swagger.json +++ /dev/null @@ -1,6924 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "1.68.0", - "title": "easybill REST API", - "description": "\nThe first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md)\n\n## Authentication\n\nYou can choose between two available methods: `Basic Auth` or `Bearer Token`.\n\nIn each HTTP request, one of the following HTTP headers is required:\n\n```\n# Basic Auth\nAuthorization: Basic base64_encode(':')\n# Bearer Token\nAuthorization: Bearer \n```\n\n## Limitations\n\n### Request Limit\n\n* PLUS: 10 requests per minute\n* BUSINESS: 60 requests per minute\n\nIf the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests`\n\n### Result Limit\n\nAll result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000.\n\n## Query filter\n\nMany list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`.\n\n**Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large`\n\n### Escape commas in query\n\nYou can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request.\n\n## Property login_id\n\nThis is the login of your admin or employee account.\n\n## Date and Date-Time format\nPlease use the timezone `Europe/Berlin`.\n* **date** = *Y-m-d* = `2016-12-31`\n* **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37`\n\nDate or datetime can be `null` because the attributes have been added later and the entry is older." - }, - "tags": [ - { - "name": "customer", - "description": "Everything about your customers" - }, - { - "name": "customer group", - "description": "Groups for customer" - }, - { - "name": "discount", - "description": "Discounts for positions and position groups" - }, - { - "name": "document", - "description": "Invoices, offers, etc." - }, - { - "name": "document payment" - }, - { - "name": "position" - }, - { - "name": "position group" - }, - { - "name": "project" - }, - { - "name": "task" - }, - { - "name": "text template" - }, - { - "name": "time tracking" - }, - { - "name": "sepa payment" - }, - { - "name": "serial number" - }, - { - "name": "stock" - }, - { - "name": "webhook" - }, - { - "name": "pdf templates", - "description": "PDF Templates for documents" - }, - { - "name": "logins", - "description": "Informations regarding the logins / employees" - } - ], - "host": "api.easybill.de", - "basePath": "/rest/v1", - "schemes": [ - "https" - ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "securityDefinitions": { - "Bearer": { - "type": "apiKey", - "name": "Authorization", - "in": "header", - "description": "Please use the following Format: **Bearer **" - }, - "basicAuth": { - "type": "basic" - } - }, - "security": [ - { - "Bearer": [] - }, - { - "basicAuth": [] - } - ], - "parameters": { - "LIMIT": { - "in": "query", - "name": "limit", - "description": "Limited the result. Default is 100. Maximum can be 1000.", - "type": "integer", - "required": false, - "minimum": 1, - "maximum": 1000 - }, - "PAGE": { - "in": "query", - "name": "page", - "description": "Set current Page. Default is 1.", - "type": "integer", - "required": false, - "minimum": 1 - } - }, - "paths": { - "/stocks": { - "get": { - "summary": "Fetch a list of stock entries for positions", - "tags": [ - "stock" - ], - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "position_id", - "description": "Filter stock entries by position id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "document_id", - "description": "Filter stock entries by document id.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Stocks" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "summary": "Create a stock entry for a position", - "tags": [ - "stock" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Stock" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Stock" - } - }, - "400": { - "description": "Invalid position_id or stock_count" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/stocks/{id}": { - "get": { - "summary": "Fetch an stock entry for a position", - "tags": [ - "stock" - ], - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the stock entry that needs to be fetched", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Stock" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/serial-numbers": { - "get": { - "summary": "Fetch a list of serial numbers for positions", - "tags": [ - "serial number" - ], - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "position_id", - "description": "Filter serial numbers by position id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "document_id", - "description": "Filter serial numbers by document id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "in_use", - "description": "Filter serial numbers by usage.", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/SerialNumbers" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "summary": "Create s serial number for a position", - "tags": [ - "serial number" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SerialNumber" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/SerialNumber" - } - }, - "400": { - "description": "Invalid PositionID" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/serial-numbers/{id}": { - "get": { - "summary": "Fetch a serial number for a position", - "tags": [ - "serial number" - ], - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the serial number that needs to be fetched", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/SerialNumber" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "summary": "Delete a serial number for a position", - "tags": [ - "serial number" - ], - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the serial number that needs to be deleted", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "400": { - "description": "Serial number in use. Operation failed." - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/logins": { - "get": { - "tags": [ - "logins" - ], - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Logins" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/logins/{id}": { - "get": { - "tags": [ - "logins" - ], - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the login that needs to be fetched", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Login" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/customers": { - "get": { - "tags": [ - "customer" - ], - "summary": "Fetch customers list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "group_id", - "description": "Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "additional_group_id", - "description": "Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "number", - "description": "Filter customers by number. You can add multiple numbers separate by comma like no,no,no.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "country", - "description": "Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "zip_code", - "description": "Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "emails", - "description": "Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "first_name", - "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "last_name", - "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "company_name", - "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "created_at", - "description": "Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Customers" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "customer" - ], - "summary": "Create customer", - "description": "", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Customer" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "400": { - "description": "Invalid Customer" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/customers/{id}": { - "get": { - "tags": [ - "customer" - ], - "summary": "Fetch customer", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of customer that needs to be fetched", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "customer" - ], - "summary": "Update Customer", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of customer that needs to be updated", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Customer" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "400": { - "description": "Invalid Customer" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "customer" - ], - "summary": "Delete customer", - "description": "", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of customer that needs to be deleted", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/customers/{customerId}/contacts": { - "get": { - "tags": [ - "contact" - ], - "summary": "Fetch customer contact list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "path", - "name": "customerId", - "description": "ID of customer that needs to be fetched", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Contacts" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "contact" - ], - "summary": "Create new contact", - "parameters": [ - { - "in": "path", - "name": "customerId", - "description": "ID of customer", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Contact" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Contact" - } - }, - "400": { - "description": "Invalid contact" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/customers/{customerId}/contacts/{id}": { - "get": { - "tags": [ - "contact" - ], - "summary": "Fetch contact", - "parameters": [ - { - "in": "path", - "name": "customerId", - "description": "ID of customer", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "path", - "name": "id", - "description": "ID of contact", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Contact" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "contact" - ], - "summary": "Update Contact", - "parameters": [ - { - "in": "path", - "name": "customerId", - "description": "ID of customer", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "path", - "name": "id", - "description": "ID of contact", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Contact" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Contact" - } - }, - "400": { - "description": "Invalid contact" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "contact" - ], - "summary": "Delete contact", - "description": "", - "parameters": [ - { - "in": "path", - "name": "customerId", - "description": "ID of customer", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "path", - "name": "id", - "description": "ID of contact", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/discounts/position": { - "get": { - "tags": [ - "discount" - ], - "summary": "Fetch list of position discounts", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "customer_id", - "description": "Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DiscountPositions" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "discount" - ], - "summary": "Create a new position discount", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DiscountPosition" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DiscountPosition" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/discounts/position/{id}": { - "get": { - "tags": [ - "discount" - ], - "summary": "Fetch specified position discount by id", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the discount", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DiscountPosition" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "discount" - ], - "summary": "Update a position discount", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the to be soon updated discount", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/DiscountPosition" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DiscountPosition" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "discount" - ], - "summary": "Delete the specified position discount", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the to be soon deleted discount", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/discounts/position-group": { - "get": { - "tags": [ - "discount" - ], - "summary": "Fetch list of position-group discounts", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "customer_id", - "description": "Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DiscountPositionGroups" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "discount" - ], - "summary": "Create a new position-group discount", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DiscountPositionGroup" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DiscountPositionGroup" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/discounts/position-group/{id}": { - "get": { - "tags": [ - "discount" - ], - "summary": "Fetch specified position-group discount by id", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the discount", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DiscountPositionGroup" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "discount" - ], - "summary": "Update a position-group discount", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the to be soon updated discount", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/DiscountPositionGroup" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DiscountPositionGroup" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "discount" - ], - "summary": "Delete the specified position-group discount", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of the to be soon deleted discount", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/documents": { - "get": { - "tags": [ - "document" - ], - "summary": "Fetch documents list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "type", - "description": "Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.", - "required": false, - "type": "string", - "enum": [ - "INVOICE", - "RECURRING", - "CREDIT", - "OFFER", - "REMINDER", - "DUNNING", - "STORNO", - "STORNO_CREDIT", - "DELIVERY", - "PDF", - "CHARGE", - "CHARGE_CONFIRM", - "LETTER", - "ORDER", - "PROFORMA_INVOICE", - "STORNO_PROFORMA_INVOICE" - ] - }, - { - "in": "query", - "name": "is_draft", - "description": "Filter documents by draft flag.", - "required": false, - "type": "string", - "enum": [ - "0", - "1" - ] - }, - { - "in": "query", - "name": "is_archive", - "description": "Filter documents by archive flag.", - "required": false, - "type": "string", - "enum": [ - "0", - "1" - ] - }, - { - "in": "query", - "name": "customer_id", - "description": "Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "project_id", - "description": "Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "document_date", - "description": "Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "paid_at", - "description": "Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.", - "type": "string", - "required": false - }, - { - "in": "query", - "name": "title", - "description": "Filter documents by title.", - "type": "string", - "required": false - }, - { - "in": "query", - "name": "number", - "description": "Filter documents by number.", - "type": "string", - "required": false - }, - { - "in": "query", - "name": "cancel_id", - "description": "Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "fulfillment_country", - "description": "Filter documents by fulfillment_country.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "vat_country", - "description": "Filter documents by vat_country.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "shipping_country", - "description": "Filter documents by shipping_country.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "status", - "description": "Filter documents by status. Keep in mind that not every document type has a status.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Documents" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "document" - ], - "summary": "Create document", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Document" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/documents/{id}": { - "get": { - "tags": [ - "document" - ], - "summary": "Fetch document", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "document" - ], - "summary": "Update document", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "query", - "name": "refresh_customer_data", - "description": "Forces refreshing of the customer data.", - "required": false, - "type": "boolean", - "enum": [ - "false", - "true" - ] - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Document" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "description": "Invalid Document" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "document" - ], - "summary": "Delete document", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/documents/{id}/done": { - "put": { - "tags": [ - "document" - ], - "summary": "To complete a document.", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/documents/{id}/cancel": { - "post": { - "tags": [ - "document" - ], - "summary": "Cancel document", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/documents/{id}/send/{type}": { - "post": { - "tags": [ - "document" - ], - "summary": "Send document", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "path", - "name": "type", - "required": true, - "type": "string", - "enum": [ - "email", - "fax", - "post" - ] - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostBoxRequest" - } - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/documents/{id}/pdf": { - "get": { - "tags": [ - "document" - ], - "summary": "Fetch pdf document", - "produces": [ - "application/pdf" - ], - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "type": "string", - "format": "binary" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/documents/{id}/jpg": { - "get": { - "tags": [ - "document" - ], - "summary": "Download a document as an jpeg-image", - "produces": [ - "image/jpeg" - ], - "parameters": [ - { - "in": "query", - "name": "offset", - "description": "The page of the document where the image should start.", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "in": "query", - "name": "limit", - "description": "The page of the document where the image should end.", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "in": "path", - "name": "id", - "description": "ID of document", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "type": "string", - "format": "binary" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/customer-groups": { - "get": { - "tags": [ - "customer group" - ], - "summary": "Fetch customer group list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/CustomerGroups" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "customer group" - ], - "summary": "Create customer group", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CustomerGroup" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/CustomerGroup" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/customer-groups/{id}": { - "get": { - "tags": [ - "customer group" - ], - "summary": "Fetch customer group", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of customer group", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/CustomerGroup" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "customer group" - ], - "summary": "Update customer group", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of customer goup", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CustomerGroup" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/CustomerGroup" - } - }, - "400": { - "description": "Invalid customer group" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "customer group" - ], - "summary": "Delete customer group", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of customer group", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/tasks": { - "get": { - "tags": [ - "task" - ], - "summary": "Fetch tasks list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Tasks" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "task" - ], - "summary": "Create task", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Task" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Task" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/tasks/{id}": { - "get": { - "tags": [ - "task" - ], - "summary": "Fetch task", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of task", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Task" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "task" - ], - "summary": "Update task", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of task", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Task" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Task" - } - }, - "400": { - "description": "Invalid task" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "task" - ], - "summary": "Delete task", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of task", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/projects": { - "get": { - "tags": [ - "project" - ], - "summary": "Fetch projects list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "customer_id", - "description": "Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "status", - "description": "Filter projects by status.", - "required": false, - "type": "string", - "enum": [ - "DONE", - "OPEN", - "CANCEL" - ] - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Projects" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "project" - ], - "summary": "Create project", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Project" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Project" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/projects/{id}": { - "get": { - "tags": [ - "project" - ], - "summary": "Fetch project", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of project", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Project" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "project" - ], - "summary": "Update project", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of project", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Project" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Project" - } - }, - "400": { - "description": "Invalid project" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "project" - ], - "summary": "Delete project", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of project", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/positions": { - "get": { - "tags": [ - "position" - ], - "summary": "Fetch positions list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "type", - "description": "Filter positions by type.", - "required": false, - "type": "string", - "enum": [ - "TEXT", - "PRODUCT", - "SERVICE" - ] - }, - { - "in": "query", - "name": "number", - "description": "Filter positions by number. You can add multiple numbers separate by comma like no,no,no.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Positions" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "position" - ], - "summary": "Create position", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Position" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Position" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/positions/{id}": { - "get": { - "tags": [ - "position" - ], - "summary": "Fetch position", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of position", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Position" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "position" - ], - "summary": "Update position", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of position", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Position" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Position" - } - }, - "400": { - "description": "Invalid position" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "position" - ], - "summary": "Delete position", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of position", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/position-groups": { - "get": { - "tags": [ - "position group" - ], - "summary": "Fetch position group list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/PositionGroups" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "position group" - ], - "summary": "Create position group", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PositionGroup" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/PositionGroup" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/position-groups/{id}": { - "get": { - "tags": [ - "position group" - ], - "summary": "Fetch position group", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of position group", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/PositionGroup" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "position group" - ], - "summary": "Update position group", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of position goup", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PositionGroup" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/PositionGroup" - } - }, - "400": { - "description": "Invalid position group" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "position group" - ], - "summary": "Delete position group", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of position group", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/time-trackings": { - "get": { - "tags": [ - "time tracking" - ], - "summary": "Fetch time trackings list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "login_id", - "description": "Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "project_id", - "description": "Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/TimeTrackings" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "time tracking" - ], - "summary": "Create time tracking", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TimeTracking" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/TimeTracking" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/time-trackings/{id}": { - "get": { - "tags": [ - "time tracking" - ], - "summary": "Fetch time tracking", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of time tracking", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/TimeTracking" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "time tracking" - ], - "summary": "Update time tracking", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of time tracking", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TimeTracking" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/TimeTracking" - } - }, - "400": { - "description": "Invalid time tracking" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "time tracking" - ], - "summary": "Delete time tracking", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of time tracking", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/text-templates": { - "get": { - "tags": [ - "text template" - ], - "summary": "Fetch text templates list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/TextTemplates" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "text template" - ], - "summary": "Create text template", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TextTemplate" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/TextTemplate" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/text-templates/{id}": { - "get": { - "tags": [ - "text template" - ], - "summary": "Fetch text template", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of text template", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/TextTemplate" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "text template" - ], - "summary": "Update text template", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of text template", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TextTemplate" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/TextTemplate" - } - }, - "400": { - "description": "Invalid text template" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "text template" - ], - "summary": "Delete text template", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of text template", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/attachments": { - "get": { - "tags": [ - "attachment" - ], - "summary": "Fetch attachments list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Attachments" - } - } - } - }, - "post": { - "tags": [ - "attachment" - ], - "summary": "Create attachment", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "in": "formData", - "name": "file", - "required": true, - "type": "file" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Attachment" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/attachments/{id}": { - "get": { - "tags": [ - "attachment" - ], - "summary": "Fetch attachment", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of attachment", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Attachment" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "attachment" - ], - "summary": "Update attachment", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of attachment", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Attachment" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/Attachment" - } - }, - "400": { - "description": "Invalid attachment" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "attachment" - ], - "summary": "Delete attachment", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of attachment", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/attachments/{id}/content": { - "get": { - "tags": [ - "attachment" - ], - "summary": "Fetch attachment content", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of attachment", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "type": "string", - "format": "binary" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/document-payments": { - "get": { - "tags": [ - "document payment" - ], - "summary": "Fetch document payments list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "document_id", - "description": "Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "payment_at", - "description": "Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.", - "required": false, - "type": "string" - }, - { - "in": "query", - "name": "reference", - "description": "Filter payments by reference. You can add multiple references separate by comma like id,id,id.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DocumentPayments" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "document payment" - ], - "summary": "Create document payment", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DocumentPayment" - } - }, - { - "in": "query", - "name": "paid", - "description": "Mark document as paid when amount less then payment amount.", - "required": false, - "type": "boolean" - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DocumentPayment" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/document-payments/{id}": { - "get": { - "tags": [ - "document payment" - ], - "summary": "Fetch document payment", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document payment", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/DocumentPayment" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "document payment" - ], - "summary": "Delete document payment", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of document payment", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/post-boxes": { - "get": { - "tags": [ - "post box" - ], - "summary": "Fetch post box list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "type", - "description": "Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.", - "required": false, - "type": "string", - "enum": [ - "EMAIL", - "FAX", - "POST" - ] - }, - { - "in": "query", - "name": "status", - "description": "Filter post boxes by status.", - "required": false, - "type": "string", - "enum": [ - "WAITING", - "PREPARE", - "ERROR", - "OK", - "PROCESSING" - ] - }, - { - "in": "query", - "name": "document_id", - "description": "Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/PostBoxes" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/post-boxes/{id}": { - "get": { - "tags": [ - "post box" - ], - "summary": "Fetch post box", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of post box", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/PostBox" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "post box" - ], - "summary": "Delete post box", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of post box", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/sepa-payments": { - "get": { - "tags": [ - "sepa payment" - ], - "summary": "Fetch SEPA payments list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - }, - { - "in": "query", - "name": "document_id", - "description": "Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/SEPAPayments" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "sepa payment" - ], - "summary": "Create SEPA payment", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SEPAPayment" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/SEPAPayment" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/sepa-payments/{id}": { - "get": { - "tags": [ - "sepa payment" - ], - "summary": "Fetch SEPA payment", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of SEPA payment", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/SEPAPayment" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "sepa payment" - ], - "summary": "Update SEPA payment", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of SEPA payment", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SEPAPayment" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/SEPAPayment" - } - }, - "400": { - "description": "Invalid SEPA payment" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "sepa payment" - ], - "summary": "Delete SEPA payment", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of SPEA payment", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/webhooks": { - "get": { - "tags": [ - "webhook" - ], - "summary": "Fetch WebHooks list", - "parameters": [ - { - "$ref": "#/parameters/LIMIT" - }, - { - "$ref": "#/parameters/PAGE" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/WebHooks" - } - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "post": { - "tags": [ - "webhook" - ], - "summary": "Create WebHook", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WebHook" - } - } - ], - "responses": { - "201": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/WebHook" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/webhooks/{id}": { - "get": { - "tags": [ - "webhook" - ], - "summary": "Fetch WebHook", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of WebHook", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/WebHook" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "put": { - "tags": [ - "webhook" - ], - "summary": "Update WebHook", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of WebHook", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WebHook" - } - } - ], - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/WebHook" - } - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - }, - "delete": { - "tags": [ - "webhook" - ], - "summary": "Delete WebHook", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "ID of WebHook", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "Successful operation" - }, - "404": { - "description": "Not found" - }, - "429": { - "description": "Too Many Requests" - } - } - } - }, - "/pdf-templates": { - "get": { - "tags": [ - "pdf templates" - ], - "summary": "Fetch PDF Templates list", - "responses": { - "200": { - "description": "Successful operation", - "schema": { - "$ref": "#/definitions/PDFTemplates" - } - }, - "429": { - "description": "Too Many Requests" - } - } - } - } - }, - "definitions": { - "List": { - "type": "object", - "required": [ - "page", - "pages", - "limit", - "total" - ], - "properties": { - "page": { - "type": "integer", - "description": "The current page", - "example": 1 - }, - "pages": { - "type": "integer", - "description": "Max possible pages", - "example": 1 - }, - "limit": { - "type": "integer", - "description": "Items limitation. Max 1000", - "example": 100 - }, - "total": { - "type": "integer", - "description": "Total Items", - "example": 20 - } - } - }, - "Customer": { - "type": "object", - "required": [ - "last_name", - "company_name" - ], - "properties": { - "acquire_options": { - "type": "integer", - "description": "1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform", - "enum": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8 - ], - "x-nullable": true, - "example": null - }, - "additional_groups_ids": { - "type": "array", - "readOnly": true, - "example": [], - "items": { - "type": "integer", - "uniqueItems": true - } - }, - "bank_account": { - "type": "string", - "x-nullable": true, - "example": null - }, - "bank_account_owner": { - "type": "string", - "x-nullable": true, - "example": null - }, - "bank_bic": { - "type": "string", - "x-nullable": true, - "example": null - }, - "bank_code": { - "type": "string", - "x-nullable": true, - "example": null - }, - "bank_iban": { - "type": "string", - "x-nullable": true, - "example": null - }, - "bank_name": { - "type": "string", - "x-nullable": true, - "example": null - }, - "birth_date": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2016-12-31" - }, - "cash_allowance": { - "type": "number", - "format": "float", - "x-nullable": true, - "example": null, - "minimum": 0, - "maximum": 100 - }, - "cash_allowance_days": { - "type": "integer", - "default": 7, - "example": 7 - }, - "cash_discount": { - "type": "number", - "format": "float", - "x-nullable": true, - "example": null - }, - "cash_discount_type": { - "type": "string", - "enum": [ - "PERCENT", - "AMOUNT" - ], - "x-nullable": true, - "example": null - }, - "city": { - "type": "string", - "x-nullable": true, - "example": "Kaarst" - }, - "state": { - "type": "string", - "example": "NRW" - }, - "company_name": { - "type": "string", - "example": "easybill GmbH", - "x-nullable": true - }, - "country": { - "type": "string", - "example": "DE" - }, - "created_at": { - "type": "string", - "format": "date", - "readOnly": true - }, - "updated_at": { - "type": "string", - "format": "datetime", - "readOnly": true - }, - "delivery_title": { - "type": "string", - "example": "Dr." - }, - "delivery_city": { - "type": "string", - "x-nullable": true, - "example": null - }, - "delivery_state": { - "type": "string", - "example": "NRW" - }, - "delivery_company_name": { - "type": "string", - "x-nullable": true, - "example": null - }, - "delivery_country": { - "type": "string", - "x-nullable": true, - "example": null - }, - "delivery_first_name": { - "type": "string", - "x-nullable": true, - "example": null - }, - "delivery_last_name": { - "type": "string", - "x-nullable": true, - "example": null - }, - "delivery_personal": { - "type": "boolean", - "example": false - }, - "delivery_salutation": { - "type": "integer", - "enum": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "default": 0, - "description": "0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family" - }, - "delivery_street": { - "type": "string", - "x-nullable": true, - "example": null - }, - "delivery_suffix_1": { - "type": "string", - "x-nullable": true, - "example": null - }, - "delivery_suffix_2": { - "type": "string", - "x-nullable": true, - "example": null - }, - "delivery_zip_code": { - "type": "string", - "x-nullable": true, - "example": null - }, - "display_name": { - "type": "string", - "readOnly": true - }, - "emails": { - "type": "array", - "items": { - "type": "string", - "maxItems": 3, - "uniqueItems": true - }, - "example": [ - "max.mustermann@easybill.de" - ] - }, - "fax": { - "type": "string", - "example": "+49 2154 89701 29", - "x-nullable": true - }, - "first_name": { - "type": "string", - "example": "Max", - "x-nullable": true - }, - "grace_period": { - "type": "integer", - "description": "will be replaced by its alias due_in_days.", - "x-nullable": true, - "example": null - }, - "due_in_days": { - "type": "integer", - "description": "due date in days", - "x-nullable": true, - "example": null - }, - "group_id": { - "type": "integer", - "x-nullable": true, - "example": null - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "info_1": { - "type": "string", - "x-nullable": true, - "example": null - }, - "info_2": { - "type": "string", - "x-nullable": true, - "example": null - }, - "internet": { - "type": "string", - "x-nullable": true, - "example": "https://www.easybill.de" - }, - "last_name": { - "type": "string", - "example": "Mustermann", - "x-nullable": true - }, - "login_id": { - "type": "integer", - "format": "int64" - }, - "mobile": { - "type": "string", - "example": null, - "x-nullable": true - }, - "note": { - "type": "string", - "example": null, - "x-nullable": true - }, - "number": { - "type": "string", - "description": "Automatically generated if empty." - }, - "payment_options": { - "type": "integer", - "enum": [ - 1, - 2, - 3, - 5 - ], - "description": "1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung", - "example": null, - "x-nullable": true - }, - "personal": { - "type": "boolean", - "example": false, - "default": false - }, - "phone_1": { - "type": "string", - "example": "+49 2154 89701 20", - "x-nullable": true - }, - "phone_2": { - "type": "string", - "example": null, - "x-nullable": true - }, - "postbox": { - "type": "string", - "example": null, - "x-nullable": true - }, - "postbox_city": { - "type": "string", - "example": null, - "x-nullable": true - }, - "postbox_state": { - "type": "string", - "example": "NRW" - }, - "postbox_country": { - "type": "string", - "example": null, - "x-nullable": true - }, - "postbox_zip_code": { - "type": "string", - "example": null, - "x-nullable": true - }, - "sale_price_level": { - "type": "string", - "example": null, - "x-nullable": true, - "enum": [ - "SALEPRICE2", - "SALEPRICE3", - "SALEPRICE4", - "SALEPRICE5", - "SALEPRICE6", - "SALEPRICE7", - "SALEPRICE8", - "SALEPRICE9", - "SALEPRICE10" - ] - }, - "salutation": { - "type": "integer", - "enum": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "default": 0, - "description": "0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family" - }, - "sepa_agreement": { - "type": "string", - "enum": [ - "BASIC", - "COR1", - "COMPANY", - "NULL" - ], - "description": "BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1, COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt", - "example": null, - "x-nullable": true - }, - "sepa_agreement_date": { - "type": "string", - "format": "date", - "example": null, - "x-nullable": true - }, - "sepa_mandate_reference": { - "type": "string", - "example": null, - "x-nullable": true - }, - "since_date": { - "type": "string", - "format": "date", - "example": null, - "x-nullable": true - }, - "street": { - "type": "string", - "example": "Düsselstr. 21", - "x-nullable": true - }, - "suffix_1": { - "type": "string", - "example": null, - "x-nullable": true - }, - "suffix_2": { - "type": "string", - "example": null, - "x-nullable": true - }, - "tax_number": { - "type": "string", - "example": null, - "x-nullable": true - }, - "court": { - "type": "string", - "example": "Berlin", - "x-nullable": true - }, - "court_registry_number": { - "type": "string", - "example": "HRB XXXXX X", - "x-nullable": true - }, - "tax_options": { - "type": "string", - "enum": [ - "nStb", - "nStbUstID", - "nStbNoneUstID", - "nStbIm", - "revc", - "IG", - "AL", - "sStfr", - "NULL" - ], - "description": "nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig", - "example": null, - "x-nullable": true - }, - "title": { - "type": "string", - "example": null, - "x-nullable": true - }, - "vat_identifier": { - "type": "string", - "example": "DE814878557", - "x-nullable": true - }, - "zip_code": { - "type": "string", - "x-nullable": true, - "example": "41564" - }, - "documentPdfType": { - "type": "string", - "enum": [ - "default", - "zugferd1", - "zugferd2", - "xrechnung", - "xrechnung_xml" - ], - "default": "default", - "description": "Type of PDF to use when sending a Document to the Customer." - }, - "buyer_reference": { - "type": "string", - "description": "Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format." - }, - "foreign_supplier_number": { - "type": "string", - "description": "The ID given to your company by the customer in his system." - } - } - }, - "CustomerSnapshot": { - "readOnly": true, - "type": "object", - "description": "A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state.", - "allOf": [ - { - "$ref": "#/definitions/Customer" - } - ] - }, - "Customers": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Customer" - } - } - } - } - ] - }, - "Contact": { - "type": "object", - "required": [ - "city", - "street" - ], - "properties": { - "city": { - "type": "string", - "example": "Musterstadt" - }, - "state": { - "type": "string", - "example": "NRW" - }, - "company_name": { - "type": "string", - "example": null, - "x-nullable": true - }, - "country": { - "type": "string", - "description": "Two-letter country code", - "example": "DE" - }, - "department": { - "type": "string", - "x-nullable": true, - "default": null, - "example": "Accounting" - }, - "emails": { - "type": "array", - "default": [], - "items": { - "type": "string", - "maxItems": 3, - "uniqueItems": true, - "example": "mustermann@easybill.de" - } - }, - "fax": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "first_name": { - "type": "string", - "x-nullable": true, - "default": null, - "example": "Max" - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "last_name": { - "type": "string", - "x-nullable": true, - "default": null, - "example": "Mustermann" - }, - "login_id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "mobile": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "note": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "personal": { - "type": "boolean", - "default": false - }, - "phone_1": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "phone_2": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "salutation": { - "type": "integer", - "description": "0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie" - }, - "street": { - "type": "string", - "example": "Musterstr." - }, - "suffix_1": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "suffix_2": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "title": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "zip_code": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "created_at": { - "type": "string", - "format": "datetime", - "readOnly": true, - "example": "2018-01-01 23:23:45" - }, - "updated_at": { - "type": "string", - "format": "datetime", - "readOnly": true, - "example": "2018-01-01 23:23:45" - } - } - }, - "Contacts": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Contact" - } - } - } - } - ] - }, - "DocumentPosition": { - "type": "object", - "properties": { - "number": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "description": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "document_note": { - "type": "string", - "example": "Test Note", - "description": "This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction." - }, - "quantity": { - "type": "number", - "maxLength": 10, - "format": "float", - "default": 1, - "example": 1 - }, - "quantity_str": { - "type": "string", - "maxLength": 10, - "description": "Use quantity_str if you want to set a quantity like: 1:30 h or 3x5 m. quantity_str overwrites quantity.", - "example": null - }, - "unit": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "type": { - "type": "string", - "enum": [ - "POSITION", - "POSITION_NOCALC", - "TEXT" - ], - "default": "POSITION" - }, - "position": { - "type": "integer", - "description": "Automatic by default (first item: 1, second item: 2, ...)", - "example": null - }, - "single_price_net": { - "type": "number", - "format": "float", - "x-nullable": true, - "default": null, - "example": null - }, - "single_price_gross": { - "type": "number", - "format": "float", - "readOnly": true - }, - "vat_percent": { - "type": "number", - "format": "float", - "default": 0, - "example": 0 - }, - "discount": { - "type": "number", - "format": "float", - "x-nullable": true, - "default": null, - "example": null - }, - "discount_type": { - "type": "string", - "enum": [ - "PERCENT", - "AMOUNT" - ], - "x-nullable": true, - "default": null, - "example": null - }, - "position_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "description": "If set, values are copied from the referenced position", - "example": null - }, - "total_price_net": { - "type": "number", - "format": "float", - "readOnly": true - }, - "total_price_gross": { - "type": "number", - "format": "float", - "readOnly": true - }, - "total_vat": { - "type": "number", - "format": "float", - "readOnly": true - }, - "serial_number_id": { - "type": "string", - "readOnly": true, - "example": null - }, - "serial_number": { - "type": "string", - "readOnly": true, - "example": null - }, - "booking_account": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "export_cost_1": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "export_cost_2": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "cost_price_net": { - "type": "number", - "format": "float", - "x-nullable": true, - "default": null, - "example": null - }, - "cost_price_total": { - "type": "number", - "format": "float", - "readOnly": true, - "example": null - }, - "cost_price_charge": { - "type": "number", - "format": "float", - "readOnly": true, - "example": null - }, - "cost_price_charge_type": { - "type": "string", - "readOnly": true, - "example": null, - "enum": [ - "PERCENT", - "AMOUNT" - ] - }, - "itemType": { - "type": "string", - "enum": [ - "PRODUCT", - "SERVICE", - "UNDEFINED" - ], - "default": "UNDEFINED" - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - } - } - }, - "DocumentAddress": { - "type": "object", - "readOnly": true, - "description": "This information comes from the customer which can be set with customer_id.", - "properties": { - "salutation": { - "readOnly": true, - "type": "integer", - "description": "0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie" - }, - "personal": { - "readOnly": true, - "type": "boolean", - "example": false - }, - "title": { - "readOnly": true, - "type": "string", - "example": null - }, - "first_name": { - "readOnly": true, - "type": "string", - "example": "Max" - }, - "last_name": { - "readOnly": true, - "type": "string", - "example": "Mustermann" - }, - "suffix_1": { - "readOnly": true, - "type": "string", - "example": null - }, - "suffix_2": { - "readOnly": true, - "type": "string", - "example": null - }, - "company_name": { - "readOnly": true, - "type": "string", - "example": null - }, - "street": { - "readOnly": true, - "type": "string", - "example": "Musterstr." - }, - "zip_code": { - "readOnly": true, - "type": "string", - "example": null - }, - "city": { - "readOnly": true, - "type": "string", - "example": "Musterstadt" - }, - "state": { - "readOnly": true, - "type": "string", - "example": "NRW" - }, - "country": { - "readOnly": true, - "type": "string", - "example": "DE" - } - } - }, - "DocumentRecurring": { - "type": "object", - "required": [ - "next_date" - ], - "properties": { - "next_date": { - "type": "string", - "format": "date", - "description": "Must be in the future", - "example": "2020-02-01" - }, - "frequency": { - "type": "string", - "enum": [ - "DAILY", - "WEEKLY", - "MONTHLY", - "YEARLY" - ], - "default": "MONTHLY" - }, - "frequency_special": { - "type": "string", - "enum": [ - "LASTDAYOFMONTH" - ], - "x-nullable": true, - "default": null, - "example": null - }, - "interval": { - "type": "integer", - "default": 1, - "example": 1 - }, - "end_date_or_count": { - "type": "string", - "description": "Date of last exectution day or number of times to exectute", - "x-nullable": true, - "default": null, - "example": null - }, - "status": { - "type": "string", - "enum": [ - "RUNNING", - "PAUSE", - "STOP", - "WAITING" - ], - "default": "WAITING" - }, - "as_draft": { - "type": "boolean", - "default": false - }, - "is_notify": { - "type": "boolean", - "default": false - }, - "send_as": { - "type": "string", - "enum": [ - "EMAIL", - "FAX", - "POST" - ], - "x-nullable": true, - "default": null, - "example": null - }, - "is_sign": { - "type": "boolean", - "default": false - }, - "is_paid": { - "type": "boolean", - "default": false - }, - "paid_date_option": { - "type": "string", - "description": "Option is used to determine what date is used for the payment if is_paid is true. \"next_valid_date\" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday.", - "default": "created_date", - "enum": [ - "created_date", - "due_date", - "next_valid_date" - ] - }, - "is_sepa": { - "type": "boolean", - "default": false - }, - "sepa_local_instrument": { - "type": "string", - "enum": [ - "CORE", - "COR1", - "B2B" - ], - "x-nullable": true, - "default": null, - "example": null - }, - "sepa_sequence_type": { - "type": "string", - "enum": [ - "FRST", - "OOFF", - "FNAL", - "RCUR" - ], - "x-nullable": true, - "default": null, - "example": null - }, - "sepa_reference": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "sepa_remittance_information": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "target_type": { - "type": "string", - "enum": [ - "INVOICE", - "CREDIT", - "ORDER", - "OFFER" - ], - "default": "INVOICE", - "description": "The document type that will be generated. Can not be changed on existing documents." - } - } - }, - "ServiceDate": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "DEFAULT", - "SERVICE", - "DELIVERY" - ], - "description": "With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.
For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text." - }, - "date": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2019-02-01" - }, - "date_from": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": null - }, - "date_to": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": null - }, - "text": { - "type": "string", - "default": null, - "x-nullable": true, - "example": null - } - } - }, - "Document": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/DocumentAddress" - }, - "attachment_ids": { - "type": "array", - "readOnly": true, - "example": [], - "items": { - "type": "integer", - "uniqueItems": true - } - }, - "label_address": { - "$ref": "#/definitions/DocumentAddress" - }, - "amount": { - "readOnly": true, - "type": "integer", - "description": "Amount in cents (e.g. \"150\" = 1.50€)" - }, - "amount_net": { - "readOnly": true, - "type": "integer", - "description": "Amount in cents (e.g. \"150\" = 1.50€)" - }, - "bank_debit_form": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "billing_country": { - "type": "string", - "readOnly": true, - "example": null - }, - "calc_vat_from": { - "type": "integer", - "enum": [ - 0, - 1 - ], - "description": "0 === Net, 1 === Gross.", - "default": 0, - "example": 0 - }, - "cancel_id": { - "type": "integer", - "format": "int64", - "description": "ID from the cancel document. Only for document type INVOICE.", - "readOnly": true, - "example": null - }, - "cash_allowance": { - "type": "number", - "format": "float", - "x-nullable": true, - "default": null, - "example": null - }, - "cash_allowance_days": { - "type": "integer", - "x-nullable": true, - "default": null, - "example": null - }, - "cash_allowance_text": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "contact_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "contact_label": { - "type": "string", - "default": "", - "example": "" - }, - "contact_text": { - "type": "string", - "default": "", - "example": "" - }, - "created_at": { - "readOnly": true, - "type": "string", - "format": "date-time", - "example": "2019-02-01 11:16:52" - }, - "currency": { - "type": "string", - "default": "EUR", - "example": "EUR" - }, - "customer_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "customer_snapshot": { - "$ref": "#/definitions/CustomerSnapshot" - }, - "discount": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "discount_type": { - "type": "string", - "enum": [ - "PERCENT", - "AMOUNT" - ], - "x-nullable": true, - "default": null, - "example": null - }, - "document_date": { - "type": "string", - "format": "date", - "example": "2019-02-07" - }, - "due_date": { - "type": "string", - "format": "date", - "readOnly": true, - "description": "To change the value use grace_period.", - "example": null - }, - "edited_at": { - "readOnly": true, - "type": "string", - "format": "date-time", - "example": "2019-02-07 11:54:10" - }, - "external_id": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "replica_url": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "grace_period": { - "type": "integer", - "description": "will be replaced by its alias due_in_days.", - "x-nullable": true, - "example": null - }, - "due_in_days": { - "type": "integer", - "description": "due date in days.", - "x-nullable": true, - "example": null - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "is_archive": { - "type": "boolean", - "default": false, - "example": false - }, - "is_draft": { - "type": "boolean", - "readOnly": true, - "description": "This property is read only. To finish the document call /documents/{id}/done.", - "example": true - }, - "is_replica": { - "type": "boolean", - "description": "Marks a document as a replica from another software.", - "default": false, - "example": false - }, - "is_cold": { - "type": "boolean", - "description": "Indicates if a document is in the long term archive", - "default": false, - "example": false, - "readOnly": true - }, - "is_oss": { - "type": "boolean", - "description": "Indicates if a document is a one-stop-shop document", - "default": false, - "example": false - }, - "coldstorage_due_date": { - "type": "string", - "format": "date", - "description": "Signals when the document should be moved to the long term archive", - "example": "2019-02-07", - "x-nullable": true - }, - "item_notes": { - "description": "Field holds all unique document_note of items for the document", - "type": "array", - "readOnly": true, - "items": { - "type": "string" - } - }, - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/DocumentPosition" - } - }, - "last_postbox_id": { - "type": "integer", - "format": "int64", - "readOnly": true, - "example": null - }, - "login_id": { - "type": "integer", - "format": "int64", - "example": null, - "description": "If omitted or null, the currently active login is used." - }, - "number": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "order_number": { - "type": "string", - "default": "" - }, - "buyer_reference": { - "type": "string", - "default": "" - }, - "paid_amount": { - "type": "integer", - "readOnly": true - }, - "paid_at": { - "type": "string", - "format": "date", - "readOnly": true, - "example": null - }, - "pdf_pages": { - "type": "integer", - "readOnly": true - }, - "pdf_template": { - "type": "string", - "description": "Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID.", - "example": null - }, - "project_id": { - "type": "integer", - "x-nullable": true, - "default": null, - "example": null - }, - "recurring_options": { - "description": "This object is only available in document type RECURRING", - "$ref": "#/definitions/DocumentRecurring" - }, - "ref_id": { - "type": "integer", - "format": "int64", - "description": "Reference document id", - "x-nullable": true, - "default": null, - "example": null - }, - "service_date": { - "description": "This object is only available in document type INVOICE or CREDIT.", - "$ref": "#/definitions/ServiceDate" - }, - "shipping_country": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "status": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null, - "description": "This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set.", - "enum": [ - "ACCEPT", - "DONE", - "DROPSHIPPING", - "CANCEL" - ] - }, - "text": { - "type": "string", - "example": "Vielen Dank für Ihren Auftrag!\n\nBitte begleichen Sie den offenen Betrag bis zum %DOKUMENT.DATUM-FAELLIG%.\n\nMit freundlichen Grüßen\n\n%FIRMA.FIRMA%\n" - }, - "text_prefix": { - "type": "string", - "example": "%KUNDE.ANREDE%,\nnachfolgend berechnen wir Ihnen wie vorab besprochen:\n" - }, - "text_tax": { - "type": "string", - "x-nullable": true, - "default": null, - "description": "Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null" - }, - "title": { - "type": "string", - "x-nullable": true, - "default": null, - "example": "Invoice for Order #001" - }, - "type": { - "type": "string", - "enum": [ - "INVOICE", - "RECURRING", - "CREDIT", - "OFFER", - "REMINDER", - "DUNNING", - "STORNO", - "STORNO_CREDIT", - "DELIVERY", - "PDF", - "CHARGE", - "CHARGE_CONFIRM", - "LETTER", - "ORDER", - "PROFORMA_INVOICE", - "STORNO_PROFORMA_INVOICE" - ], - "description": "Can only set on create.", - "default": "INVOICE" - }, - "use_shipping_address": { - "type": "boolean", - "description": "If true and customer has shipping address then it will be used.", - "default": false, - "example": false - }, - "vat_country": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "vat_id": { - "type": "string", - "readOnly": true, - "default": "", - "example": "DE999999999" - }, - "fulfillment_country": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "vat_option": { - "type": "string", - "enum": [ - "NULL", - "nStb", - "nStbUstID", - "nStbNoneUstID", - "nStbIm", - "revc", - "IG", - "AL", - "sStfr", - "smallBusiness" - ], - "description": "NULL: Normal steuerbar
nStb: Nicht steuerbar (Drittland)
nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)
nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)
nStbIm: Nicht steuerbarer Innenumsatz
revc: Steuerschuldwechsel §13b (Inland)
IG: Innergemeinschaftliche Lieferung
AL: Ausfuhrlieferung
sStfr: sonstige Steuerbefreiung
smallBusiness: Kleinunternehmen (Keine MwSt.)", - "x-nullable": true, - "default": null, - "example": null - } - } - }, - "Documents": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Document" - } - } - } - } - ] - }, - "CustomerGroup": { - "type": "object", - "required": [ - "number", - "name" - ], - "properties": { - "name": { - "type": "string", - "example": "Important Customers" - }, - "description": { - "type": "string", - "example": "Our most important customers", - "x-nullable": true, - "default": null - }, - "number": { - "type": "string", - "example": "001", - "description": "Can be chosen freely" - }, - "display_name": { - "type": "string", - "readOnly": true, - "example": "001 - Important Customers" - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - } - } - }, - "CustomerGroups": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomerGroup" - } - } - } - } - ] - }, - "Task": { - "type": "object", - "required": [ - "name", - "status" - ], - "properties": { - "category": { - "type": "string", - "enum": [ - "CALL", - "EMAIL", - "FAX", - "LUNCH", - "MEETING", - "TRAVEL", - "CUSTOM" - ], - "x-nullable": true, - "default": null - }, - "category_custom": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null, - "description": "The name of your custom category. Can only have a value if \"category\" is \"CUSTOM\"." - }, - "created_at": { - "type": "string", - "format": "date-time", - "readOnly": true, - "example": "2019-02-01 11:16:52" - }, - "customer_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "description": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "document_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "end_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": null, - "description": "The deadline" - }, - "finish_at": { - "type": "string", - "format": "date-time", - "readOnly": true, - "x-nullable": true, - "example": null, - "description": "The time when the task was marked as done" - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "login_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "example": null, - "description": "When omitted or null, the currently active login is used" - }, - "name": { - "type": "string", - "example": "Call client" - }, - "position_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "priority": { - "type": "string", - "enum": [ - "LOW", - "NORMAL", - "HIGH" - ], - "default": "NORMAL" - }, - "project_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "start_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "default": null, - "example": null - }, - "status": { - "type": "string", - "enum": [ - "WAITING", - "PROCESSING", - "DONE", - "CANCEL" - ], - "example": "PROCESSING" - }, - "status_percent": { - "type": "integer", - "x-nullable": true, - "default": null, - "example": 50 - } - } - }, - "Tasks": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Task" - } - } - } - } - ] - }, - "Project": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "budget_amount": { - "type": "integer", - "description": "Project budget in cents (e.g. \"150\" = 1.50€)", - "default": 0, - "example": 10000 - }, - "budget_time": { - "type": "integer", - "description": "Time budget in minutes (e.g. \"90\" = 1 hour and 30 minutes)", - "default": 0, - "example": 60 - }, - "customer_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null - }, - "hourly_rate": { - "type": "number", - "format": "float", - "description": "Hourly rate in cents (e.g. \"150\" = 1.50€)", - "example": 3000 - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "login_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "example": null, - "description": "If omitted or null, the currently active login is used" - }, - "name": { - "type": "string", - "example": "My Project" - }, - "note": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "status": { - "type": "string", - "enum": [ - "OPEN", - "DONE", - "CANCEL" - ], - "default": "OPEN" - }, - "due_at": { - "type": "string", - "format": "date", - "x-nullable": true, - "default": null, - "example": null - }, - "budget_notify_frequency": { - "type": "string", - "enum": [ - "ALWAYS", - "ONCE", - "NEVER" - ], - "default": "ALWAYS" - }, - "consumed_time": { - "type": "integer", - "readOnly": true - }, - "consumed_amount": { - "type": "integer", - "readOnly": true - } - } - }, - "Projects": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Project" - } - } - } - } - ] - }, - "Position": { - "type": "object", - "required": [ - "number", - "description", - "sale_price" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "type": { - "type": "string", - "enum": [ - "PRODUCT", - "SERVICE", - "TEXT" - ], - "default": "PRODUCT" - }, - "number": { - "type": "string", - "example": 1234 - }, - "description": { - "type": "string", - "example": "iPhone X", - "description": "The positions name or description" - }, - "document_note": { - "type": "string", - "example": "Test Note", - "description": "This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction." - }, - "note": { - "type": "string", - "example": null, - "description": "Note for internal use", - "x-nullable": true, - "default": null - }, - "unit": { - "type": "string", - "example": null, - "x-nullable": true, - "default": null - }, - "export_identifier": { - "type": "string", - "x-nullable": true, - "default": null, - "example": "8400", - "description": "The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant." - }, - "export_identifier_extended": { - "$ref": "#/definitions/PositionExportIdentifierExtended" - }, - "login_id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "price_type": { - "type": "string", - "enum": [ - "BRUTTO", - "NETTO" - ], - "default": "NETTO" - }, - "vat_percent": { - "type": "number", - "format": "float", - "default": 19, - "example": 19 - }, - "sale_price": { - "type": "number", - "format": "float", - "example": 1250, - "description": "Price in cents (e.g. \"150\" = 1.50€)" - }, - "sale_price2": { - "type": "number", - "format": "float", - "description": "Price for customers of group 2 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "sale_price3": { - "type": "number", - "format": "float", - "description": "Price for customers of group 3 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "sale_price4": { - "type": "number", - "format": "float", - "description": "Price for customers of group 4 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "sale_price5": { - "type": "number", - "format": "float", - "description": "Price for customers of group 5 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "sale_price6": { - "type": "number", - "format": "float", - "description": "Price for customers of group 6 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "sale_price7": { - "type": "number", - "format": "float", - "description": "Price for customers of group 7 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "sale_price8": { - "type": "number", - "format": "float", - "description": "Price for customers of group 8 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "sale_price9": { - "type": "number", - "format": "float", - "description": "Price for customers of group 9 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "sale_price10": { - "type": "number", - "format": "float", - "description": "Price for customers of group 10 in cents (e.g. \"150\" = 1.50€)", - "x-nullable": true, - "default": null, - "example": null - }, - "cost_price": { - "type": "number", - "format": "float", - "example": 830, - "x-nullable": true, - "description": "Price in cents (e.g. \"150\" = 1.50€)" - }, - "export_cost1": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "export_cost2": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "group_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "example": null - }, - "stock": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "description": "Activates stock management for this position", - "default": "NO" - }, - "stock_count": { - "type": "integer", - "example": 100, - "default": 0, - "description": "Current stock count", - "readOnly": true - }, - "stock_limit_notify": { - "type": "boolean", - "default": false, - "description": "Notify when stock_count is lower than stock_limit" - }, - "stock_limit_notify_frequency": { - "type": "string", - "enum": [ - "ALWAYS", - "ONCE" - ], - "default": "ALWAYS", - "description": "Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE)" - }, - "stock_limit": { - "type": "integer", - "example": 50, - "default": 0 - }, - "quantity": { - "type": "number", - "format": "float", - "description": "Used as the default quantity when adding this position to a document", - "example": 10, - "x-nullable": true, - "default": null - } - } - }, - "Positions": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Position" - } - } - } - } - ] - }, - "PositionExportIdentifierExtended": { - "type": "object", - "default": [], - "properties": { - "NULL": { - "type": "string", - "example": "8400", - "description": "Umsatzsteuerpflichtig", - "x-nullable": true, - "default": null - }, - "nStb": { - "type": "string", - "example": "8338", - "description": "Nicht steuerbar (Drittland)", - "x-nullable": true, - "default": null - }, - "nStbUstID": { - "type": "string", - "example": "8339", - "description": "Nicht steuerbar (EU mit USt-IdNr.)", - "x-nullable": true, - "default": null - }, - "nStbNoneUstID": { - "type": "string", - "example": "8950", - "description": "Nicht steuerbar (EU ohne USt-IdNr.)", - "x-nullable": true, - "default": null - }, - "nStbIm": { - "type": "string", - "example": "8950", - "description": "Nicht steuerbarer Innenumsatz", - "x-nullable": true, - "default": null - }, - "revc": { - "type": "string", - "example": "8337", - "description": "Steuerschuldwechsel §13b (Inland)", - "x-nullable": true, - "default": null - }, - "IG": { - "type": "string", - "example": "8125", - "description": "Innergemeinschaftliche Lieferung", - "x-nullable": true, - "default": null - }, - "AL": { - "type": "string", - "example": "8120", - "description": "Ausfuhrlieferung", - "x-nullable": true, - "default": null - }, - "sStfr": { - "type": "string", - "example": "8100", - "description": "sonstige Steuerbefreiung", - "x-nullable": true, - "default": null - }, - "smallBusiness": { - "type": "string", - "example": "8195", - "description": "Kleinunternehmen (Keine MwSt.)", - "x-nullable": true, - "default": null - } - } - }, - "PositionGroup": { - "type": "object", - "required": [ - "number", - "name" - ], - "properties": { - "description": { - "type": "string", - "example": null, - "x-nullable": true, - "default": null - }, - "login_id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "name": { - "type": "string", - "example": "Mobile Phones" - }, - "number": { - "type": "string", - "example": "001" - }, - "display_name": { - "type": "string", - "readOnly": true, - "example": "001 - Mobile Phones" - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - } - } - }, - "PositionGroups": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/PositionGroup" - } - } - } - } - ] - }, - "TimeTracking": { - "type": "object", - "required": [ - "description" - ], - "properties": { - "cleared_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "default": null, - "example": null - }, - "created_at": { - "type": "string", - "format": "date-time", - "readOnly": true, - "example": "2019-02-01 11:16:52" - }, - "date_from_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "default": null, - "example": "2019-02-05 11:30:00" - }, - "date_thru_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "default": null, - "example": "2019-02-05 13:00:00" - }, - "description": { - "type": "string", - "example": "Meeting with client" - }, - "hourly_rate": { - "type": "number", - "format": "float", - "default": 0, - "description": "Hourly rate in cents (e.g. \"150\" = 1.50€)", - "example": 2000 - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "note": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null - }, - "number": { - "type": "string", - "x-nullable": true, - "example": "001", - "description": "Can be chosen freely" - }, - "position_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "project_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "login_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "description": "If omitted or null, the currently active login is used.", - "example": null - }, - "timer_value": { - "type": "integer", - "x-nullable": true, - "default": null, - "description": "Tracked time in minutes", - "example": 90 - } - } - }, - "TimeTrackings": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/TimeTracking" - } - } - } - } - ] - }, - "TextTemplate": { - "type": "object", - "required": [ - "title", - "text" - ], - "properties": { - "can_modify": { - "type": "boolean", - "readOnly": true - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "text": { - "type": "string", - "example": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." - }, - "title": { - "type": "string", - "example": "Lorem Ipsum" - } - } - }, - "TextTemplates": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/TextTemplate" - } - } - } - } - ] - }, - "Attachment": { - "type": "object", - "description": "If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination).", - "properties": { - "created_at": { - "type": "string", - "format": "date", - "readOnly": true - }, - "customer_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "document_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "file_name": { - "type": "string", - "example": "my_doc.pdf", - "readOnly": true - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "project_id": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "default": null, - "example": null - }, - "size": { - "type": "integer", - "example": 10022, - "description": "In byte", - "readOnly": true - } - } - }, - "Attachments": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Attachment" - } - } - } - } - ] - }, - "DocumentPayment": { - "type": "object", - "required": [ - "document_id", - "amount" - ], - "properties": { - "amount": { - "type": "integer", - "format": "int32" - }, - "document_id": { - "type": "integer", - "format": "int64" - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "is_overdue_fee": { - "type": "boolean" - }, - "login_id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "notice": { - "type": "string", - "default": "" - }, - "payment_at": { - "type": "string", - "format": "date" - }, - "type": { - "type": "string", - "maxLength": 255, - "default": "" - }, - "provider": { - "type": "string", - "maxLength": 255, - "default": "" - }, - "reference": { - "type": "string", - "maxLength": 255, - "default": "" - } - }, - "example": { - "id": 1, - "document_id": 1, - "login_id": 1, - "amount": 1000, - "payment_at": "2007-09-17T00:00:00.000Z", - "type": "VISA", - "provider": "Stripe", - "reference": "111111-VISA-222222-6666" - } - }, - "DocumentPayments": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/DocumentPayment" - } - } - } - } - ] - }, - "PostBoxRequest": { - "type": "object", - "properties": { - "to": { - "type": "string" - }, - "cc": { - "type": "string" - }, - "from": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "message": { - "type": "string" - }, - "date": { - "type": "string", - "format": "date" - }, - "document_file_type": { - "type": "string", - "enum": [ - "default", - "zugferd1", - "zugferd2", - "xrechnung", - "xrechnung_xml" - ], - "x-nullable": true, - "description": "When set to null, the setting on the customer is used" - }, - "post_send_type": { - "type": "string", - "example": "post_send_type_standard", - "description": "This value indicates what method is used when the document is send via mail.\nThe different types are offered by the german post as additional services.\nThe registered mail options will include a tracking number which will be \nadded to the postbox when known.\n\nIf the value is omitted or empty when a postbox is created with the type \"POST\"\npost_send_type_standard will be used.\n\nFor postbox with a different type than \"POST\" this field will hold a empty string.\n", - "enum": [ - "post_send_type_standard", - "post_send_type_registered", - "post_send_type_registered_and_personal", - "post_send_type_registered_and_receipt", - "post_send_type_registered_throwin", - "post_send_type_prio" - ] - } - } - }, - "PostBox": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "document_id": { - "type": "integer", - "format": "int64" - }, - "to": { - "type": "string", - "example": "example@easybill.de" - }, - "cc": { - "type": "string", - "example": null - }, - "from": { - "type": "string", - "example": "example@easybill.de" - }, - "subject": { - "type": "string", - "example": "Invoice" - }, - "message": { - "type": "string", - "example": "Dear Mr. ..." - }, - "date": { - "type": "string", - "format": "date", - "example": "2019-02-07" - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2019-02-07 11:29:28" - }, - "processed_at": { - "type": "string", - "format": "date-time", - "example": null - }, - "send_by_self": { - "type": "boolean", - "example": false - }, - "send_with_attachment": { - "type": "boolean", - "example": true - }, - "type": { - "type": "string", - "enum": [ - "FAX", - "EMAIL", - "POST" - ], - "example": "EMAIL" - }, - "status": { - "type": "string", - "enum": [ - "WAITING", - "PREPARE", - "ERROR", - "OK", - "PROCESSING" - ] - }, - "status_msg": { - "type": "string", - "example": null - }, - "login_id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "document_file_type": { - "type": "string", - "enum": [ - "default", - "zugferd1", - "zugferd2", - "xrechnung", - "xrechnung_xml" - ], - "x-nullable": true - }, - "post_send_type": { - "type": "string", - "example": "post_send_type_standard", - "description": "This value indicates what method is used when the document is send via mail.\nThe different types are offered by the german post as additional services.\nThe registered mail options will include a tracking number which will be \nadded to the postbox when known.\n\nIf the value is omitted or empty when a postbox is created with the type \"POST\"\npost_send_type_standard will be used.\n\nFor postbox with a different type than \"POST\" this field will hold a empty string.\n", - "enum": [ - "post_send_type_standard", - "post_send_type_registered", - "post_send_type_registered_and_personal", - "post_send_type_registered_and_receipt", - "post_send_type_registered_throwin", - "post_send_type_prio" - ] - }, - "tracking_identifier": { - "readOnly": true, - "type": "string", - "example": "DE1234567890", - "description": "If the document is send with one of the registered send types stated for post_send_type, a tracking identifier\nwill be added to the postbox at a later point when the tracking identifier is provided\nby our service partner. \n" - } - } - }, - "PostBoxes": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/PostBox" - } - } - } - } - ] - }, - "SEPAPayment": { - "type": "object", - "required": [ - "document_id", - "debitor_name", - "debitor_iban", - "mandate_id", - "mandate_date_of_signature", - "local_instrument", - "sequence_type", - "amount", - "reference" - ], - "properties": { - "amount": { - "type": "integer", - "description": "Amount in cents (e.g. \"150\" = 1.50€)", - "example": 10000 - }, - "created_at": { - "type": "string", - "format": "date-time", - "readOnly": true, - "example": "2019-02-01 11:16:52" - }, - "creditor_bic": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null, - "description": "If type is DEBIT, this field is overwritten with the selected bank account data on export." - }, - "creditor_iban": { - "type": "string", - "x-nullable": true, - "example": "DE12345678901234567890", - "description": "Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export." - }, - "creditor_name": { - "type": "string", - "x-nullable": true, - "example": "Easybill GmbH", - "description": "Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export." - }, - "debitor_bic": { - "type": "string", - "x-nullable": true, - "default": null, - "example": null, - "description": "If type is CREDIT, this field is overwritten with the selected bank account data on export." - }, - "debitor_iban": { - "type": "string", - "x-nullable": true, - "example": "DE12345678901234567890", - "description": "Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export." - }, - "debitor_name": { - "type": "string", - "x-nullable": true, - "example": "Easybill GmbH", - "description": "Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export." - }, - "debitor_address_line_1": { - "type": "string", - "maxLength": 70, - "example": "Bahnhofstr. 1", - "description": "Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA" - }, - "debitor_address_line2": { - "type": "string", - "maxLength": 70, - "example": "8001 Zürich", - "description": "string" - }, - "debitor_country": { - "type": "string", - "maxLength": 2, - "example": "CH", - "description": "Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA" - }, - "document_id": { - "type": "integer", - "format": "int64" - }, - "export_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "default": null, - "description": "If a date is set, this record is marked as exported", - "example": null - }, - "export_error": { - "type": "string", - "example": null, - "readOnly": true - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "local_instrument": { - "type": "string", - "enum": [ - "CORE", - "COR1", - "B2B" - ], - "description": "CORE: SEPA Core Direct Debit
COR1: SEPA-Basislastschrift COR1
B2B: SEPA Business to Business Direct Debit" - }, - "mandate_date_of_signature": { - "type": "string", - "format": "date", - "example": "2019-02-01" - }, - "mandate_id": { - "type": "string", - "maxLength": 34, - "example": "001" - }, - "reference": { - "type": "string", - "maxLength": 35, - "example": "X000000001" - }, - "remittance_information": { - "type": "string", - "maxLength": 140, - "x-nullable": true, - "default": null, - "example": null - }, - "requested_at": { - "type": "string", - "format": "date", - "default": "Today's date", - "description": "Booking date" - }, - "sequence_type": { - "type": "string", - "enum": [ - "FRST", - "OOFF", - "FNAL", - "RCUR" - ], - "description": "FRST: Erstlastschrift
RCUR: Folgelastschrift
OOFF: Einmallastschrift
FNAL: Letztmalige Lastschrift" - }, - "updated_at": { - "example": "2018-01-01 23:23:45", - "type": "string", - "format": "datetime", - "readOnly": true - }, - "type": { - "type": "string", - "enum": [ - "DEBIT", - "CREDIT" - ], - "default": "DEBIT" - } - } - }, - "SEPAPayments": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/SEPAPayment" - } - } - } - } - ] - }, - "WebHook": { - "type": "object", - "required": [ - "url", - "content_type", - "secret", - "events", - "description" - ], - "properties": { - "content_type": { - "type": "string", - "enum": [ - "form", - "json" - ] - }, - "description": { - "type": "string", - "example": "My Webhook" - }, - "events": { - "type": "array", - "items": { - "type": "string", - "uniqueItems": true, - "enum": [ - "document.create", - "document.update", - "document.completed", - "document.deleted", - "document.payment_add", - "document.payment_delete", - "customer.create", - "customer.update", - "customer.delete", - "contact.create", - "contact.update", - "contact.delete", - "position.create", - "position.update", - "position.delete", - "postbox.create", - "postbox.update", - "postbox.delete", - "postbox.sent" - ] - } - }, - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "is_active": { - "type": "boolean", - "default": false - }, - "last_response": { - "$ref": "#/definitions/WebHookLastResponse" - }, - "secret": { - "type": "string", - "example": "" - }, - "url": { - "type": "string", - "example": "https://..." - } - } - }, - "WebHooks": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/WebHook" - } - } - } - } - ] - }, - "WebHookLastResponse": { - "type": "object", - "readOnly": true, - "properties": { - "date": { - "type": "string", - "format": "date-time", - "readOnly": true, - "example": "2019-02-01 11:16:52" - }, - "code": { - "type": "integer", - "readOnly": true, - "example": 204 - }, - "response": { - "type": "string", - "readOnly": true, - "example": "" - } - } - }, - "PDFTemplate": { - "type": "object", - "properties": { - "id": { - "type": "string", - "default": "INVOICE-DE", - "example": "INVOICE-DE" - }, - "name": { - "type": "string", - "default": "Default template", - "example": "Default template" - }, - "pdf_template": { - "type": "string", - "default": "DE", - "example": "DE" - }, - "document_type": { - "type": "string", - "default": "INVOICE", - "example": "INVOICE" - } - } - }, - "PDFTemplates": { - "type": "object", - "allOf": [ - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/PDFTemplate" - } - } - } - } - ] - }, - "Discount": { - "type": "object", - "required": [ - "customer_id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "customer_id": { - "type": "integer", - "format": "int64" - }, - "discount": { - "type": "integer", - "default": 0, - "example": 10, - "description": "The discount value depending on \"discount_type\"" - }, - "discount_type": { - "type": "string", - "default": "PERCENT", - "enum": [ - "AMOUNT", - "PERCENT", - "QUANTITY", - "FIX" - ], - "description": "AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price" - } - } - }, - "DiscountPosition": { - "type": "object", - "required": [ - "position_id" - ], - "properties": { - "position_id": { - "type": "integer", - "format": "int64" - } - }, - "allOf": [ - { - "$ref": "#/definitions/Discount" - } - ] - }, - "DiscountPositions": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/DiscountPosition" - } - } - } - } - ] - }, - "DiscountPositionGroup": { - "type": "object", - "required": [ - "position_group_id" - ], - "properties": { - "position_group_id": { - "type": "integer", - "format": "int64" - } - }, - "allOf": [ - { - "$ref": "#/definitions/Discount" - } - ] - }, - "DiscountPositionGroups": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/DiscountPositionGroup" - } - } - } - } - ] - }, - "Login": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "first_name": { - "type": "string", - "example": "Max" - }, - "last_name": { - "type": "string", - "example": "Musterfrau" - }, - "display_name": { - "type": "string", - "readOnly": true, - "example": "Max Musterfrau" - }, - "phone": { - "type": "string", - "example": "+4923489342" - }, - "email": { - "type": "string", - "example": "example@easybill.de" - }, - "email_signature": { - "type": "string", - "example": null - }, - "login_type": { - "type": "string", - "default": "ASSISTANT", - "enum": [ - "ADMIN", - "ASSISTANT" - ] - }, - "locale": { - "type": "string", - "example": "de" - }, - "time_zone": { - "type": "string", - "example": "Europe/Berlin" - }, - "security": { - "$ref": "#/definitions/LoginSecurity" - } - } - }, - "Logins": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Login" - } - } - } - } - ] - }, - "SerialNumber": { - "type": "object", - "required": [ - "serial_number", - "position_id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "serial_number": { - "example": "DHEZ-DHSNR-2344D-FFW", - "type": "string" - }, - "position_id": { - "type": "integer", - "format": "int6" - }, - "document_id": { - "example": null, - "x-nullable": true, - "type": "integer", - "format": "int64", - "readOnly": true - }, - "document_position_id": { - "example": null, - "x-nullable": true, - "type": "integer", - "format": "int64", - "readOnly": true - }, - "used_at": { - "example": null, - "x-nullable": true, - "type": "string", - "format": "datetime", - "readOnly": true - }, - "created_at": { - "example": "2018-01-01 23:23:45", - "type": "string", - "format": "datetime", - "readOnly": true - } - } - }, - "SerialNumbers": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/SerialNumber" - } - } - } - } - ] - }, - "Stock": { - "type": "object", - "required": [ - "stock_count", - "position_id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "note": { - "type": "string", - "example": "Correction for stock count of the Entry from 11/01/2017" - }, - "stock_count": { - "example": 666, - "type": "integer", - "format": "int64" - }, - "position_id": { - "type": "integer", - "format": "int64" - }, - "document_id": { - "example": null, - "x-nullable": true, - "type": "integer", - "format": "int64", - "readOnly": true - }, - "document_position_id": { - "example": null, - "x-nullable": true, - "type": "integer", - "format": "int64", - "readOnly": true - }, - "stored_at": { - "x-nullable": true, - "type": "string", - "format": "datetime", - "example": "2017-04-11 13:00:00" - }, - "created_at": { - "example": "2018-01-01 23:23:45", - "type": "string", - "format": "datetime", - "readOnly": true - }, - "updated_at": { - "example": "2018-01-01 23:23:45", - "type": "string", - "format": "datetime", - "readOnly": true - } - } - }, - "Stocks": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/List" - }, - { - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/Stock" - } - } - } - } - ] - }, - "LoginSecurity": { - "type": "object", - "description": "This object is only displayed if your request the login resource as an admin. Otherwise this property will be null.", - "properties": { - "two_factor_enabled": { - "type": "boolean", - "readOnly": true, - "default": false, - "description": "Shows if the login has two factor enabled for the login process" - }, - "recovery_codes_enabled": { - "type": "boolean", - "readOnly": true, - "default": false, - "description": "Shows if the login has recovery codes enabled to bypass two factor" - }, - "notify_on_new_login_enabled": { - "type": "boolean", - "readOnly": true, - "default": true, - "description": "Shows if the login has enabled to be notified if a new login is made from an unknown device." - } - } - } - } -} \ No newline at end of file diff --git a/src/Models/Attachment.php b/src/Models/Attachment.php index 7d20077..83ad386 100644 --- a/src/Models/Attachment.php +++ b/src/Models/Attachment.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 * If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination). */ diff --git a/src/Models/Contact.php b/src/Models/Contact.php index d45924a..a04e15b 100644 --- a/src/Models/Contact.php +++ b/src/Models/Contact.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class Contact implements ToArrayInterface diff --git a/src/Models/Customer.php b/src/Models/Customer.php index 1dc774b..7c956e7 100644 --- a/src/Models/Customer.php +++ b/src/Models/Customer.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class Customer implements ToArrayInterface diff --git a/src/Models/CustomerGroup.php b/src/Models/CustomerGroup.php index f376e02..adffb9b 100644 --- a/src/Models/CustomerGroup.php +++ b/src/Models/CustomerGroup.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class CustomerGroup implements ToArrayInterface diff --git a/src/Models/CustomerSnapshot.php b/src/Models/CustomerSnapshot.php index dba052e..0ab62c2 100644 --- a/src/Models/CustomerSnapshot.php +++ b/src/Models/CustomerSnapshot.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 * A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state. */ diff --git a/src/Models/DiscountPosition.php b/src/Models/DiscountPosition.php index 97d5453..8424d00 100644 --- a/src/Models/DiscountPosition.php +++ b/src/Models/DiscountPosition.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class DiscountPosition implements ToArrayInterface diff --git a/src/Models/DiscountPositionGroup.php b/src/Models/DiscountPositionGroup.php index a5fcef6..2987489 100644 --- a/src/Models/DiscountPositionGroup.php +++ b/src/Models/DiscountPositionGroup.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class DiscountPositionGroup implements ToArrayInterface diff --git a/src/Models/Document.php b/src/Models/Document.php index 0d77767..616ef9b 100644 --- a/src/Models/Document.php +++ b/src/Models/Document.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class Document implements ToArrayInterface @@ -441,9 +441,6 @@ public function getProjectId(): ?int return $this->attr('project_id'); } - /** - * This object is only available in document type RECURRING. - */ public function setRecurringOptions(DocumentRecurring $recurring_options): void { $this->data['recurring_options'] = $recurring_options; @@ -467,9 +464,6 @@ public function getRefId(): ?int return $this->attr('ref_id'); } - /** - * This object is only available in document type INVOICE or CREDIT. - */ public function setServiceDate(ServiceDate $service_date): void { $this->data['service_date'] = $service_date; diff --git a/src/Models/DocumentAddress.php b/src/Models/DocumentAddress.php index a94651d..185ef4a 100644 --- a/src/Models/DocumentAddress.php +++ b/src/Models/DocumentAddress.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 * This information comes from the customer which can be set with customer_id. */ diff --git a/src/Models/DocumentPayment.php b/src/Models/DocumentPayment.php index a4ecdc5..a5c28dd 100644 --- a/src/Models/DocumentPayment.php +++ b/src/Models/DocumentPayment.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class DocumentPayment implements ToArrayInterface diff --git a/src/Models/DocumentPosition.php b/src/Models/DocumentPosition.php index 2e039e7..f3784f9 100644 --- a/src/Models/DocumentPosition.php +++ b/src/Models/DocumentPosition.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class DocumentPosition implements ToArrayInterface @@ -124,6 +124,11 @@ public function getSinglePriceNet(): ?float return $this->attr('single_price_net'); } + public function setSinglePriceGross(float $single_price_gross): void + { + $this->data['single_price_gross'] = $single_price_gross; + } + public function getSinglePriceGross(): float { return $this->attr('single_price_gross'); diff --git a/src/Models/DocumentRecurring.php b/src/Models/DocumentRecurring.php index e6b6fdb..d2a662f 100644 --- a/src/Models/DocumentRecurring.php +++ b/src/Models/DocumentRecurring.php @@ -7,8 +7,9 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 + * This object is only available in document type RECURRING. */ class DocumentRecurring implements ToArrayInterface { diff --git a/src/Models/Login.php b/src/Models/Login.php index 5d02a58..dbd62ef 100644 --- a/src/Models/Login.php +++ b/src/Models/Login.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class Login implements ToArrayInterface diff --git a/src/Models/LoginSecurity.php b/src/Models/LoginSecurity.php index 4c330b9..b8f9990 100644 --- a/src/Models/LoginSecurity.php +++ b/src/Models/LoginSecurity.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 * This object is only displayed if your request the login resource as an admin. Otherwise this property will be null. */ diff --git a/src/Models/PDFTemplate.php b/src/Models/PDFTemplate.php index e05b399..314ceec 100644 --- a/src/Models/PDFTemplate.php +++ b/src/Models/PDFTemplate.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class PDFTemplate implements ToArrayInterface diff --git a/src/Models/Position.php b/src/Models/Position.php index b1078e6..c87e2ca 100644 --- a/src/Models/Position.php +++ b/src/Models/Position.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class Position implements ToArrayInterface diff --git a/src/Models/PositionExportIdentifierExtended.php b/src/Models/PositionExportIdentifierExtended.php index bb309ed..acaa8b9 100644 --- a/src/Models/PositionExportIdentifierExtended.php +++ b/src/Models/PositionExportIdentifierExtended.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class PositionExportIdentifierExtended implements ToArrayInterface diff --git a/src/Models/PositionGroup.php b/src/Models/PositionGroup.php index 394872f..e225356 100644 --- a/src/Models/PositionGroup.php +++ b/src/Models/PositionGroup.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class PositionGroup implements ToArrayInterface diff --git a/src/Models/PostBox.php b/src/Models/PostBox.php index c1a9b27..dc9d2d7 100644 --- a/src/Models/PostBox.php +++ b/src/Models/PostBox.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class PostBox implements ToArrayInterface diff --git a/src/Models/PostBoxRequest.php b/src/Models/PostBoxRequest.php index b2997e3..e4da1b2 100644 --- a/src/Models/PostBoxRequest.php +++ b/src/Models/PostBoxRequest.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class PostBoxRequest implements ToArrayInterface diff --git a/src/Models/Project.php b/src/Models/Project.php index 0438ce6..3d502fe 100644 --- a/src/Models/Project.php +++ b/src/Models/Project.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class Project implements ToArrayInterface diff --git a/src/Models/SEPAPayment.php b/src/Models/SEPAPayment.php index f113a65..780cbc9 100644 --- a/src/Models/SEPAPayment.php +++ b/src/Models/SEPAPayment.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class SEPAPayment implements ToArrayInterface diff --git a/src/Models/SerialNumber.php b/src/Models/SerialNumber.php index a2fc342..33f6441 100644 --- a/src/Models/SerialNumber.php +++ b/src/Models/SerialNumber.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class SerialNumber implements ToArrayInterface diff --git a/src/Models/ServiceDate.php b/src/Models/ServiceDate.php index ef68b5c..daea422 100644 --- a/src/Models/ServiceDate.php +++ b/src/Models/ServiceDate.php @@ -7,8 +7,9 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 + * This object is only available in document type INVOICE or CREDIT. */ class ServiceDate implements ToArrayInterface { diff --git a/src/Models/Stock.php b/src/Models/Stock.php index 42d6035..bd86d52 100644 --- a/src/Models/Stock.php +++ b/src/Models/Stock.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class Stock implements ToArrayInterface diff --git a/src/Models/Task.php b/src/Models/Task.php index 3746c24..5e895e3 100644 --- a/src/Models/Task.php +++ b/src/Models/Task.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class Task implements ToArrayInterface diff --git a/src/Models/TextTemplate.php b/src/Models/TextTemplate.php index 5de9f9b..1b9cf09 100644 --- a/src/Models/TextTemplate.php +++ b/src/Models/TextTemplate.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class TextTemplate implements ToArrayInterface diff --git a/src/Models/TimeTracking.php b/src/Models/TimeTracking.php index 2941115..cd21af2 100644 --- a/src/Models/TimeTracking.php +++ b/src/Models/TimeTracking.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class TimeTracking implements ToArrayInterface diff --git a/src/Models/WebHook.php b/src/Models/WebHook.php index 9389129..c6678ef 100644 --- a/src/Models/WebHook.php +++ b/src/Models/WebHook.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class WebHook implements ToArrayInterface diff --git a/src/Models/WebHookLastResponse.php b/src/Models/WebHookLastResponse.php index 042e0ff..f613a53 100644 --- a/src/Models/WebHookLastResponse.php +++ b/src/Models/WebHookLastResponse.php @@ -7,7 +7,7 @@ /** * Auto-generated with `composer sdk:models`. * - * @version swagger 1.68.0 + * @version swagger 1.70.1 * @version rest v1 */ class WebHookLastResponse implements ToArrayInterface From 0ee0338cd21aa4c98f35001c7aa03a903f1ee326 Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 19 Jan 2022 20:35:20 +0100 Subject: [PATCH 34/37] Update example --- ...s_create.php => customers_create_and_update.php} | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) rename examples/with_models/{customers_create.php => customers_create_and_update.php} (60%) diff --git a/examples/with_models/customers_create.php b/examples/with_models/customers_create_and_update.php similarity index 60% rename from examples/with_models/customers_create.php rename to examples/with_models/customers_create_and_update.php index aaa6066..7151050 100644 --- a/examples/with_models/customers_create.php +++ b/examples/with_models/customers_create_and_update.php @@ -2,7 +2,7 @@ declare(strict_types=1); -require_once __DIR__ . '../../vendor/autoload.php'; +require_once __DIR__ . '/../../vendor/autoload.php'; use Easybill\SDK\Client; use Easybill\SDK\Endpoint; @@ -10,6 +10,7 @@ $client = new Client(new Endpoint(getenv('API_KEY'))); +## Create Customer $customerCreate = new Customer(); $customerCreate->setFirstName('Foo'); $customerCreate->setLastName('Bar'); @@ -21,3 +22,13 @@ $customer = new Customer($result); var_dump($customer); + +## Update Customer +$customerUpdate = new Customer(); +$customerUpdate->setCompanyName('FooBar Ltd.'); + +$result = $client->request('PUT', "customers/{$customer->getId()}", $customerUpdate->toArray()); + +$customer = new Customer($result); + +var_dump($customer->getCompanyName()); \ No newline at end of file From 4b968828252edbc7af344d6363a6def5df9604ef Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 19 Jan 2022 20:39:22 +0100 Subject: [PATCH 35/37] Update example --- .../with_models/customers_create_and_update.php | 6 +++--- examples/with_models/customers_list.php | 17 +++++++++++++++++ examples/with_models/documents_list.php | 17 +++++++++++++++++ examples/with_models/logins_list.php | 3 ++- 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 examples/with_models/customers_list.php create mode 100644 examples/with_models/documents_list.php diff --git a/examples/with_models/customers_create_and_update.php b/examples/with_models/customers_create_and_update.php index 7151050..7d13a2f 100644 --- a/examples/with_models/customers_create_and_update.php +++ b/examples/with_models/customers_create_and_update.php @@ -10,7 +10,7 @@ $client = new Client(new Endpoint(getenv('API_KEY'))); -## Create Customer +//# Create Customer $customerCreate = new Customer(); $customerCreate->setFirstName('Foo'); $customerCreate->setLastName('Bar'); @@ -23,7 +23,7 @@ var_dump($customer); -## Update Customer +//# Update Customer $customerUpdate = new Customer(); $customerUpdate->setCompanyName('FooBar Ltd.'); @@ -31,4 +31,4 @@ $customer = new Customer($result); -var_dump($customer->getCompanyName()); \ No newline at end of file +var_dump($customer->getCompanyName()); diff --git a/examples/with_models/customers_list.php b/examples/with_models/customers_list.php new file mode 100644 index 0000000..5891023 --- /dev/null +++ b/examples/with_models/customers_list.php @@ -0,0 +1,17 @@ +request('GET', 'customers'); + +$logins = array_map(static fn (array $data): Customer => new Customer($data), $result['items']); + +var_dump($result); diff --git a/examples/with_models/documents_list.php b/examples/with_models/documents_list.php new file mode 100644 index 0000000..93c2391 --- /dev/null +++ b/examples/with_models/documents_list.php @@ -0,0 +1,17 @@ +request('GET', 'documents'); + +$documents = array_map(static fn (array $data): Document => new Document($data), $result['items']); + +var_dump($documents); diff --git a/examples/with_models/logins_list.php b/examples/with_models/logins_list.php index 6ccb067..84e9a1b 100644 --- a/examples/with_models/logins_list.php +++ b/examples/with_models/logins_list.php @@ -11,6 +11,7 @@ $client = new Client(new Endpoint(getenv('API_KEY'))); $result = $client->request('GET', 'logins'); -$result['items'] = array_map(static fn (array $data): Login => new Login($data), $result['items']); + +$logins = array_map(static fn (array $data): Login => new Login($data), $result['items']); var_dump($result); From c78c52e7910f2eb51e3f14f7e4d8e0fa7be5820a Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 19 Jan 2022 20:40:38 +0100 Subject: [PATCH 36/37] Update dependencies --- composer.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index cfa2689..b2acc97 100644 --- a/composer.lock +++ b/composer.lock @@ -2107,16 +2107,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.10", + "version": "9.5.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" + "reference": "2406855036db1102126125537adb1406f7242fdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", - "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", + "reference": "2406855036db1102126125537adb1406f7242fdd", "shasum": "" }, "require": { @@ -2194,11 +2194,11 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" }, "funding": [ { - "url": "https://phpunit.de/donate.html", + "url": "https://phpunit.de/sponsors.html", "type": "custom" }, { @@ -2206,7 +2206,7 @@ "type": "github" } ], - "time": "2021-09-25T07:38:51+00:00" + "time": "2021-12-25T07:07:57+00:00" }, { "name": "psr/cache", @@ -4717,5 +4717,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } From 831dcfb4a0eeb0ffd36339ccfd8c90cd74abbd8d Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 30 Mar 2022 09:28:59 +0200 Subject: [PATCH 37/37] update composer dependencies... --- composer.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/composer.lock b/composer.lock index b2acc97..2cbdb09 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "guzzlehttp/guzzle", - "version": "7.4.1", + "version": "7.4.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" + "reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ac1ec1cd9b5624694c3a40be801d94137afb12b4", + "reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4", "shasum": "" }, "require": { @@ -50,12 +50,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -112,7 +112,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + "source": "https://github.com/guzzle/guzzle/tree/7.4.2" }, "funding": [ { @@ -128,7 +128,7 @@ "type": "tidelift" } ], - "time": "2021-12-06T18:43:05+00:00" + "time": "2022-03-20T14:16:28+00:00" }, { "name": "guzzlehttp/promises", @@ -157,12 +157,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -216,16 +216,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.1.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", "shasum": "" }, "require": { @@ -249,7 +249,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -311,7 +311,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.1.0" + "source": "https://github.com/guzzle/psr7/tree/2.2.1" }, "funding": [ { @@ -327,7 +327,7 @@ "type": "tidelift" } ], - "time": "2021-10-06T17:43:30+00:00" + "time": "2022-03-20T21:55:58+00:00" }, { "name": "psr/http-client",